[compiler-rt] r292727 - [Bultin][ARM] Make aeabi_memset be Thumb1 compatible and other asm

Weiming Zhao via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 21 10:24:56 PST 2017


Author: weimingz
Date: Sat Jan 21 12:24:55 2017
New Revision: 292727

URL: http://llvm.org/viewvc/llvm-project?rev=292727&view=rev
Log:
[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

Modified:
    compiler-rt/trunk/lib/builtins/CMakeLists.txt
    compiler-rt/trunk/lib/builtins/arm/aeabi_idivmod.S
    compiler-rt/trunk/lib/builtins/arm/aeabi_memset.S
    compiler-rt/trunk/lib/builtins/arm/aeabi_uidivmod.S
    compiler-rt/trunk/lib/builtins/arm/comparesf2.S

Modified: compiler-rt/trunk/lib/builtins/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/CMakeLists.txt?rev=292727&r1=292726&r2=292727&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/builtins/CMakeLists.txt Sat Jan 21 12:24:55 2017
@@ -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)
 

Modified: compiler-rt/trunk/lib/builtins/arm/aeabi_idivmod.S
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/arm/aeabi_idivmod.S?rev=292727&r1=292726&r2=292727&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/arm/aeabi_idivmod.S (original)
+++ compiler-rt/trunk/lib/builtins/arm/aeabi_idivmod.S Sat Jan 21 12:24:55 2017
@@ -26,7 +26,7 @@ DEFINE_COMPILERRT_FUNCTION(__aeabi_idivm
         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

Modified: compiler-rt/trunk/lib/builtins/arm/aeabi_memset.S
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/arm/aeabi_memset.S?rev=292727&r1=292726&r2=292727&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/arm/aeabi_memset.S (original)
+++ compiler-rt/trunk/lib/builtins/arm/aeabi_memset.S Sat Jan 21 12:24:55 2017
@@ -26,7 +26,7 @@ DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_mems
 
 DEFINE_COMPILERRT_FUNCTION(__aeabi_memclr)
         mov     r2, r1
-        mov     r1, #0
+        movs    r1, #0
         b       memset
 END_COMPILERRT_FUNCTION(__aeabi_memclr)
 

Modified: compiler-rt/trunk/lib/builtins/arm/aeabi_uidivmod.S
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/arm/aeabi_uidivmod.S?rev=292727&r1=292726&r2=292727&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/arm/aeabi_uidivmod.S (original)
+++ compiler-rt/trunk/lib/builtins/arm/aeabi_uidivmod.S Sat Jan 21 12:24:55 2017
@@ -29,7 +29,7 @@ DEFINE_COMPILERRT_FUNCTION(__aeabi_uidiv
         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):

Modified: compiler-rt/trunk/lib/builtins/arm/comparesf2.S
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/arm/comparesf2.S?rev=292727&r1=292726&r2=292727&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/arm/comparesf2.S (original)
+++ compiler-rt/trunk/lib/builtins/arm/comparesf2.S Sat Jan 21 12:24:55 2017
@@ -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




More information about the llvm-commits mailing list