builtins: add it blocks for Thumb-2

Add the missing IT-blocks for Thumb-2 compilation for code paths exercised by
older ARM CPUs.  This should fix the buildbots.

llvm-svn: 211035
This commit is contained in:
Saleem Abdulrasool 2014-06-16 16:36:25 +00:00
parent 19d02371c9
commit 8f2efc3a91
3 changed files with 38 additions and 8 deletions

View File

@ -99,9 +99,16 @@ DEFINE_COMPILERRT_FUNCTION(__udivmodsi4)
#define IMM #
#define block(shift) \
cmp r0, r1, lsl IMM shift; \
addhs r3, r3, IMM (1 << shift); \
#if __ARM_ARCH_ISA_THUMB == 2
#define ITT itt
#else
#define ITT @
#endif
#define block(shift) \
cmp r0, r1, lsl IMM shift; \
ITT hs; \
addhs r3, r3, IMM (1 << shift); \
subhs r0, r0, r1, lsl IMM shift
block(31)

View File

@ -20,6 +20,14 @@
.thumb
#endif
#if __ARM_ARCH_ISA_THUMB == 2
#define IT it
#define ITT itt
#else
#define IT @
#define ITT @
#endif
.p2align 2
DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_uidiv, __udivsi3)
DEFINE_COMPILERRT_FUNCTION(__udivsi3)
@ -32,9 +40,12 @@ DEFINE_COMPILERRT_FUNCTION(__udivsi3)
bx lr
#else
cmp r1, #1
IT cc
bcc LOCAL_LABEL(divby0)
IT eq
JMPc(lr, eq)
cmp r0, r1
ITT cc
movcc r0, #0
JMPc(lr, cc)
/*
@ -97,9 +108,10 @@ DEFINE_COMPILERRT_FUNCTION(__udivsi3)
#define IMM #
#define block(shift) \
cmp r0, r1, lsl IMM shift; \
addhs r3, r3, IMM (1 << shift); \
#define block(shift) \
cmp r0, r1, lsl IMM shift; \
ITT hs; \
addhs r3, r3, IMM (1 << shift); \
subhs r0, r0, r1, lsl IMM shift
block(31)

View File

@ -20,6 +20,14 @@
.thumb
#endif
#if __ARM_ARCH_ISA_THUMB == 2
#define IT it
#define ITT itt
#else
#define IT @
#define ITT @
#endif
.p2align 2
DEFINE_COMPILERRT_FUNCTION(__umodsi3)
#if __ARM_ARCH_EXT_IDIV__
@ -33,9 +41,11 @@ DEFINE_COMPILERRT_FUNCTION(__umodsi3)
#else
cmp r1, #1
bcc LOCAL_LABEL(divby0)
ITT eq
moveq r0, #0
JMPc(lr, eq)
cmp r0, r1
IT cc
JMPc(lr, cc)
/*
* Implement division using binary long division algorithm.
@ -93,8 +103,9 @@ DEFINE_COMPILERRT_FUNCTION(__umodsi3)
#define IMM #
#define block(shift) \
cmp r0, r1, lsl IMM shift; \
#define block(shift) \
cmp r0, r1, lsl IMM shift; \
IT hs; \
subhs r0, r0, r1, lsl IMM shift
block(31)