[PATCH] [ARM] Improve build attributes emission

Renato Golin renato.golin at linaro.org
Thu Oct 3 06:34:44 PDT 2013


  LGTM otherwise.


================
Comment at: lib/Target/ARM/ARMAsmPrinter.cpp:757
@@ +756,3 @@
+    return ARMBuildAttrs::v7;
+  else if (Subtarget->hasV6T2Ops())
+    return ARMBuildAttrs::v6T2;
----------------
Richard Barton wrote:
> It looks like this table will have to also take into account M-Profile to distinguish between v6-M and normal v6 architectures.
Isn't that covered by the Subtarget->isMClass() below?

================
Comment at: test/CodeGen/ARM/2010-09-29-mc-asm-header-test.ll:63
@@ +62,3 @@
+; CORTEX-M0:  .cpu cortex-m0
+; CORTEX-M0:  .eabi_attribute 6, 6
+; CORTEX-M0:  .eabi_attribute 7, 77
----------------
Richard Barton wrote:
> Cortex-M0 is actually v6S-M, so this attribute should have the value 12. v6S-M is v6-M with the System extensions. I don't believe LLVM has any awareness of these extensions, so v6-M is probably the best we can do for Cortex-M* cores right now. 
> 
> I think this test is trying to test a Thumb1-only core, so perhaps the best thing to do here would be to test -march=armv6m instead of a Cortex-M CPU.
> 
> If the test was trying to test a normal v6 core, then you should try an arm11 core. Given the technical change you need to make, I think that test will be needed anyway.
-march=armv6m defaults to M0, so it's essentially the same thing.

I agree more tests are needed, especially v6 ones.


http://llvm-reviews.chandlerc.com/D1811



More information about the llvm-commits mailing list