diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2011-04-19 17:52:09 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2011-04-19 17:52:09 +0000 |
commit | 1c5f89b1dd741135a4007ab577723d422f421eec (patch) | |
tree | cc4bc911bef51c2a78946ec54aac48020bebf9de /lib | |
parent | 37b97d1cf4501b94347e0b4e880f4b25825a289f (diff) | |
download | compiler-rt-1c5f89b1dd741135a4007ab577723d422f421eec.tar.gz compiler-rt-1c5f89b1dd741135a4007ab577723d422f421eec.tar.bz2 compiler-rt-1c5f89b1dd741135a4007ab577723d422f421eec.tar.xz |
Move abi bits to separate header. Force AAPCS for EABI in accordance with ARM RTABI.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@129769 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
60 files changed, 144 insertions, 115 deletions
diff --git a/lib/absvdi2.c b/lib/absvdi2.c index 2ba6687d..9c5d4a29 100644 --- a/lib/absvdi2.c +++ b/lib/absvdi2.c @@ -11,6 +11,7 @@ * *===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" #include <stdlib.h> @@ -19,7 +20,7 @@ /* Effects: aborts if abs(x) < 0 */ -di_int +COMPILER_RT_ABI di_int __absvdi2(di_int a) { const int N = (int)(sizeof(di_int) * CHAR_BIT); diff --git a/lib/absvsi2.c b/lib/absvsi2.c index ec5cf69e..80a1a789 100644 --- a/lib/absvsi2.c +++ b/lib/absvsi2.c @@ -10,7 +10,8 @@ * This file implements __absvsi2 for the compiler_rt library. * * ===----------------------------------------------------------------------=== - */ + */ +#include "abi.h" #include "int_lib.h" #include <stdlib.h> @@ -19,7 +20,7 @@ /* Effects: aborts if abs(x) < 0 */ -si_int +COMPILER_RT_ABI si_int __absvsi2(si_int a) { const int N = (int)(sizeof(si_int) * CHAR_BIT); diff --git a/lib/adddf3.c b/lib/adddf3.c index 16b394c2..3cc997b7 100644 --- a/lib/adddf3.c +++ b/lib/adddf3.c @@ -12,14 +12,15 @@ // //===----------------------------------------------------------------------===// -#include "int_lib.h" +#include "abi.h" #define DOUBLE_PRECISION #include "fp_lib.h" ARM_EABI_FNALIAS(dadd, adddf3); -fp_t __adddf3(fp_t a, fp_t b) { +COMPILER_RT_ABI fp_t +__adddf3(fp_t a, fp_t b) { rep_t aRep = toRep(a); rep_t bRep = toRep(b); diff --git a/lib/addsf3.c b/lib/addsf3.c index d4ee2c4c..20610ef3 100644 --- a/lib/addsf3.c +++ b/lib/addsf3.c @@ -12,11 +12,11 @@ // //===----------------------------------------------------------------------===// +#include "abi.h" + #define SINGLE_PRECISION #include "fp_lib.h" -#include "int_lib.h" - ARM_EABI_FNALIAS(fadd, addsf3); fp_t __addsf3(fp_t a, fp_t b) { diff --git a/lib/addvdi3.c b/lib/addvdi3.c index ded023e0..51ad397f 100644 --- a/lib/addvdi3.c +++ b/lib/addvdi3.c @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" #include <stdlib.h> @@ -19,7 +20,7 @@ /* Effects: aborts if a + b overflows */ -di_int +COMPILER_RT_ABI di_int __addvdi3(di_int a, di_int b) { di_int s = a + b; diff --git a/lib/addvsi3.c b/lib/addvsi3.c index 7bdb39b9..c18f7bd4 100644 --- a/lib/addvsi3.c +++ b/lib/addvsi3.c @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" #include <stdlib.h> @@ -19,7 +20,7 @@ /* Effects: aborts if a + b overflows */ -si_int +COMPILER_RT_ABI si_int __addvsi3(si_int a, si_int b) { si_int s = a + b; diff --git a/lib/ashldi3.c b/lib/ashldi3.c index 65bd7b20..adce4e2c 100644 --- a/lib/ashldi3.c +++ b/lib/ashldi3.c @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -20,7 +21,7 @@ ARM_EABI_FNALIAS(llsl, ashldi3); -di_int +COMPILER_RT_ABI di_int __ashldi3(di_int a, si_int b) { const int bits_in_word = (int)(sizeof(si_int) * CHAR_BIT); diff --git a/lib/ashrdi3.c b/lib/ashrdi3.c index cd0855dd..03692a31 100644 --- a/lib/ashrdi3.c +++ b/lib/ashrdi3.c @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -20,7 +21,7 @@ ARM_EABI_FNALIAS(lasr, ashrdi3); -di_int +COMPILER_RT_ABI di_int __ashrdi3(di_int a, si_int b) { const int bits_in_word = (int)(sizeof(si_int) * CHAR_BIT); diff --git a/lib/clzdi2.c b/lib/clzdi2.c index 21327771..c281945f 100644 --- a/lib/clzdi2.c +++ b/lib/clzdi2.c @@ -1,6 +1,6 @@ /* ===-- clzdi2.c - Implement __clzdi2 -------------------------------------=== * - * The LLVM Compiler Infrastructure + * The LLVM Compiler Infrastructure * * This file is dual licensed under the MIT and the University of Illinois Open * Source Licenses. See LICENSE.TXT for details. @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -18,7 +19,7 @@ /* Precondition: a != 0 */ -si_int +COMPILER_RT_ABI si_int __clzdi2(di_int a) { dwords x; diff --git a/lib/clzsi2.c b/lib/clzsi2.c index d99047de..d0a6aeab 100644 --- a/lib/clzsi2.c +++ b/lib/clzsi2.c @@ -1,6 +1,6 @@ /* ===-- clzsi2.c - Implement __clzsi2 -------------------------------------=== * - * The LLVM Compiler Infrastructure + * The LLVM Compiler Infrastructure * * This file is dual licensed under the MIT and the University of Illinois Open * Source Licenses. See LICENSE.TXT for details. @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -18,7 +19,7 @@ /* Precondition: a != 0 */ -si_int +COMPILER_RT_ABI si_int __clzsi2(si_int a) { su_int x = (su_int)a; diff --git a/lib/cmpdi2.c b/lib/cmpdi2.c index 04bd7cf6..999c3d2a 100644 --- a/lib/cmpdi2.c +++ b/lib/cmpdi2.c @@ -6,20 +6,21 @@ * Source Licenses. See LICENSE.TXT for details. * * ===----------------------------------------------------------------------=== - * + * * This file implements __cmpdi2 for the compiler_rt library. * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" -/* Returns: if (a < b) returns 0 +/* Returns: if (a < b) returns 0 * if (a == b) returns 1 * if (a > b) returns 2 */ -si_int +COMPILER_RT_ABI si_int __cmpdi2(di_int a, di_int b) { dwords x; diff --git a/lib/ctzdi2.c b/lib/ctzdi2.c index f7ae50fd..b3d37d01 100644 --- a/lib/ctzdi2.c +++ b/lib/ctzdi2.c @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -18,7 +19,7 @@ /* Precondition: a != 0 */ -si_int +COMPILER_RT_ABI si_int __ctzdi2(di_int a) { dwords x; diff --git a/lib/ctzsi2.c b/lib/ctzsi2.c index 0c738fa5..2ff0e5d7 100644 --- a/lib/ctzsi2.c +++ b/lib/ctzsi2.c @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -18,7 +19,7 @@ /* Precondition: a != 0 */ -si_int +COMPILER_RT_ABI si_int __ctzsi2(si_int a) { su_int x = (su_int)a; diff --git a/lib/divdf3.c b/lib/divdf3.c index 820b4c85..925abd50 100644 --- a/lib/divdf3.c +++ b/lib/divdf3.c @@ -15,12 +15,11 @@ // underflow with correct rounding. // //===----------------------------------------------------------------------===// +#include "abi.h" #define DOUBLE_PRECISION #include "fp_lib.h" -#include "int_lib.h" - ARM_EABI_FNALIAS(ddiv, divdf3); fp_t __divdf3(fp_t a, fp_t b) { diff --git a/lib/divdi3.c b/lib/divdi3.c index a1b83ea3..d62df56f 100644 --- a/lib/divdi3.c +++ b/lib/divdi3.c @@ -11,14 +11,15 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" -du_int __udivmoddi4(du_int a, du_int b, du_int* rem); +du_int COMPILER_RT_ABI __udivmoddi4(du_int a, du_int b, du_int* rem); /* Returns: a / b */ -di_int +COMPILER_RT_ABI di_int __divdi3(di_int a, di_int b) { const int bits_in_dword_m1 = (int)(sizeof(di_int) * CHAR_BIT) - 1; diff --git a/lib/divmodsi4.c b/lib/divmodsi4.c index 2ec3dd4a..4dc19782 100644 --- a/lib/divmodsi4.c +++ b/lib/divmodsi4.c @@ -11,15 +11,16 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" -extern si_int __divsi3(si_int a, si_int b); +extern COMPILER_RT_ABI si_int __divsi3(si_int a, si_int b); /* Returns: a / b, *rem = a % b */ -si_int +COMPILER_RT_ABI si_int __divmodsi4(si_int a, si_int b, si_int* rem) { si_int d = __divsi3(a,b); diff --git a/lib/divsf3.c b/lib/divsf3.c index 84e9a37a..b7333079 100644 --- a/lib/divsf3.c +++ b/lib/divsf3.c @@ -15,12 +15,11 @@ // underflow with correct rounding. // //===----------------------------------------------------------------------===// +#include "abi.h" #define SINGLE_PRECISION #include "fp_lib.h" -#include "int_lib.h" - ARM_EABI_FNALIAS(fdiv, divsf3); fp_t __divsf3(fp_t a, fp_t b) { diff --git a/lib/divsi3.c b/lib/divsi3.c index db2b6e80..01ef2747 100644 --- a/lib/divsi3.c +++ b/lib/divsi3.c @@ -11,16 +11,17 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" -su_int __udivsi3(su_int n, su_int d); +su_int COMPILER_RT_ABI __udivsi3(su_int n, su_int d); /* Returns: a / b */ ARM_EABI_FNALIAS(idiv, divsi3); -si_int +COMPILER_RT_ABI si_int __divsi3(si_int a, si_int b) { const int bits_in_word_m1 = (int)(sizeof(si_int) * CHAR_BIT) - 1; diff --git a/lib/extendsfdf2.c b/lib/extendsfdf2.c index a6301543..c0b628df 100644 --- a/lib/extendsfdf2.c +++ b/lib/extendsfdf2.c @@ -41,7 +41,7 @@ #include <stdint.h> #include <limits.h> -#include "int_lib.h" +#include "abi.h" typedef float src_t; typedef uint32_t src_rep_t; diff --git a/lib/ffsdi2.c b/lib/ffsdi2.c index 8a1c68cb..89f1b7bf 100644 --- a/lib/ffsdi2.c +++ b/lib/ffsdi2.c @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -18,7 +19,7 @@ * the value zero if a is zero. The least significant bit is index one. */ -si_int +COMPILER_RT_ABI si_int __ffsdi2(di_int a) { dwords x; diff --git a/lib/fixdfdi.c b/lib/fixdfdi.c index c6732dbb..85a456d1 100644 --- a/lib/fixdfdi.c +++ b/lib/fixdfdi.c @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" diff --git a/lib/fixsfdi.c b/lib/fixsfdi.c index e32b85fd..d80e33eb 100644 --- a/lib/fixsfdi.c +++ b/lib/fixsfdi.c @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -25,7 +26,7 @@ ARM_EABI_FNALIAS(d2lz, fixsfdi); -di_int +COMPILER_RT_ABI di_int __fixsfdi(float a) { float_bits fb; diff --git a/lib/fixsfsi.c b/lib/fixsfsi.c index 4cdc47f7..67749a56 100644 --- a/lib/fixsfsi.c +++ b/lib/fixsfsi.c @@ -12,16 +12,15 @@ // conversion is undefined for out of range values in the C standard. // //===----------------------------------------------------------------------===// +#include "abi.h" #define SINGLE_PRECISION #include "fp_lib.h" -#include "int_lib.h" - ARM_EABI_FNALIAS(f2iz, fixsfsi); -int __fixsfsi(fp_t a) { - +COMPILER_RT_ABI int +__fixsfsi(fp_t a) { // Break a into sign, exponent, significand const rep_t aRep = toRep(a); const rep_t aAbs = aRep & absMask; diff --git a/lib/fixunsdfdi.c b/lib/fixunsdfdi.c index 1721d333..d80b84a8 100644 --- a/lib/fixunsdfdi.c +++ b/lib/fixunsdfdi.c @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -28,7 +29,7 @@ ARM_EABI_FNALIAS(d2ulz, fixunsdfdi); -du_int +COMPILER_RT_ABI du_int __fixunsdfdi(double a) { double_bits fb; diff --git a/lib/fixunsdfsi.c b/lib/fixunsdfsi.c index 7a803f2d..ecdfb5d6 100644 --- a/lib/fixunsdfsi.c +++ b/lib/fixunsdfsi.c @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -28,7 +29,7 @@ ARM_EABI_FNALIAS(d2uiz, fixunsdfsi); -su_int +COMPILER_RT_ABI su_int __fixunsdfsi(double a) { double_bits fb; diff --git a/lib/fixunssfdi.c b/lib/fixunssfdi.c index 3d7d95c8..15064204 100644 --- a/lib/fixunssfdi.c +++ b/lib/fixunssfdi.c @@ -11,9 +11,9 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" - /* Returns: convert a to a unsigned long long, rounding toward zero. * Negative values all become zero. */ @@ -26,11 +26,9 @@ /* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */ -#include "int_lib.h" - ARM_EABI_FNALIAS(f2ulz, fixunssfdi); -du_int +COMPILER_RT_ABI du_int __fixunssfdi(float a) { float_bits fb; diff --git a/lib/fixunssfsi.c b/lib/fixunssfsi.c index b822ffe7..dbaa5115 100644 --- a/lib/fixunssfsi.c +++ b/lib/fixunssfsi.c @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -28,7 +29,7 @@ ARM_EABI_FNALIAS(f2uiz, fixunssfsi); -su_int +COMPILER_RT_ABI su_int __fixunssfsi(float a) { float_bits fb; diff --git a/lib/floatdidf.c b/lib/floatdidf.c index 1633f738..5ba95263 100644 --- a/lib/floatdidf.c +++ b/lib/floatdidf.c @@ -11,6 +11,7 @@ * *===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" #include <float.h> @@ -23,8 +24,6 @@ /* seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm */ -#include "int_lib.h" - ARM_EABI_FNALIAS(l2d, floatdidf); #ifndef __SOFT_FP__ @@ -33,7 +32,7 @@ ARM_EABI_FNALIAS(l2d, floatdidf); */ #include <stdint.h> -double +COMPILER_RT_ABI double __floatdidf(di_int a) { static const double twop52 = 0x1.0p52; @@ -53,7 +52,7 @@ __floatdidf(di_int a) * set, and we don't want to code-gen to an unknown soft-float implementation. */ -double +COMPILER_RT_ABI double __floatdidf(di_int a) { if (a == 0) diff --git a/lib/floatdisf.c b/lib/floatdisf.c index cdede6c7..4dc13cab 100644 --- a/lib/floatdisf.c +++ b/lib/floatdisf.c @@ -12,7 +12,7 @@ *===----------------------------------------------------------------------=== */ -#include "int_lib.h" +#include "abi.h" #include <float.h> /* Returns: convert a to a float, rounding toward even.*/ @@ -27,7 +27,7 @@ ARM_EABI_FNALIAS(l2f, floatdisf); -float +COMPILER_RT_ABI float __floatdisf(di_int a) { if (a == 0) diff --git a/lib/floatundidf.c b/lib/floatundidf.c index 64bec04e..e74e9d8d 100644 --- a/lib/floatundidf.c +++ b/lib/floatundidf.c @@ -12,7 +12,7 @@ * ===----------------------------------------------------------------------=== */ -#include "int_lib.h" +#include "abi.h" #include <float.h> /* Returns: convert a to a double, rounding toward even. */ @@ -34,7 +34,7 @@ ARM_EABI_FNALIAS(ul2d, floatundidf); #include <stdint.h> -double +COMPILER_RT_ABI double __floatundidf(du_int a) { static const double twop52 = 0x1.0p52; @@ -56,7 +56,7 @@ __floatundidf(du_int a) * set, and we don't want to code-gen to an unknown soft-float implementation. */ -double +COMPILER_RT_ABI double __floatundidf(du_int a) { if (a == 0) diff --git a/lib/floatundisf.c b/lib/floatundisf.c index 2d2a5145..eea45a74 100644 --- a/lib/floatundisf.c +++ b/lib/floatundisf.c @@ -12,7 +12,7 @@ *===----------------------------------------------------------------------=== */ -#include "int_lib.h" +#include "abi.h" #include <float.h> /* Returns: convert a to a float, rounding toward even. */ @@ -27,7 +27,7 @@ ARM_EABI_FNALIAS(ul2f, floatundisf); -float +COMPILER_RT_ABI float __floatundisf(du_int a) { if (a == 0) diff --git a/lib/int_lib.h b/lib/int_lib.h index c0224ce7..e1fd6b73 100644 --- a/lib/int_lib.h +++ b/lib/int_lib.h @@ -37,13 +37,6 @@ extern void panic (const char *, ...); #define INFINITY HUGE_VAL #endif /* INFINITY */ -#if __ARM_EABI__ -# define ARM_EABI_FNALIAS(aeabi_name, name) \ - void __aeabi_##aeabi_name() __attribute__((alias("__" #name))); -#else -# define ARM_EABI_FNALIAS(aeabi_name, name) -#endif - typedef int si_int; typedef unsigned su_int; diff --git a/lib/lshrdi3.c b/lib/lshrdi3.c index 7468cb73..911edb19 100644 --- a/lib/lshrdi3.c +++ b/lib/lshrdi3.c @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -20,7 +21,7 @@ ARM_EABI_FNALIAS(llsr, lshrdi3); -di_int +COMPILER_RT_ABI di_int __lshrdi3(di_int a, si_int b) { const int bits_in_word = (int)(sizeof(si_int) * CHAR_BIT); diff --git a/lib/moddi3.c b/lib/moddi3.c index 3b350ddc..af0a8083 100644 --- a/lib/moddi3.c +++ b/lib/moddi3.c @@ -11,14 +11,15 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" -du_int __udivmoddi4(du_int a, du_int b, du_int* rem); +COMPILER_RT_ABI du_int __udivmoddi4(du_int a, du_int b, du_int* rem); /* Returns: a % b */ -di_int +COMPILER_RT_ABI di_int __moddi3(di_int a, di_int b) { const int bits_in_dword_m1 = (int)(sizeof(di_int) * CHAR_BIT) - 1; diff --git a/lib/modsi3.c b/lib/modsi3.c index 70d38a6b..05ce806f 100644 --- a/lib/modsi3.c +++ b/lib/modsi3.c @@ -11,14 +11,15 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" -su_int __divsi3(si_int a, si_int b); +su_int COMPILER_RT_ABI __divsi3(si_int a, si_int b); /* Returns: a % b */ -si_int +COMPILER_RT_ABI si_int __modsi3(si_int a, si_int b) { return a - __divsi3(a, b) * b; diff --git a/lib/muldf3.c b/lib/muldf3.c index 5cfe62bc..f402cfb3 100644 --- a/lib/muldf3.c +++ b/lib/muldf3.c @@ -11,15 +11,15 @@ // with the IEEE-754 default rounding (to nearest, ties to even). // //===----------------------------------------------------------------------===// +#include "abi.h" #define DOUBLE_PRECISION #include "fp_lib.h" -#include "int_lib.h" - ARM_EABI_FNALIAS(dmul, muldf3); -fp_t __muldf3(fp_t a, fp_t b) { +COMPILER_RT_ABI fp_t +__muldf3(fp_t a, fp_t b) { const unsigned int aExponent = toRep(a) >> significandBits & maxExponent; const unsigned int bExponent = toRep(b) >> significandBits & maxExponent; diff --git a/lib/muldi3.c b/lib/muldi3.c index 537b7357..e6322bf5 100644 --- a/lib/muldi3.c +++ b/lib/muldi3.c @@ -10,7 +10,8 @@ * This file implements __muldi3 for the compiler_rt library. * * ===----------------------------------------------------------------------=== - */ + */ +#include "abi.h" #include "int_lib.h" @@ -42,7 +43,7 @@ __muldsi3(su_int a, su_int b) ARM_EABI_FNALIAS(lmul, muldi3); -di_int +COMPILER_RT_ABI di_int __muldi3(di_int a, di_int b) { dwords x; diff --git a/lib/mulsf3.c b/lib/mulsf3.c index 96dcfd9e..bf46e148 100644 --- a/lib/mulsf3.c +++ b/lib/mulsf3.c @@ -11,15 +11,15 @@ // with the IEEE-754 default rounding (to nearest, ties to even). // //===----------------------------------------------------------------------===// +#include "abi.h" #define SINGLE_PRECISION #include "fp_lib.h" -#include "int_lib.h" - ARM_EABI_FNALIAS(fmul, mulsf3); -fp_t __mulsf3(fp_t a, fp_t b) { +COMPILER_RT_ABI fp_t +__mulsf3(fp_t a, fp_t b) { const unsigned int aExponent = toRep(a) >> significandBits & maxExponent; const unsigned int bExponent = toRep(b) >> significandBits & maxExponent; diff --git a/lib/negdf2.c b/lib/negdf2.c index 9344ae10..b47f3978 100644 --- a/lib/negdf2.c +++ b/lib/negdf2.c @@ -10,12 +10,11 @@ // This file implements double-precision soft-float negation. // //===----------------------------------------------------------------------===// +#include "abi.h" #define DOUBLE_PRECISION #include "fp_lib.h" -#include "int_lib.h" - ARM_EABI_FNALIAS(dneg, negdf2); fp_t __negdf2(fp_t a) { diff --git a/lib/negsf2.c b/lib/negsf2.c index 6b0e62c5..98f9fc0c 100644 --- a/lib/negsf2.c +++ b/lib/negsf2.c @@ -10,14 +10,14 @@ // This file implements single-precision soft-float negation. // //===----------------------------------------------------------------------===// +#include "abi.h" #define SINGLE_PRECISION #include "fp_lib.h" -#include "int_lib.h" - ARM_EABI_FNALIAS(fneg, negsf2); -fp_t __negsf2(fp_t a) { +COMPILER_RT_ABI fp_t +__negsf2(fp_t a) { return fromRep(toRep(a) ^ signBit); } diff --git a/lib/negvdi2.c b/lib/negvdi2.c index 2851d26f..aafaa9dc 100644 --- a/lib/negvdi2.c +++ b/lib/negvdi2.c @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" #include <stdlib.h> @@ -19,7 +20,7 @@ /* Effects: aborts if -a overflows */ -di_int +COMPILER_RT_ABI di_int __negvdi2(di_int a) { const di_int MIN = (di_int)1 << ((int)(sizeof(di_int) * CHAR_BIT)-1); diff --git a/lib/negvsi2.c b/lib/negvsi2.c index 1a833476..559ea18e 100644 --- a/lib/negvsi2.c +++ b/lib/negvsi2.c @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" #include <stdlib.h> @@ -19,7 +20,7 @@ /* Effects: aborts if -a overflows */ -si_int +COMPILER_RT_ABI si_int __negvsi2(si_int a) { const si_int MIN = (si_int)1 << ((int)(sizeof(si_int) * CHAR_BIT)-1); diff --git a/lib/paritydi2.c b/lib/paritydi2.c index 9d349b8c..e7bebf68 100644 --- a/lib/paritydi2.c +++ b/lib/paritydi2.c @@ -11,14 +11,15 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" /* Returns: 1 if number of bits is odd else returns 0 */ -si_int __paritysi2(si_int a); +si_int COMPILER_RT_ABI __paritysi2(si_int a); -si_int +COMPILER_RT_ABI si_int __paritydi2(di_int a) { dwords x; diff --git a/lib/paritysi2.c b/lib/paritysi2.c index 76de328e..64d509fa 100644 --- a/lib/paritysi2.c +++ b/lib/paritysi2.c @@ -11,12 +11,13 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" /* Returns: 1 if number of bits is odd else returns 0 */ -si_int +COMPILER_RT_ABI si_int __paritysi2(si_int a) { su_int x = (su_int)a; diff --git a/lib/popcountdi2.c b/lib/popcountdi2.c index 0778a66c..136fc048 100644 --- a/lib/popcountdi2.c +++ b/lib/popcountdi2.c @@ -11,12 +11,13 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" /* Returns: count of 1 bits */ -si_int +COMPILER_RT_ABI si_int __popcountdi2(di_int a) { du_int x2 = (du_int)a; diff --git a/lib/popcountsi2.c b/lib/popcountsi2.c index e425b0b8..bfaa3fff 100644 --- a/lib/popcountsi2.c +++ b/lib/popcountsi2.c @@ -11,12 +11,13 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" /* Returns: count of 1 bits */ -si_int +COMPILER_RT_ABI si_int __popcountsi2(si_int a) { su_int x = (su_int)a; diff --git a/lib/powidf2.c b/lib/powidf2.c index 0200e1ea..2e211eb3 100644 --- a/lib/powidf2.c +++ b/lib/powidf2.c @@ -11,12 +11,13 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" /* Returns: a ^ b */ -double +COMPILER_RT_ABI double __powidf2(double a, si_int b) { const int recip = b < 0; diff --git a/lib/powisf2.c b/lib/powisf2.c index c834b969..e6b43b3a 100644 --- a/lib/powisf2.c +++ b/lib/powisf2.c @@ -11,12 +11,13 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" /* Returns: a ^ b */ -float +COMPILER_RT_ABI float __powisf2(float a, si_int b) { const int recip = b < 0; diff --git a/lib/subdf3.c b/lib/subdf3.c index d9ed494f..825e3c66 100644 --- a/lib/subdf3.c +++ b/lib/subdf3.c @@ -11,19 +11,19 @@ // IEEE-754 default rounding (to nearest, ties to even). // //===----------------------------------------------------------------------===// +#include "abi.h" #define DOUBLE_PRECISION #include "fp_lib.h" -#include "int_lib.h" - -fp_t __adddf3(fp_t a, fp_t b); +fp_t COMPILER_RT_ABI __adddf3(fp_t a, fp_t b); ARM_EABI_FNALIAS(dsub, subdf3); // Subtraction; flip the sign bit of b and add. -fp_t __subdf3(fp_t a, fp_t b) { +COMPILER_RT_ABI fp_t +__subdf3(fp_t a, fp_t b) { return __adddf3(a, fromRep(toRep(b) ^ signBit)); } diff --git a/lib/subsf3.c b/lib/subsf3.c index 5345eb23..625376ac 100644 --- a/lib/subsf3.c +++ b/lib/subsf3.c @@ -11,18 +11,18 @@ // IEEE-754 default rounding (to nearest, ties to even). // //===----------------------------------------------------------------------===// +#include "abi.h" #define SINGLE_PRECISION #include "fp_lib.h" -#include "int_lib.h" - -fp_t __addsf3(fp_t a, fp_t b); +fp_t COMPILER_RT_ABI __addsf3(fp_t a, fp_t b); ARM_EABI_FNALIAS(fsub, subsf3); // Subtraction; flip the sign bit of b and add. -fp_t __subsf3(fp_t a, fp_t b) { +COMPILER_RT_ABI fp_t +__subsf3(fp_t a, fp_t b) { return __addsf3(a, fromRep(toRep(b) ^ signBit)); } diff --git a/lib/subvdi3.c b/lib/subvdi3.c index 17f55d00..36b51ad9 100644 --- a/lib/subvdi3.c +++ b/lib/subvdi3.c @@ -1,6 +1,6 @@ /* ===-- subvdi3.c - Implement __subvdi3 -----------------------------------=== * - * The LLVM Compiler Infrastructure + * The LLVM Compiler Infrastructure * * This file is dual licensed under the MIT and the University of Illinois Open * Source Licenses. See LICENSE.TXT for details. @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" #include <stdlib.h> @@ -19,7 +20,7 @@ /* Effects: aborts if a - b overflows */ -di_int +COMPILER_RT_ABI di_int __subvdi3(di_int a, di_int b) { di_int s = a - b; diff --git a/lib/subvsi3.c b/lib/subvsi3.c index 51bb4544..03983f74 100644 --- a/lib/subvsi3.c +++ b/lib/subvsi3.c @@ -1,6 +1,6 @@ /* ===-- subvsi3.c - Implement __subvsi3 -----------------------------------=== * - * The LLVM Compiler Infrastructure + * The LLVM Compiler Infrastructure * * This file is dual licensed under the MIT and the University of Illinois Open * Source Licenses. See LICENSE.TXT for details. @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" #include <stdlib.h> @@ -19,7 +20,7 @@ /* Effects: aborts if a - b overflows */ -si_int +COMPILER_RT_ABI si_int __subvsi3(si_int a, si_int b) { si_int s = a - b; diff --git a/lib/truncdfsf2.c b/lib/truncdfsf2.c index f3de2195..1dbf02f5 100644 --- a/lib/truncdfsf2.c +++ b/lib/truncdfsf2.c @@ -41,7 +41,7 @@ #include <limits.h> #include <stdbool.h> -#include "int_lib.h" +#include "abi.h" typedef double src_t; typedef uint64_t src_rep_t; @@ -70,7 +70,8 @@ static inline dst_t dstFromRep(dst_rep_t x) { ARM_EABI_FNALIAS(d2f, truncdfsf2); -dst_t __truncdfsf2(src_t a) { +COMPILER_RT_ABI dst_t +__truncdfsf2(src_t a) { // Various constants whose values follow from the type parameters. // Any reasonable optimizer will fold and propagate all of these. diff --git a/lib/ucmpdi2.c b/lib/ucmpdi2.c index ead72672..f2d3f99f 100644 --- a/lib/ucmpdi2.c +++ b/lib/ucmpdi2.c @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -19,7 +20,7 @@ * if (a > b) returns 2 */ -si_int +COMPILER_RT_ABI si_int __ucmpdi2(du_int a, du_int b) { udwords x; diff --git a/lib/udivdi3.c b/lib/udivdi3.c index 642f2fb9..bbd551ac 100644 --- a/lib/udivdi3.c +++ b/lib/udivdi3.c @@ -11,14 +11,15 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" -du_int __udivmoddi4(du_int a, du_int b, du_int* rem); +du_int COMPILER_RT_ABI __udivmoddi4(du_int a, du_int b, du_int* rem); /* Returns: a / b */ -du_int +COMPILER_RT_ABI du_int __udivdi3(du_int a, du_int b) { return __udivmoddi4(a, b, 0); diff --git a/lib/udivmoddi4.c b/lib/udivmoddi4.c index 6b8c4e81..c5db21cf 100644 --- a/lib/udivmoddi4.c +++ b/lib/udivmoddi4.c @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -22,7 +23,7 @@ ARM_EABI_FNALIAS(uldivmod, udivmoddi4); -du_int +COMPILER_RT_ABI du_int __udivmoddi4(du_int a, du_int b, du_int* rem) { const unsigned n_uword_bits = sizeof(su_int) * CHAR_BIT; diff --git a/lib/udivmodsi4.c b/lib/udivmodsi4.c index 38b5bd43..2a3ee27f 100644 --- a/lib/udivmodsi4.c +++ b/lib/udivmodsi4.c @@ -11,20 +11,21 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" -extern su_int __udivsi3(su_int n, su_int d); +extern su_int COMPILER_RT_ABI __udivsi3(su_int n, su_int d); /* Returns: a / b, *rem = a % b */ -su_int +COMPILER_RT_ABI su_int __udivmodsi4(su_int a, su_int b, su_int* rem) { si_int d = __udivsi3(a,b); *rem = a - (d*b); - return d; + return d; } diff --git a/lib/udivsi3.c b/lib/udivsi3.c index 8a5695d2..721ae89e 100644 --- a/lib/udivsi3.c +++ b/lib/udivsi3.c @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" @@ -20,7 +21,7 @@ ARM_EABI_FNALIAS(uidiv, udivsi3); -su_int +COMPILER_RT_ABI su_int __udivsi3(su_int n, su_int d) { const unsigned n_uword_bits = sizeof(su_int) * CHAR_BIT; diff --git a/lib/umoddi3.c b/lib/umoddi3.c index adb4b0e7..9de1a64f 100644 --- a/lib/umoddi3.c +++ b/lib/umoddi3.c @@ -11,14 +11,15 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" -du_int __udivmoddi4(du_int a, du_int b, du_int* rem); +du_int COMPILER_RT_ABI __udivmoddi4(du_int a, du_int b, du_int* rem); /* Returns: a % b */ -du_int +COMPILER_RT_ABI du_int __umoddi3(du_int a, du_int b) { du_int r; diff --git a/lib/umodsi3.c b/lib/umodsi3.c index d3aaaeae..569b7fcb 100644 --- a/lib/umodsi3.c +++ b/lib/umodsi3.c @@ -11,14 +11,15 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" /* Returns: a % b */ -su_int __udivsi3(su_int a, su_int b); +su_int COMPILER_RT_ABI __udivsi3(su_int a, su_int b); -su_int +COMPILER_RT_ABI su_int __umodsi3(su_int a, su_int b) { return a - __udivsi3(a, b) * b; |