From 1c5f89b1dd741135a4007ab577723d422f421eec Mon Sep 17 00:00:00 2001 From: Anton Korobeynikov Date: Tue, 19 Apr 2011 17:52:09 +0000 Subject: 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 --- lib/absvdi2.c | 3 ++- lib/absvsi2.c | 5 +++-- lib/adddf3.c | 5 +++-- lib/addsf3.c | 4 ++-- lib/addvdi3.c | 3 ++- lib/addvsi3.c | 3 ++- lib/ashldi3.c | 3 ++- lib/ashrdi3.c | 3 ++- lib/clzdi2.c | 5 +++-- lib/clzsi2.c | 5 +++-- lib/cmpdi2.c | 7 ++++--- lib/ctzdi2.c | 3 ++- lib/ctzsi2.c | 3 ++- lib/divdf3.c | 3 +-- lib/divdi3.c | 5 +++-- lib/divmodsi4.c | 5 +++-- lib/divsf3.c | 3 +-- lib/divsi3.c | 5 +++-- lib/extendsfdf2.c | 2 +- lib/ffsdi2.c | 3 ++- lib/fixdfdi.c | 1 + lib/fixsfdi.c | 3 ++- lib/fixsfsi.c | 7 +++---- lib/fixunsdfdi.c | 3 ++- lib/fixunsdfsi.c | 3 ++- lib/fixunssfdi.c | 6 ++---- lib/fixunssfsi.c | 3 ++- lib/floatdidf.c | 7 +++---- lib/floatdisf.c | 4 ++-- lib/floatundidf.c | 6 +++--- lib/floatundisf.c | 4 ++-- lib/int_lib.h | 7 ------- lib/lshrdi3.c | 3 ++- lib/moddi3.c | 5 +++-- lib/modsi3.c | 5 +++-- lib/muldf3.c | 6 +++--- lib/muldi3.c | 5 +++-- lib/mulsf3.c | 6 +++--- lib/negdf2.c | 3 +-- lib/negsf2.c | 6 +++--- lib/negvdi2.c | 3 ++- lib/negvsi2.c | 3 ++- lib/paritydi2.c | 5 +++-- lib/paritysi2.c | 3 ++- lib/popcountdi2.c | 3 ++- lib/popcountsi2.c | 3 ++- lib/powidf2.c | 3 ++- lib/powisf2.c | 3 ++- lib/subdf3.c | 8 ++++---- lib/subsf3.c | 8 ++++---- lib/subvdi3.c | 5 +++-- lib/subvsi3.c | 5 +++-- lib/truncdfsf2.c | 5 +++-- lib/ucmpdi2.c | 3 ++- lib/udivdi3.c | 5 +++-- lib/udivmoddi4.c | 3 ++- lib/udivmodsi4.c | 7 ++++--- lib/udivsi3.c | 3 ++- lib/umoddi3.c | 5 +++-- lib/umodsi3.c | 5 +++-- 60 files changed, 144 insertions(+), 115 deletions(-) diff --git a/lib/absvdi2.c b/lib/absvdi2.c index 2ba6687da..9c5d4a299 100644 --- a/lib/absvdi2.c +++ b/lib/absvdi2.c @@ -11,6 +11,7 @@ * *===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" #include @@ -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 ec5cf69e8..80a1a7898 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 @@ -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 16b394c2b..3cc997b71 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 d4ee2c4c4..20610ef31 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 ded023e07..51ad397f5 100644 --- a/lib/addvdi3.c +++ b/lib/addvdi3.c @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" #include @@ -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 7bdb39b97..c18f7bd45 100644 --- a/lib/addvsi3.c +++ b/lib/addvsi3.c @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" #include @@ -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 65bd7b202..adce4e2cb 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 cd0855dd7..03692a31d 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 213277712..c281945ff 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 d99047dec..d0a6aeabc 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 04bd7cf62..999c3d2a6 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 f7ae50fdf..b3d37d01b 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 0c738fa59..2ff0e5d76 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 820b4c851..925abd509 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 a1b83ea3e..d62df56f6 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 2ec3dd4a7..4dc197828 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 84e9a37a0..b73330793 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 db2b6e80f..01ef27473 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 a63015430..c0b628dff 100644 --- a/lib/extendsfdf2.c +++ b/lib/extendsfdf2.c @@ -41,7 +41,7 @@ #include #include -#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 8a1c68cb3..89f1b7bf4 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 c6732dbbb..85a456d11 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 e32b85fd6..d80e33eb7 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 4cdc47f7b..67749a567 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 1721d3339..d80b84a8d 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 7a803f2d3..ecdfb5d62 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 3d7d95c86..150642045 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 b822ffe73..dbaa5115b 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 1633f7384..5ba952635 100644 --- a/lib/floatdidf.c +++ b/lib/floatdidf.c @@ -11,6 +11,7 @@ * *===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" #include @@ -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 -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 cdede6c75..4dc13cab4 100644 --- a/lib/floatdisf.c +++ b/lib/floatdisf.c @@ -12,7 +12,7 @@ *===----------------------------------------------------------------------=== */ -#include "int_lib.h" +#include "abi.h" #include /* 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 64bec04e5..e74e9d8d2 100644 --- a/lib/floatundidf.c +++ b/lib/floatundidf.c @@ -12,7 +12,7 @@ * ===----------------------------------------------------------------------=== */ -#include "int_lib.h" +#include "abi.h" #include /* Returns: convert a to a double, rounding toward even. */ @@ -34,7 +34,7 @@ ARM_EABI_FNALIAS(ul2d, floatundidf); #include -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 2d2a51458..eea45a745 100644 --- a/lib/floatundisf.c +++ b/lib/floatundisf.c @@ -12,7 +12,7 @@ *===----------------------------------------------------------------------=== */ -#include "int_lib.h" +#include "abi.h" #include /* 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 c0224ce74..e1fd6b73d 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 7468cb739..911edb191 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 3b350ddc3..af0a80832 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 70d38a6b5..05ce806f7 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 5cfe62bca..f402cfb39 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 537b7357f..e6322bf5d 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 96dcfd9e4..bf46e1481 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 9344ae105..b47f3978b 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 6b0e62c5b..98f9fc0c0 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 2851d26f4..aafaa9dc5 100644 --- a/lib/negvdi2.c +++ b/lib/negvdi2.c @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" #include @@ -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 1a8334760..559ea18e4 100644 --- a/lib/negvsi2.c +++ b/lib/negvsi2.c @@ -11,6 +11,7 @@ * * ===----------------------------------------------------------------------=== */ +#include "abi.h" #include "int_lib.h" #include @@ -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 9d349b8c2..e7bebf685 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 76de328e1..64d509fa7 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 0778a66c8..136fc0486 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 e425b0b86..bfaa3fff2 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 0200e1eab..2e211eb3d 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 c834b9696..e6b43b3a3 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 d9ed494f4..825e3c662 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 5345eb23a..625376acc 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 17f55d000..36b51ad97 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 @@ -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 51bb45447..03983f747 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 @@ -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 f3de21959..1dbf02f5e 100644 --- a/lib/truncdfsf2.c +++ b/lib/truncdfsf2.c @@ -41,7 +41,7 @@ #include #include -#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 ead726723..f2d3f99f8 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 642f2fb9c..bbd551ac7 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 6b8c4e819..c5db21cf0 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 38b5bd43d..2a3ee27f8 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 8a5695d20..721ae89e4 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 adb4b0e75..9de1a64fd 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 d3aaaeae0..569b7fcb1 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; -- cgit v1.2.3