[PATCH] [lbc++abi] [unwinder] Support Cortex-m0

Saleem Abdulrasool compnerd at compnerd.org
Thu Sep 11 19:12:43 PDT 2014


================
Comment at: src/Unwind/UnwindRegistersSave.S:335
@@ -321,2 +334,3 @@
 #if __ARM_ARCH < 7
+#if defined(__ARM_ARCH_6M__) || defined(__ARM_ARCH_6SM__) 
   stc p11, cr0, [r0], {0x20}  @ fstmiad r0, {d0-d15}
----------------
Doesn't this change the behavior for __ARM_ARCH >= 7?

================
Comment at: src/Unwind/UnwindRegistersSave.S:352
@@ -336,2 +351,3 @@
 #if __ARM_ARCH < 7
+#if defined(__ARM_ARCH_6M__) || defined(__ARM_ARCH_6SM__) 
   stc p11, cr0, [r0], {0x21}  @ fstmiax r0, {d0-d15}
----------------
Doesn't this change the behavior for __ARM_ARCH >= 7?

================
Comment at: src/Unwind/UnwindRegistersSave.S:368
@@ -350,2 +367,3 @@
 DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm9saveVFPv3EPy)
+#if defined(__ARM_ARCH_6M__) || defined(__ARM_ARCH_6SM__) 
   @ VFP and iwMMX instructions are only available when compiling with the flags
----------------
This also doesn't work for ARMv7.  Consider ARM VFPv3-d16 (e.g. Tegra2) ... vstmia r0, {d16-d31} refers to a non-existent register set.

================
Comment at: src/Unwind/UnwindRegistersSave.S:392
@@ -372,2 +391,3 @@
 DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm9saveiWMMXEPy)
+#if (!defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_6SM__)) || __ARM_WMMX
   stcl p1, cr0, [r0], #8  @ wstrd wR0, [r0], #8
----------------
Do all CPUs have the wmmxt register set?  It might be more prudent to move this out into a separate translation unit that is linked in if the target supports iwmmxt.

================
Comment at: src/Unwind/UnwindRegistersSave.S:419
@@ -397,2 +418,3 @@
   .p2align 2
-DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm16saveiWMMXControlEPj)
+DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm16saveiWMMXControlEPm)
+#if (!defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_6SM__)) || __ARM_WMMX
----------------
Oh joy ... this is scary.

Do we have some guarantee that they won't accidentally use long rather than int?

================
Comment at: src/Unwind/UnwindRegistersSave.S:420
@@ -399,1 +419,3 @@
+DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm16saveiWMMXControlEPm)
+#if (!defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_6SM__)) || __ARM_WMMX
   stc2 p1, cr8, [r0], #4  @ wstrw wCGR0, [r0], #4
----------------
Similar to above.

http://reviews.llvm.org/D5314






More information about the cfe-commits mailing list