Craig Topper via llvm-dev
2021-Jun-08 04:06 UTC
[llvm-dev] [proposal] change default ABI for special riscv arch
That one line change doesn't look like it handles multiletter extension names correctly. For example, Zbf contains "f". ~Craig On Mon, Jun 7, 2021 at 8:13 PM Ben Shi via llvm-dev <llvm-dev at lists.llvm.org> wrote:> Hello, > > In the clang's riscv driver, > > https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/Arch/RISCV.cpp > > the default abi is fomulated according to arch if no explicit -mabi is > specified. > > Is it possible to set the default abi to ilp32f for -march=rv32imacf. For > my exployer's chip, HW F is used while SW D is used. Each time I have to > write "-march=rv32imacf -mabi=ilp32f“, can it be simplified to only > "-march=imacf" ? Just adding a line is enough. > > if (MArch.substr(4).contains_lower("f") && !MArch.substr(4).contains_lower > ("d")) > return "ilp32f"; > > Can I submit a patch to fix it? > > Ben > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210607/ab923b91/attachment.html>
Ben Shi via llvm-dev
2021-Jun-08 04:20 UTC
[llvm-dev] [proposal] change default ABI for special riscv arch
I will figure out all corner cases, thanks for your support. :) At 2021-06-08 12:06:15, "Craig Topper" <craig.topper at gmail.com> wrote: That one line change doesn't look like it handles multiletter extension names correctly. For example, Zbf contains "f". ~Craig On Mon, Jun 7, 2021 at 8:13 PM Ben Shi via llvm-dev <llvm-dev at lists.llvm.org> wrote: Hello, In the clang's riscv driver, https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/Arch/RISCV.cpp the default abi is fomulated according to arch if no explicit -mabi is specified. Is it possible to set the default abi to ilp32f for -march=rv32imacf. For my exployer's chip, HW F is used while SW D is used. Each time I have to write "-march=rv32imacf -mabi=ilp32f“, can it be simplified to only "-march=imacf" ? Just adding a line is enough. if (MArch.substr(4).contains_lower("f") && !MArch.substr(4).contains_lower("d")) return "ilp32f"; Can I submit a patch to fix it? Ben _______________________________________________ LLVM Developers mailing list llvm-dev at lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210608/6475b213/attachment.html>
Ben Shi via llvm-dev
2021-Jun-08 08:26 UTC
[llvm-dev] [proposal] change default ABI for special riscv arch
I also think the logic of fomulating default arch according to -mabi can be improved. // 3. Choose a default based on `-mabi=` // // ilp32e -> rv32e // ilp32 | ilp32f | ilp32d -> rv32imafdc // lp64 | lp64f | lp64d -> rv64imafdc it can be // ilp32e -> rv32e // ilp32 -> rv32imac // ilp32f -> rv32imacf // ilp32d -> rv32 imacfd // lp64 -> rv64imac // lp64f -> rv64imacf // lp64d -> rv64imacfd At 2021-06-08 12:06:15, "Craig Topper" <craig.topper at gmail.com> wrote: That one line change doesn't look like it handles multiletter extension names correctly. For example, Zbf contains "f". ~Craig On Mon, Jun 7, 2021 at 8:13 PM Ben Shi via llvm-dev <llvm-dev at lists.llvm.org> wrote: Hello, In the clang's riscv driver, https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/Arch/RISCV.cpp the default abi is fomulated according to arch if no explicit -mabi is specified. Is it possible to set the default abi to ilp32f for -march=rv32imacf. For my exployer's chip, HW F is used while SW D is used. Each time I have to write "-march=rv32imacf -mabi=ilp32f“, can it be simplified to only "-march=imacf" ? Just adding a line is enough. if (MArch.substr(4).contains_lower("f") && !MArch.substr(4).contains_lower("d")) return "ilp32f"; Can I submit a patch to fix it? Ben _______________________________________________ LLVM Developers mailing list llvm-dev at lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210608/1501a4e8/attachment.html>