[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

llvm-svn: 292727
This commit is contained in:
Weiming Zhao 2017-01-21 18:24:55 +00:00
parent 478a83c905
commit 19f47ace40
5 changed files with 6 additions and 5 deletions

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

@ -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):

View File

@ -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