[PATCH] [ARM] Improve build attributes emission
Richard Barton
richard.barton.arm at gmail.com
Fri Oct 4 08:29:49 PDT 2013
Hi Amara
Two technical quibbles with Cortex-M4. The rest of the changes are good.
Rich
================
Comment at: lib/Target/ARM/ARMAsmPrinter.cpp:752
@@ +751,3 @@
+ return ARMBuildAttrs::v5TEJ;
+ if (CPU == "cortex-m4" || CPU == "cortex-m4f")
+ return ARMBuildAttrs::v7E_M;
----------------
Why do we need to make a special case of cortex-m4 here? Surely the v7E_M architecture is distinguishable from v7_M by the presence of the DSP functions. I think that this case can be added into the switch case below. The current implementation will give the wrong answer for -mcpu=Swift.
================
Comment at: test/CodeGen/ARM/2010-09-29-mc-asm-header-test.ll:25
@@ +24,3 @@
+
+; V6M: .eabi_attribute 6, 12
+; V6M: .eabi_attribute 7, 77
----------------
IIUC the current behavior is to that armv6m/thumbv6m on the clang commandline generates v6S_M objects because LLVM is not able to generate v6M. If so, I agree that this is the correct wrong thing to do for now.
================
Comment at: test/CodeGen/ARM/2010-09-29-mc-asm-header-test.ll:114
@@ +113,3 @@
+; CORTEX-M4: .eabi_attribute 9, 2
+; CORTEX-M4: .eabi_attribute 10, 5
+; CORTEX-M4: .fpu vfpv4
----------------
This value should be 6, as Cortex-M4 VFP is single-precision only.
http://llvm-reviews.chandlerc.com/D1811
More information about the llvm-commits
mailing list