diff options
author | Weiming Zhao <weimingz@codeaurora.org> | 2017-01-30 18:48:05 +0000 |
---|---|---|
committer | Weiming Zhao <weimingz@codeaurora.org> | 2017-01-30 18:48:05 +0000 |
commit | 220f64c5cf362c3b2a31b79fd1c606bf3c99933f (patch) | |
tree | f97d6440c0c6a1b037c1dd0b375f80555ba44f8e /lib | |
parent | 4775ff6686a4b3991cfe5bfcfd009d0977d64c71 (diff) |
[Bultin][ARM] Make aeabi_uldivmod and aeabi_ldivmod be Thumb1 compatible
Summary:
in aeabi_ldivmod and uldivmod, using r6 instead of r12 as the temp reg due to limitation of Thumb1 ISA.
Now, all EABI sources are Thumb1 compatible.
Also added test cases by reusing the test cases from divmodsi4_test.c, udivmodsi4_test and udivmoddi4_test.c
Reviewers: rengolin, compnerd
Reviewed By: rengolin
Subscribers: javed.absar, aemerson, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D29226
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@293527 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/builtins/CMakeLists.txt | 19 | ||||
-rw-r--r-- | lib/builtins/arm/aeabi_ldivmod.S | 20 | ||||
-rw-r--r-- | lib/builtins/arm/aeabi_uldivmod.S | 20 |
3 files changed, 21 insertions, 38 deletions
diff --git a/lib/builtins/CMakeLists.txt b/lib/builtins/CMakeLists.txt index 66281d377..939e40946 100644 --- a/lib/builtins/CMakeLists.txt +++ b/lib/builtins/CMakeLists.txt @@ -327,23 +327,6 @@ set(arm_EABI_SOURCES arm/aeabi_uidivmod.S arm/aeabi_uldivmod.S) -set(thumb1_EABI_SOURCES - arm/aeabi_cdcmp.S - arm/aeabi_cdcmpeq_check_nan.c - arm/aeabi_cfcmp.S - arm/aeabi_cfcmpeq_check_nan.c - arm/aeabi_dcmp.S - arm/aeabi_div0.c - arm/aeabi_drsub.c - arm/aeabi_fcmp.S - arm/aeabi_frsub.c - arm/aeabi_idivmod.S - arm/aeabi_memcmp.S - arm/aeabi_memcpy.S - arm/aeabi_memset.S - arm/aeabi_memmove.S - arm/aeabi_uidivmod.S) - set(arm_Thumb1_JT_SOURCES arm/switch16.S arm/switch32.S @@ -428,7 +411,7 @@ elseif(NOT WIN32) set(thumb1_SOURCES ${thumb1_SOURCES} - ${thumb1_EABI_SOURCES}) + ${arm_EABI_SOURCES}) endif() set(aarch64_SOURCES diff --git a/lib/builtins/arm/aeabi_ldivmod.S b/lib/builtins/arm/aeabi_ldivmod.S index 3dae14ef0..038ae5d72 100644 --- a/lib/builtins/arm/aeabi_ldivmod.S +++ b/lib/builtins/arm/aeabi_ldivmod.S @@ -23,23 +23,23 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__aeabi_ldivmod) - push {r11, lr} + push {r6, lr} sub sp, sp, #16 - add r12, sp, #8 - str r12, [sp] + add r6, sp, #8 + str r6, [sp] #if defined(__MINGW32__) - mov r12, r0 - mov r0, r2 - mov r2, r12 - mov r12, r1 - mov r1, r3 - mov r3, r12 + movs r6, r0 + movs r0, r2 + movs r2, r6 + movs r6, r1 + movs r1, r3 + movs r3, r6 #endif bl SYMBOL_NAME(__divmoddi4) ldr r2, [sp, #8] ldr r3, [sp, #12] add sp, sp, #16 - pop {r11, pc} + pop {r6, pc} END_COMPILERRT_FUNCTION(__aeabi_ldivmod) NO_EXEC_STACK_DIRECTIVE diff --git a/lib/builtins/arm/aeabi_uldivmod.S b/lib/builtins/arm/aeabi_uldivmod.S index bc26e5674..be343b6bc 100644 --- a/lib/builtins/arm/aeabi_uldivmod.S +++ b/lib/builtins/arm/aeabi_uldivmod.S @@ -23,23 +23,23 @@ .syntax unified .p2align 2 DEFINE_COMPILERRT_FUNCTION(__aeabi_uldivmod) - push {r11, lr} + push {r6, lr} sub sp, sp, #16 - add r12, sp, #8 - str r12, [sp] + add r6, sp, #8 + str r6, [sp] #if defined(__MINGW32__) - mov r12, r0 - mov r0, r2 - mov r2, r12 - mov r12, r1 - mov r1, r3 - mov r3, r12 + movs r6, r0 + movs r0, r2 + movs r2, r6 + movs r6, r1 + movs r1, r3 + movs r3, r6 #endif bl SYMBOL_NAME(__udivmoddi4) ldr r2, [sp, #8] ldr r3, [sp, #12] add sp, sp, #16 - pop {r11, pc} + pop {r6, pc} END_COMPILERRT_FUNCTION(__aeabi_uldivmod) NO_EXEC_STACK_DIRECTIVE |