From: Saleem Abdulrasool Date: Sun, 27 Jul 2014 02:01:24 +0000 (+0000) Subject: builtins: make ARM compilation with GAS work again X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3a2d6a309667461d49e010ea7f96eb8f0cdcf8d9;p=platform%2Fupstream%2Fllvm.git builtins: make ARM compilation with GAS work again The LLVM IAS seems to accept wide instructions for add and sub in ARM mode even though it is not permitted. This uses a macro to ensure that the wide modifier is only applied when building in THUMB mode. This repairs building with GCC/GAS in ARM mode. llvm-svn: 214046 --- diff --git a/compiler-rt/lib/builtins/arm/udivmodsi4.S b/compiler-rt/lib/builtins/arm/udivmodsi4.S index 441f48d..aaece97 100644 --- a/compiler-rt/lib/builtins/arm/udivmodsi4.S +++ b/compiler-rt/lib/builtins/arm/udivmodsi4.S @@ -112,8 +112,8 @@ DEFINE_COMPILERRT_FUNCTION(__udivmodsi4) #define block(shift) \ cmp r0, r1, lsl IMM shift; \ ITT(hs); \ - addhs.w r3, r3, IMM (1 << shift); \ - subhs.w r0, r0, r1, lsl IMM shift + WIDE(addhs) r3, r3, IMM (1 << shift); \ + WIDE(subhs) r0, r0, r1, lsl IMM shift block(31) block(30) diff --git a/compiler-rt/lib/builtins/arm/udivsi3.S b/compiler-rt/lib/builtins/arm/udivsi3.S index 7086a44..bb5f8a0 100644 --- a/compiler-rt/lib/builtins/arm/udivsi3.S +++ b/compiler-rt/lib/builtins/arm/udivsi3.S @@ -112,8 +112,8 @@ DEFINE_COMPILERRT_FUNCTION(__udivsi3) #define block(shift) \ cmp r0, r1, lsl IMM shift; \ ITT(hs); \ - addhs.w r3, r3, IMM (1 << shift); \ - subhs.w r0, r0, r1, lsl IMM shift + WIDE(addhs) r3, r3, IMM (1 << shift); \ + WIDE(subhs) r0, r0, r1, lsl IMM shift block(31) block(30) diff --git a/compiler-rt/lib/builtins/arm/umodsi3.S b/compiler-rt/lib/builtins/arm/umodsi3.S index 93614a0..eb1f441 100644 --- a/compiler-rt/lib/builtins/arm/umodsi3.S +++ b/compiler-rt/lib/builtins/arm/umodsi3.S @@ -107,7 +107,7 @@ DEFINE_COMPILERRT_FUNCTION(__umodsi3) #define block(shift) \ cmp r0, r1, lsl IMM shift; \ IT(hs); \ - subhs.w r0, r0, r1, lsl IMM shift + WIDE(subhs) r0, r0, r1, lsl IMM shift block(31) block(30) diff --git a/compiler-rt/lib/builtins/assembly.h b/compiler-rt/lib/builtins/assembly.h index 8cbd385..6a853dc 100644 --- a/compiler-rt/lib/builtins/assembly.h +++ b/compiler-rt/lib/builtins/assembly.h @@ -99,6 +99,12 @@ #define IT(cond) #define ITT(cond) #endif + +#if __ARM_ARCH_ISA_THUMB == 2 +#define WIDE(op) op.w +#else +#define WIDE(op) op +#endif #endif #define GLUE2(a, b) a##b