compiler-rt: prefer thumb over ARM

When possible, use Thumb or Thumb-2 over ARM instructions.  This is particularly
important for pure-Thumb environments (e.g. Windows on ARM).  Although, it is
possible to conditionalise this for that target specifically, this is available
on most newer ARM CPUs, and the code remains compatible with older CPUs with no
adverse effects.  It therefore feels better to always prefer Thumb when
possible.

llvm-svn: 211032
This commit is contained in:
Saleem Abdulrasool 2014-06-16 16:05:24 +00:00
parent 78e1ca692b
commit 1b8f1a4430
10 changed files with 31 additions and 0 deletions

View File

@ -11,6 +11,9 @@
.syntax unified
.text
#if __ARM_ARCH_ISA_THUMB == 2
.thumb
#endif
//
// extern uint64_t __bswapdi2(uint64_t);

View File

@ -11,6 +11,9 @@
.syntax unified
.text
#if __ARM_ARCH_ISA_THUMB == 2
.thumb
#endif
//
// extern uint32_t __bswapsi2(uint32_t);

View File

@ -15,6 +15,10 @@
.syntax unified
.text
#if __ARM_ARCH_ISA_THUMB == 2
.thumb
#endif
.p2align 2
DEFINE_COMPILERRT_FUNCTION(__clzdi2)

View File

@ -15,6 +15,9 @@
.syntax unified
.text
#if __ARM_ARCH_ISA_THUMB == 2
.thumb
#endif
.p2align 2
DEFINE_COMPILERRT_FUNCTION(__clzsi2)

View File

@ -23,6 +23,9 @@
.syntax unified
.text
#if __ARM_ARCH_ISA_THUMB == 2
.thumb
#endif
.p2align 3
DEFINE_COMPILERRT_FUNCTION(__divmodsi4)

View File

@ -22,6 +22,9 @@
.syntax unified
.text
#if __ARM_ARCH_ISA_THUMB == 2
.thumb
#endif
.p2align 3
// Ok, APCS and AAPCS agree on 32 bit args, so it's safe to use the same routine.

View File

@ -22,6 +22,9 @@
.syntax unified
.text
#if __ARM_ARCH_ISA_THUMB == 2
.thumb
#endif
.p2align 3
DEFINE_COMPILERRT_FUNCTION(__modsi3)

View File

@ -16,6 +16,9 @@
.syntax unified
.text
#if __ARM_ARCH_ISA_THUMB == 2
.thumb
#endif
.p2align 2
DEFINE_COMPILERRT_FUNCTION(__udivmodsi4)

View File

@ -16,6 +16,9 @@
.syntax unified
.text
#if __ARM_ARCH_ISA_THUMB == 2
.thumb
#endif
.p2align 2
DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_uidiv, __udivsi3)

View File

@ -16,6 +16,9 @@
.syntax unified
.text
#if __ARM_ARCH_ISA_THUMB == 2
.thumb
#endif
.p2align 2
DEFINE_COMPILERRT_FUNCTION(__umodsi3)