Sumanth Gundapaneni
2015-Jan-28 00:37 UTC
[LLVMdev] CPUStringIsValid() into MCSubtargetInfo and use it for ARM .cpu parsing
Hi Divacky, I have an armv7 variant that supports hardware division (extension). For my variant, I use ".cpu cortex-a9" and division attribute(.eabi_attribute 44, 2 @ Tag_DIV_use) to let the assembler do the right thing if it encounters a division instruction. With your path, the .cpu directive is used to fetch the available features of a CPU and ignores the eabi attributes. What should be the approach to fix the issue which I am facing ? Shouldn't the eabi attributes be honored ? --Sumanth G -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150127/bae03149/attachment.html>
Tim Northover
2015-Jan-28 02:43 UTC
[LLVMdev] CPUStringIsValid() into MCSubtargetInfo and use it for ARM .cpu parsing
Hi Sumanth,> Shouldn’t the eabi attributes be honored ?EABI attributes are instructions for the linker on which object files are compatible with each other, not instructions for the assembler (and trying to make them so sounds like a recipe for confusion to me).>From the ARM ABI addenda:"Build attributes record data that a linker needs to reason mechanically about the compatibility, or incompatibility, of a set of relocatable files."> What should be the approach to fix the issue which I am facing?There are a few options here: 1. Specify an existing CPU that has hardware division (notably, Cortex-A9 doesn't). 2. Teach LLVM & Clang about your CPU's features, either locally or upstream. 3. Pass "-mhwdiv=arm,thumb" to Clang (or less if you only have hwdiv in one mode). Cheers. Tim.
Sumanth Gundapaneni
2015-Jan-29 03:30 UTC
[LLVMdev] CPUStringIsValid() into MCSubtargetInfo and use it for ARM .cpu parsing
Tim, How about the below option ? 1. Specify an existing generic armv7 CPU or the CPU which is close my custom variant. My custom variant can be treated as "cortex-a9" + hwdiv. So my CPU here is "cortex-a9" 2. Specify the ".arch_extension idiv" which is available as an extension for my custom variant. 3. Teach LLVM & Clang about your CPU's features, either locally or upstream. 4. Pass "-mhwdiv=arm,thumb" to Clang (or less if you only have hwdiv in one mode). --Sumanth G -----Original Message----- From: Tim Northover [mailto:t.p.northover at gmail.com] Sent: Tuesday, January 27, 2015 6:44 PM To: Sumanth Gundapaneni Cc: LLVM Developers Mailing List; Roman Divacky; Ana Pazos Subject: Re: [LLVMdev] CPUStringIsValid() into MCSubtargetInfo and use it for ARM .cpu parsing Hi Sumanth,> Shouldn’t the eabi attributes be honored ?EABI attributes are instructions for the linker on which object files are compatible with each other, not instructions for the assembler (and trying to make them so sounds like a recipe for confusion to me).>From the ARM ABI addenda:"Build attributes record data that a linker needs to reason mechanically about the compatibility, or incompatibility, of a set of relocatable files."> What should be the approach to fix the issue which I am facing?There are a few options here: 1. Specify an existing CPU that has hardware division (notably, Cortex-A9 doesn't). 2. Teach LLVM & Clang about your CPU's features, either locally or upstream. 3. Pass "-mhwdiv=arm,thumb" to Clang (or less if you only have hwdiv in one mode). Cheers. Tim.
Reasonably Related Threads
- [LLVMdev] CPUStringIsValid() into MCSubtargetInfo and use it for ARM .cpu parsing
- [LLVMdev] CPUStringIsValid() into MCSubtargetInfo and use it for ARM .cpu parsing
- [LLVMdev] CPUStringIsValid() into MCSubtargetInfo and use it for ARM .cpu parsing
- [LLVMdev] CPUStringIsValid() into MCSubtargetInfo and use it for ARM .cpu parsing
- LLVMTargetMachine with optimization level passed from clang.