summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorWeiming Zhao <weimingz@codeaurora.org>2017-01-21 18:24:55 +0000
committerWeiming Zhao <weimingz@codeaurora.org>2017-01-21 18:24:55 +0000
commitfd90db7e2b950ccfed1d96d71ae4a043b3c29b58 (patch)
tree5a9e20798c58ea98bb9fff3ee2900e34809e8e39 /lib
parentb69e84dee887092596a6b9037b7ae71a5c4879ad (diff)
[Bultin][ARM] Make aeabi_memset be Thumb1 compatible and other asm
syntax fix Summary: Make the asm of aeabi_memset be assembled for thumb1. Also fix some instructions to conform with the syntax of ARM reference manual. For example, muls requires the form of "Rd, Rn, Rd" and orrs requires the form of "Rd, Rm". Clang-as is benign but it may fail other assembler if not in the exact form. Reviewers: rengolin, compnerd, kubamracek Reviewed By: rengolin, compnerd Subscribers: aemerson, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D28971 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@292727 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/builtins/CMakeLists.txt1
-rw-r--r--lib/builtins/arm/aeabi_idivmod.S2
-rw-r--r--lib/builtins/arm/aeabi_memset.S2
-rw-r--r--lib/builtins/arm/aeabi_uidivmod.S2
-rw-r--r--lib/builtins/arm/comparesf2.S4
5 files changed, 6 insertions, 5 deletions
diff --git a/lib/builtins/CMakeLists.txt b/lib/builtins/CMakeLists.txt
index 775dafe89..2649c08fe 100644
--- a/lib/builtins/CMakeLists.txt
+++ b/lib/builtins/CMakeLists.txt
@@ -337,6 +337,7 @@ set(thumb1_EABI_SOURCES
arm/aeabi_idivmod.S
arm/aeabi_memcmp.S
arm/aeabi_memcpy.S
+ arm/aeabi_memset.S
arm/aeabi_memmove.S
arm/aeabi_uidivmod.S)
diff --git a/lib/builtins/arm/aeabi_idivmod.S b/lib/builtins/arm/aeabi_idivmod.S
index b43ea6990..0164b15dc 100644
--- a/lib/builtins/arm/aeabi_idivmod.S
+++ b/lib/builtins/arm/aeabi_idivmod.S
@@ -26,7 +26,7 @@ DEFINE_COMPILERRT_FUNCTION(__aeabi_idivmod)
push {r0, r1, lr}
bl SYMBOL_NAME(__divsi3)
pop {r1, r2, r3} // now r0 = quot, r1 = num, r2 = denom
- muls r2, r2, r0 // r2 = quot * denom
+ muls r2, r0, r2 // r2 = quot * denom
subs r1, r1, r2
JMP (r3)
#else
diff --git a/lib/builtins/arm/aeabi_memset.S b/lib/builtins/arm/aeabi_memset.S
index 48edd8970..633f59227 100644
--- a/lib/builtins/arm/aeabi_memset.S
+++ b/lib/builtins/arm/aeabi_memset.S
@@ -26,7 +26,7 @@ DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memset8, __aeabi_memset)
DEFINE_COMPILERRT_FUNCTION(__aeabi_memclr)
mov r2, r1
- mov r1, #0
+ movs r1, #0
b memset
END_COMPILERRT_FUNCTION(__aeabi_memclr)
diff --git a/lib/builtins/arm/aeabi_uidivmod.S b/lib/builtins/arm/aeabi_uidivmod.S
index 7098bc6ff..a627fc740 100644
--- a/lib/builtins/arm/aeabi_uidivmod.S
+++ b/lib/builtins/arm/aeabi_uidivmod.S
@@ -29,7 +29,7 @@ DEFINE_COMPILERRT_FUNCTION(__aeabi_uidivmod)
push {r0, r1, lr}
bl SYMBOL_NAME(__aeabi_uidiv)
pop {r1, r2, r3}
- muls r2, r2, r0 // r2 = quot * denom
+ muls r2, r0, r2 // r2 = quot * denom
subs r1, r1, r2
JMP (r3)
LOCAL_LABEL(case_denom_larger):
diff --git a/lib/builtins/arm/comparesf2.S b/lib/builtins/arm/comparesf2.S
index e8095650e..e5836e61c 100644
--- a/lib/builtins/arm/comparesf2.S
+++ b/lib/builtins/arm/comparesf2.S
@@ -69,7 +69,7 @@ DEFINE_COMPILERRT_FUNCTION(__eqsf2)
// the subsequent operations.
#if __ARM_ARCH_ISA_THUMB == 1
lsrs r6, r3, #1
- orrs r6, r2, r6
+ orrs r6, r2
#else
orrs r12, r2, r3, lsr #1
#endif
@@ -194,7 +194,7 @@ DEFINE_COMPILERRT_FUNCTION(__gtsf2)
lsls r2, r0, #1
lsls r3, r1, #1
lsrs r6, r3, #1
- orrs r6, r2, r6
+ orrs r6, r2
beq 1f
movs r6, r0
eors r6, r1