[PATCH] [lbc++abi] [unwinder] Support Cortex-m0
Renato Golin
renato.golin at linaro.org
Fri Sep 12 04:19:12 PDT 2014
================
Comment at: src/Unwind/UnwindRegistersRestore.S:341
@@ -330,1 +340,3 @@
+#endif
+#if __ARM_ARCH > 4 || __ARM_ARCH_4T__
bx lr
----------------
I think we should use the same trick we used in other ARM files, to define a macro that is set by the arch for returning.
================
Comment at: src/Unwind/UnwindRegistersRestore.S:355
@@ -342,2 +354,3 @@
DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm19restoreVFPWithFLDMDEPy)
+#if !defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_6SM__)
@ VFP and iwMMX instructions are only available when compiling with the flags
----------------
Do you want to export the symbols (unwindVFP) but have it do nothing? Is it even possible to try to unwind VFP on v6M? Shouldn't this be a compilation error?
================
Comment at: src/Unwind/UnwindRegistersRestore.S:380
@@ -365,2 +379,3 @@
#if __ARM_ARCH < 7
+#if !defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_6SM__)
ldc p11, cr0, [r0], {0x21} @ fldmiax r0, {d0-d15}
----------------
This macro is in a different order than the one above, and will generate vldmia on v6M which will fail.
================
Comment at: src/Unwind/UnwindRegistersSave.S:285
@@ -284,1 +284,3 @@
+#if defined(__ARM_ARCH_6M__) || defined(__ARM_ARCH_6SM__)
+ .thumb
----------------
Maybe we should also have a macro that will use thumb on thumb-only platforms like v6M and v6M variants. That would have to be accompanied by changes to other areas, making them Thumb/2 friendly (like the ones you add here).
================
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
----------------
compnerd wrote:
> 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.
And this is exactly the opposite as the other, which would just get "bx lr" on ARMv6M
http://reviews.llvm.org/D5314
More information about the cfe-commits
mailing list