[PATCH] D28971: [Bultin][ARM] Make aeabi_memset be Thumb1 compatible

Weiming Zhao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 20 13:50:59 PST 2017


weimingz created this revision.
Herald added subscribers: mgorny, aemerson.

Also fix some instructions to conform with the syntax of ARM reference manual. 
For example, muls Rd, Rn, Rd and orrs Rd, Rm


https://reviews.llvm.org/D28971

Files:
  lib/builtins/CMakeLists.txt
  lib/builtins/arm/aeabi_idivmod.S
  lib/builtins/arm/aeabi_memset.S
  lib/builtins/arm/aeabi_uidivmod.S
  lib/builtins/arm/comparesf2.S


Index: lib/builtins/arm/comparesf2.S
===================================================================
--- lib/builtins/arm/comparesf2.S
+++ lib/builtins/arm/comparesf2.S
@@ -69,7 +69,7 @@
     // 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 @@
     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
Index: lib/builtins/arm/aeabi_uidivmod.S
===================================================================
--- lib/builtins/arm/aeabi_uidivmod.S
+++ lib/builtins/arm/aeabi_uidivmod.S
@@ -29,7 +29,7 @@
         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):
Index: lib/builtins/arm/aeabi_memset.S
===================================================================
--- lib/builtins/arm/aeabi_memset.S
+++ lib/builtins/arm/aeabi_memset.S
@@ -26,7 +26,7 @@
 
 DEFINE_COMPILERRT_FUNCTION(__aeabi_memclr)
         mov     r2, r1
-        mov     r1, #0
+        movs    r1, #0
         b       memset
 END_COMPILERRT_FUNCTION(__aeabi_memclr)
 
Index: lib/builtins/arm/aeabi_idivmod.S
===================================================================
--- lib/builtins/arm/aeabi_idivmod.S
+++ lib/builtins/arm/aeabi_idivmod.S
@@ -26,7 +26,7 @@
         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
Index: lib/builtins/CMakeLists.txt
===================================================================
--- lib/builtins/CMakeLists.txt
+++ lib/builtins/CMakeLists.txt
@@ -337,6 +337,7 @@
   arm/aeabi_idivmod.S
   arm/aeabi_memcmp.S
   arm/aeabi_memcpy.S
+  arm/aeabi_memset.S
   arm/aeabi_memmove.S
   arm/aeabi_uidivmod.S)
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28971.85188.patch
Type: text/x-patch
Size: 2322 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170120/a4f6e380/attachment.bin>


More information about the llvm-commits mailing list