aboutsummaryrefslogtreecommitdiff
path: root/libcxxabi
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2014-09-11 12:57:02 +0000
committerRenato Golin <renato.golin@linaro.org>2014-09-11 12:57:02 +0000
commit128485ba4791f5b2d9de98e5c24d77e51b461b70 (patch)
tree4334e4cbd51b531589bda4832de0d53f3e8c5e33 /libcxxabi
parente579c76bd57eb7d24111d6d52ed1f5d3e4006b64 (diff)
downloadllvm-128485ba4791f5b2d9de98e5c24d77e51b461b70.zip
llvm-128485ba4791f5b2d9de98e5c24d77e51b461b70.tar.gz
llvm-128485ba4791f5b2d9de98e5c24d77e51b461b70.tar.bz2
ARM Unwind syntax
This patch fixes the bad argument that GAS accepted but the IAS didn't, ie. {#0x20}, moving it to {0x20} which both accept. It also makes the ARMv7+ save/restore correct by using VFP instructions rather than old co-processor ones. Fixes PR20529. llvm-svn: 217585
Diffstat (limited to 'libcxxabi')
-rw-r--r--libcxxabi/src/Unwind/UnwindRegistersRestore.S18
-rw-r--r--libcxxabi/src/Unwind/UnwindRegistersSave.S18
2 files changed, 30 insertions, 6 deletions
diff --git a/libcxxabi/src/Unwind/UnwindRegistersRestore.S b/libcxxabi/src/Unwind/UnwindRegistersRestore.S
index 5fdb789..8744535 100644
--- a/libcxxabi/src/Unwind/UnwindRegistersRestore.S
+++ b/libcxxabi/src/Unwind/UnwindRegistersRestore.S
@@ -347,7 +347,11 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm19restoreVFPWithFL
@ these registers implies they are, actually, available on the target, so
@ it's ok to execute.
@ So, generate the instruction using the corresponding coprocessor mnemonic.
- ldc p11, cr0, [r0], {#0x20} @ fldmiad r0, {d0-d15}
+#if __ARM_ARCH < 7
+ ldc p11, cr0, [r0], {0x20} @ fldmiad r0, {d0-d15}
+#else
+ vldmia r0, {d0-d15}
+#endif
mov pc, lr
@
@@ -358,7 +362,11 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm19restoreVFPWithFL
@
.p2align 2
DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm19restoreVFPWithFLDMXEPy)
- ldc p11, cr0, [r0], {#0x21} @ fldmiax r0, {d0-d15}
+#if __ARM_ARCH < 7
+ ldc p11, cr0, [r0], {0x21} @ fldmiax r0, {d0-d15}
+#else
+ vldmia r0, {d0-d15} @ fldmiax is deprecated in ARMv7+ and now behaves like vldmia
+#endif
mov pc, lr
@
@@ -369,7 +377,11 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm19restoreVFPWithFL
@
.p2align 2
DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm12restoreVFPv3EPy)
- ldcl p11, cr0, [r0], {#0x20} @ vldm r0, {d16-d31}
+#if __ARM_ARCH < 7
+ ldcl p11, cr0, [r0], {0x20} @ vldm r0, {d16-d31}
+#else
+ vldmia r0, {d16-d31}
+#endif
mov pc, lr
@
diff --git a/libcxxabi/src/Unwind/UnwindRegistersSave.S b/libcxxabi/src/Unwind/UnwindRegistersSave.S
index 1e988e2..8f8c359 100644
--- a/libcxxabi/src/Unwind/UnwindRegistersSave.S
+++ b/libcxxabi/src/Unwind/UnwindRegistersSave.S
@@ -318,7 +318,11 @@ DEFINE_LIBUNWIND_FUNCTION(unw_getcontext)
@
.p2align 2
DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm16saveVFPWithFSTMDEPy)
- stc p11, cr0, [r0], {#0x20} @ fstmiad r0, {d0-d15}
+#if __ARM_ARCH < 7
+ stc p11, cr0, [r0], {0x20} @ fstmiad r0, {d0-d15}
+#else
+ vstmia r0, {d0-d15}
+#endif
mov pc, lr
@
@@ -329,7 +333,11 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm16saveVFPWithFSTMD
@
.p2align 2
DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm16saveVFPWithFSTMXEPy)
- stc p11, cr0, [r0], {#0x21} @ fstmiax r0, {d0-d15}
+#if __ARM_ARCH < 7
+ stc p11, cr0, [r0], {0x21} @ fstmiax r0, {d0-d15}
+#else
+ vstmia r0, {d0-d15} @ fstmiax is deprecated in ARMv7+ and now behaves like vstmia
+#endif
mov pc, lr
@
@@ -347,7 +355,11 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind13Registers_arm9saveVFPv3EPy)
@ these registers implies they are, actually, available on the target, so
@ it's ok to execute.
@ So, generate the instructions using the corresponding coprocessor mnemonic.
- stcl p11, cr0, [r0], {#0x20} @ vldm r0, {d16-d31}
+#if __ARM_ARCH < 7
+ stcl p11, cr0, [r0], {0x20} @ vstm r0, {d16-d31}
+#else
+ vstmia r0, {d16-d31}
+#endif
mov pc, lr
@