Consistently use COMPILER_RT_ABI for all public symbols.

Move prototypes into headers and fix a few inconsistencies.

llvm-svn: 202591
This commit is contained in:
Joerg Sonnenberger 2014-03-01 15:30:50 +00:00
parent bbdd7640e8
commit 6e99daab4c
87 changed files with 139 additions and 145 deletions

View File

@ -20,7 +20,7 @@
/* Effects: aborts if abs(x) < 0 */
ti_int
COMPILER_RT_ABI ti_int
__absvti2(ti_int a)
{
const int N = (int)(sizeof(ti_int) * CHAR_BIT);

View File

@ -17,7 +17,8 @@
ARM_EABI_FNALIAS(fadd, addsf3)
fp_t __addsf3(fp_t a, fp_t b) {
COMPILER_RT_ABI fp_t
__addsf3(fp_t a, fp_t b) {
rep_t aRep = toRep(a);
rep_t bRep = toRep(b);

View File

@ -20,7 +20,7 @@
/* Effects: aborts if a + b overflows */
ti_int
COMPILER_RT_ABI ti_int
__addvti3(ti_int a, ti_int b)
{
ti_int s = a + b;

View File

@ -20,7 +20,7 @@
/* Precondition: 0 <= b < bits_in_tword */
ti_int
COMPILER_RT_ABI ti_int
__ashlti3(ti_int a, si_int b)
{
const int bits_in_dword = (int)(sizeof(di_int) * CHAR_BIT);

View File

@ -20,7 +20,7 @@
/* Precondition: 0 <= b < bits_in_tword */
ti_int
COMPILER_RT_ABI ti_int
__ashrti3(ti_int a, si_int b)
{
const int bits_in_dword = (int)(sizeof(di_int) * CHAR_BIT);

View File

@ -24,7 +24,8 @@
* specified range.
*/
void __clear_cache(void* start, void* end)
COMPILER_RT_ABI void
__clear_cache(void* start, void* end)
{
#if __i386__ || __x86_64__
/*

View File

@ -20,7 +20,7 @@
/* Precondition: a != 0 */
si_int
COMPILER_RT_ABI si_int
__clzti2(ti_int a)
{
twords x;

View File

@ -21,7 +21,7 @@
* if (a > b) returns 2
*/
si_int
COMPILER_RT_ABI si_int
__cmpti2(ti_int a, ti_int b)
{
twords x;

View File

@ -47,7 +47,8 @@ enum LE_RESULT {
LE_UNORDERED = 1
};
enum LE_RESULT __ledf2(fp_t a, fp_t b) {
COMPILER_RT_ABI enum LE_RESULT
__ledf2(fp_t a, fp_t b) {
const srep_t aInt = toRep(a);
const srep_t bInt = toRep(b);
@ -86,7 +87,8 @@ enum GE_RESULT {
GE_UNORDERED = -1 // Note: different from LE_UNORDERED
};
enum GE_RESULT __gedf2(fp_t a, fp_t b) {
COMPILER_RT_ABI enum GE_RESULT
__gedf2(fp_t a, fp_t b) {
const srep_t aInt = toRep(a);
const srep_t bInt = toRep(b);
@ -108,7 +110,8 @@ enum GE_RESULT __gedf2(fp_t a, fp_t b) {
ARM_EABI_FNALIAS(dcmpun, unorddf2)
int __unorddf2(fp_t a, fp_t b) {
COMPILER_RT_ABI int
__unorddf2(fp_t a, fp_t b) {
const rep_t aAbs = toRep(a) & absMask;
const rep_t bAbs = toRep(b) & absMask;
return aAbs > infRep || bAbs > infRep;
@ -116,19 +119,23 @@ int __unorddf2(fp_t a, fp_t b) {
// The following are alternative names for the preceeding routines.
enum LE_RESULT __eqdf2(fp_t a, fp_t b) {
COMPILER_RT_ABI enum LE_RESULT
__eqdf2(fp_t a, fp_t b) {
return __ledf2(a, b);
}
enum LE_RESULT __ltdf2(fp_t a, fp_t b) {
COMPILER_RT_ABI enum LE_RESULT
__ltdf2(fp_t a, fp_t b) {
return __ledf2(a, b);
}
enum LE_RESULT __nedf2(fp_t a, fp_t b) {
COMPILER_RT_ABI enum LE_RESULT
__nedf2(fp_t a, fp_t b) {
return __ledf2(a, b);
}
enum GE_RESULT __gtdf2(fp_t a, fp_t b) {
COMPILER_RT_ABI enum GE_RESULT
__gtdf2(fp_t a, fp_t b) {
return __gedf2(a, b);
}

View File

@ -47,7 +47,8 @@ enum LE_RESULT {
LE_UNORDERED = 1
};
enum LE_RESULT __lesf2(fp_t a, fp_t b) {
COMPILER_RT_ABI enum LE_RESULT
__lesf2(fp_t a, fp_t b) {
const srep_t aInt = toRep(a);
const srep_t bInt = toRep(b);
@ -86,7 +87,8 @@ enum GE_RESULT {
GE_UNORDERED = -1 // Note: different from LE_UNORDERED
};
enum GE_RESULT __gesf2(fp_t a, fp_t b) {
COMPILER_RT_ABI enum GE_RESULT
__gesf2(fp_t a, fp_t b) {
const srep_t aInt = toRep(a);
const srep_t bInt = toRep(b);
@ -108,7 +110,8 @@ enum GE_RESULT __gesf2(fp_t a, fp_t b) {
ARM_EABI_FNALIAS(fcmpun, unordsf2)
int __unordsf2(fp_t a, fp_t b) {
COMPILER_RT_ABI int
__unordsf2(fp_t a, fp_t b) {
const rep_t aAbs = toRep(a) & absMask;
const rep_t bAbs = toRep(b) & absMask;
return aAbs > infRep || bAbs > infRep;
@ -116,18 +119,22 @@ int __unordsf2(fp_t a, fp_t b) {
// The following are alternative names for the preceeding routines.
enum LE_RESULT __eqsf2(fp_t a, fp_t b) {
COMPILER_RT_ABI enum LE_RESULT
__eqsf2(fp_t a, fp_t b) {
return __lesf2(a, b);
}
enum LE_RESULT __ltsf2(fp_t a, fp_t b) {
COMPILER_RT_ABI enum LE_RESULT
__ltsf2(fp_t a, fp_t b) {
return __lesf2(a, b);
}
enum LE_RESULT __nesf2(fp_t a, fp_t b) {
COMPILER_RT_ABI enum LE_RESULT
__nesf2(fp_t a, fp_t b) {
return __lesf2(a, b);
}
enum GE_RESULT __gtsf2(fp_t a, fp_t b) {
COMPILER_RT_ABI enum GE_RESULT
__gtsf2(fp_t a, fp_t b) {
return __gesf2(a, b);
}

View File

@ -20,7 +20,7 @@
/* Precondition: a != 0 */
si_int
COMPILER_RT_ABI si_int
__ctzti2(ti_int a)
{
twords x;

View File

@ -17,7 +17,7 @@
/* Returns: the quotient of (a + ib) / (c + id) */
double _Complex
COMPILER_RT_ABI double _Complex
__divdc3(double __a, double __b, double __c, double __d)
{
int __ilogbw = 0;

View File

@ -21,7 +21,8 @@
ARM_EABI_FNALIAS(ddiv, divdf3)
fp_t __divdf3(fp_t a, fp_t b) {
COMPILER_RT_ABI fp_t
__divdf3(fp_t a, fp_t b) {
const unsigned int aExponent = toRep(a) >> significandBits & maxExponent;
const unsigned int bExponent = toRep(b) >> significandBits & maxExponent;

View File

@ -14,8 +14,6 @@
#include "int_lib.h"
du_int COMPILER_RT_ABI __udivmoddi4(du_int a, du_int b, du_int* rem);
/* Returns: a / b */
COMPILER_RT_ABI di_int

View File

@ -14,8 +14,6 @@
#include "int_lib.h"
extern COMPILER_RT_ABI di_int __divdi3(di_int a, di_int b);
/* Returns: a / b, *rem = a % b */
COMPILER_RT_ABI di_int

View File

@ -14,9 +14,6 @@
#include "int_lib.h"
extern COMPILER_RT_ABI si_int __divsi3(si_int a, si_int b);
/* Returns: a / b, *rem = a % b */
COMPILER_RT_ABI si_int

View File

@ -17,7 +17,7 @@
/* Returns: the quotient of (a + ib) / (c + id) */
float _Complex
COMPILER_RT_ABI float _Complex
__divsc3(float __a, float __b, float __c, float __d)
{
int __ilogbw = 0;

View File

@ -21,7 +21,8 @@
ARM_EABI_FNALIAS(fdiv, divsf3)
fp_t __divsf3(fp_t a, fp_t b) {
COMPILER_RT_ABI fp_t
__divsf3(fp_t a, fp_t b) {
const unsigned int aExponent = toRep(a) >> significandBits & maxExponent;
const unsigned int bExponent = toRep(b) >> significandBits & maxExponent;

View File

@ -14,8 +14,6 @@
#include "int_lib.h"
su_int COMPILER_RT_ABI __udivsi3(su_int n, su_int d);
/* Returns: a / b */
ARM_EABI_FNALIAS(idiv, divsi3)

View File

@ -16,11 +16,9 @@
#ifdef CRT_HAS_128BIT
tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem);
/* Returns: a / b */
ti_int
COMPILER_RT_ABI ti_int
__divti3(ti_int a, ti_int b)
{
const int bits_in_tword_m1 = (int)(sizeof(ti_int) * CHAR_BIT) - 1;

View File

@ -18,7 +18,7 @@
/* Returns: the quotient of (a + ib) / (c + id) */
long double _Complex
COMPILER_RT_ABI long double _Complex
__divxc3(long double __a, long double __b, long double __c, long double __d)
{
int __ilogbw = 0;

View File

@ -36,7 +36,8 @@
* that means changing the protection on those page(s) to rwx.
*/
void __enable_execute_stack(void* addr)
COMPILER_RT_ABI void
__enable_execute_stack(void* addr)
{
#if __APPLE__
@ -55,5 +56,3 @@ void __enable_execute_stack(void* addr)
size_t length = endPage - startPage;
(void) mprotect((void *)startPage, length, PROT_READ | PROT_WRITE | PROT_EXEC);
}

View File

@ -25,8 +25,9 @@
#ifndef _WIN32
__attribute__((visibility("hidden")))
#endif
void __eprintf(const char* format, const char* assertion_expression,
const char* line, const char* file)
COMPILER_RT_ABI void
__eprintf(const char* format, const char* assertion_expression,
const char* line, const char* file)
{
fprintf(stderr, format, assertion_expression, line, file);
fflush(stderr);

View File

@ -68,7 +68,8 @@ static inline dst_t dstFromRep(dst_rep_t x) {
ARM_EABI_FNALIAS(f2d, extendsfdf2)
dst_t __extendsfdf2(src_t a) {
COMPILER_RT_ABI dst_t
__extendsfdf2(src_t a) {
// Various constants whose values follow from the type parameters.
// Any reasonable optimizer will fold and propagate all of these.

View File

@ -20,7 +20,7 @@
* the value zero if a is zero. The least significant bit is index one.
*/
si_int
COMPILER_RT_ABI si_int
__ffsti2(ti_int a)
{
twords x;

View File

@ -25,7 +25,7 @@
ARM_EABI_FNALIAS(d2lz, fixdfdi)
di_int
COMPILER_RT_ABI di_int
__fixdfdi(double a)
{
double_bits fb;

View File

@ -20,7 +20,8 @@
ARM_EABI_FNALIAS(d2iz, fixdfsi)
int __fixdfsi(fp_t a) {
COMPILER_RT_ABI int
__fixdfsi(fp_t a) {
// Break a into sign, exponent, significand
const rep_t aRep = toRep(a);

View File

@ -25,7 +25,7 @@
/* seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm */
ti_int
COMPILER_RT_ABI ti_int
__fixdfti(double a)
{
double_bits fb;

View File

@ -25,7 +25,7 @@
/* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */
ti_int
COMPILER_RT_ABI ti_int
__fixsfti(float a)
{
float_bits fb;

View File

@ -28,7 +28,7 @@
/* seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm */
tu_int
COMPILER_RT_ABI tu_int
__fixunsdfti(double a)
{
double_bits fb;

View File

@ -28,7 +28,7 @@
/* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */
tu_int
COMPILER_RT_ABI tu_int
__fixunssfti(float a)
{
float_bits fb;

View File

@ -30,7 +30,7 @@
* 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm
*/
du_int
COMPILER_RT_ABI du_int
__fixunsxfdi(long double a)
{
long_double_bits fb;

View File

@ -30,7 +30,7 @@
* 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm
*/
su_int
COMPILER_RT_ABI su_int
__fixunsxfsi(long double a)
{
long_double_bits fb;

View File

@ -30,7 +30,7 @@
* 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm
*/
tu_int
COMPILER_RT_ABI tu_int
__fixunsxfti(long double a)
{
long_double_bits fb;

View File

@ -27,7 +27,7 @@
* 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm
*/
di_int
COMPILER_RT_ABI di_int
__fixxfdi(long double a)
{
long_double_bits fb;

View File

@ -27,7 +27,7 @@
* 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm
*/
ti_int
COMPILER_RT_ABI ti_int
__fixxfti(long double a)
{
long_double_bits fb;

View File

@ -26,7 +26,7 @@
* 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm
*/
long double
COMPILER_RT_ABI long double
__floatdixf(di_int a)
{
if (a == 0)

View File

@ -20,7 +20,8 @@
ARM_EABI_FNALIAS(i2d, floatsidf)
fp_t __floatsidf(int a) {
COMPILER_RT_ABI fp_t
__floatsidf(int a) {
const int aWidth = sizeof a * CHAR_BIT;

View File

@ -20,7 +20,8 @@
ARM_EABI_FNALIAS(i2f, floatsisf)
fp_t __floatsisf(int a) {
COMPILER_RT_ABI fp_t
__floatsisf(int a) {
const int aWidth = sizeof a * CHAR_BIT;

View File

@ -24,9 +24,7 @@
/* seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm */
si_int __clzti2(ti_int a);
double
COMPILER_RT_ABI double
__floattidf(ti_int a)
{
if (a == 0)

View File

@ -24,9 +24,7 @@
/* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */
si_int __clzti2(ti_int a);
float
COMPILER_RT_ABI float
__floattisf(ti_int a)
{
if (a == 0)

View File

@ -26,9 +26,7 @@
* 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm
*/
si_int __clzti2(ti_int a);
long double
COMPILER_RT_ABI long double
__floattixf(ti_int a)
{
if (a == 0)

View File

@ -29,7 +29,6 @@ ARM_EABI_FNALIAS(ul2d, floatundidf)
* as a side-effect of this computation.
*/
COMPILER_RT_ABI double
__floatundidf(du_int a)
{

View File

@ -25,7 +25,7 @@
/* gggg gggg gggg gggg gggg gggg gggg gggg | gggg gggg gggg gggg seee eeee eeee eeee |
* 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm
*/
long double
COMPILER_RT_ABI long double
__floatundixf(du_int a)
{
if (a == 0)

View File

@ -20,7 +20,8 @@
ARM_EABI_FNALIAS(ui2d, floatunsidf)
fp_t __floatunsidf(unsigned int a) {
COMPILER_RT_ABI fp_t
__floatunsidf(unsigned int a) {
const int aWidth = sizeof a * CHAR_BIT;

View File

@ -20,7 +20,8 @@
ARM_EABI_FNALIAS(ui2f, floatunsisf)
fp_t __floatunsisf(unsigned int a) {
COMPILER_RT_ABI fp_t
__floatunsisf(unsigned int a) {
const int aWidth = sizeof a * CHAR_BIT;

View File

@ -24,9 +24,7 @@
/* seee eeee eeee mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm */
si_int __clzti2(ti_int a);
double
COMPILER_RT_ABI double
__floatuntidf(tu_int a)
{
if (a == 0)

View File

@ -24,9 +24,7 @@
/* seee eeee emmm mmmm mmmm mmmm mmmm mmmm */
si_int __clzti2(ti_int a);
float
COMPILER_RT_ABI float
__floatuntisf(tu_int a)
{
if (a == 0)

View File

@ -26,9 +26,7 @@
* 1mmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm | mmmm mmmm mmmm mmmm mmmm mmmm mmmm mmmm
*/
si_int __clzti2(ti_int a);
long double
COMPILER_RT_ABI long double
__floatuntixf(tu_int a)
{
if (a == 0)

View File

@ -143,4 +143,7 @@ static inline void wideRightShiftWithSticky(rep_t *hi, rep_t *lo, unsigned int c
}
}
COMPILER_RT_ABI fp_t __adddf3(fp_t a, fp_t b);
COMPILER_RT_ABI fp_t __addsf3(fp_t a, fp_t b);
#endif // FP_LIB_HEADER

View File

@ -46,11 +46,11 @@ struct _Unwind_Exception {
uintptr_t private_2;
};
extern const uint8_t* _Unwind_GetLanguageSpecificData(_Unwind_Context_t c);
extern void _Unwind_SetGR(_Unwind_Context_t c, int i, uintptr_t n);
extern void _Unwind_SetIP(_Unwind_Context_t, uintptr_t new_value);
extern uintptr_t _Unwind_GetIP(_Unwind_Context_t context);
extern uintptr_t _Unwind_GetRegionStart(_Unwind_Context_t context);
COMPILER_RT_ABI const uint8_t* _Unwind_GetLanguageSpecificData(_Unwind_Context_t c);
COMPILER_RT_ABI void _Unwind_SetGR(_Unwind_Context_t c, int i, uintptr_t n);
COMPILER_RT_ABI void _Unwind_SetIP(_Unwind_Context_t, uintptr_t new_value);
COMPILER_RT_ABI uintptr_t _Unwind_GetIP(_Unwind_Context_t context);
COMPILER_RT_ABI uintptr_t _Unwind_GetRegionStart(_Unwind_Context_t context);
/*
@ -182,11 +182,13 @@ static uintptr_t readEncodedPointer(const uint8_t** data, uint8_t encoding)
*/
#if __arm__
// the setjump-longjump based exceptions personality routine has a different name
_Unwind_Reason_Code __gcc_personality_sj0(int version, _Unwind_Action actions,
COMPILER_RT_ABI _Unwind_Reason_Code
__gcc_personality_sj0(int version, _Unwind_Action actions,
uint64_t exceptionClass, struct _Unwind_Exception* exceptionObject,
_Unwind_Context_t context)
#else
_Unwind_Reason_Code __gcc_personality_v0(int version, _Unwind_Action actions,
COMPILER_RT_ABI _Unwind_Reason_Code
__gcc_personality_v0(int version, _Unwind_Action actions,
uint64_t exceptionClass, struct _Unwind_Exception* exceptionObject,
_Unwind_Context_t context)
#endif

View File

@ -53,4 +53,19 @@
/* Include internal utility function declarations. */
#include "int_util.h"
COMPILER_RT_ABI si_int __clzti2(ti_int a);
COMPILER_RT_ABI si_int __paritysi2(si_int a);
COMPILER_RT_ABI si_int __paritydi2(di_int a);
COMPILER_RT_ABI di_int __divdi3(di_int a, di_int b);
COMPILER_RT_ABI si_int __divsi3(si_int a, si_int b);
COMPILER_RT_ABI su_int __udivsi3(su_int n, su_int d);
COMPILER_RT_ABI su_int __udivmodsi4(su_int a, su_int b, su_int* rem);
COMPILER_RT_ABI du_int __udivmoddi4(du_int a, du_int b, du_int* rem);
#ifdef CRT_HAS_128BIT
COMPILER_RT_ABI tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem);
#endif
#endif /* INT_LIB_H */

View File

@ -20,7 +20,7 @@
/* Precondition: 0 <= b < bits_in_tword */
ti_int
COMPILER_RT_ABI ti_int
__lshrti3(ti_int a, si_int b)
{
const int bits_in_dword = (int)(sizeof(di_int) * CHAR_BIT);

View File

@ -14,8 +14,6 @@
#include "int_lib.h"
COMPILER_RT_ABI du_int __udivmoddi4(du_int a, du_int b, du_int* rem);
/* Returns: a % b */
COMPILER_RT_ABI di_int

View File

@ -14,8 +14,6 @@
#include "int_lib.h"
su_int COMPILER_RT_ABI __divsi3(si_int a, si_int b);
/* Returns: a % b */
COMPILER_RT_ABI si_int

View File

@ -16,11 +16,9 @@
#ifdef CRT_HAS_128BIT
tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem);
/*Returns: a % b */
ti_int
COMPILER_RT_ABI ti_int
__modti3(ti_int a, ti_int b)
{
const int bits_in_tword_m1 = (int)(sizeof(ti_int) * CHAR_BIT) - 1;

View File

@ -17,7 +17,7 @@
/* Returns: the product of a + ib and c + id */
double _Complex
COMPILER_RT_ABI double _Complex
__muldc3(double __a, double __b, double __c, double __d)
{
double __ac = __a * __c;

View File

@ -18,7 +18,7 @@
/* Effects: sets *overflow to 1 if a * b overflows */
di_int
COMPILER_RT_ABI di_int
__mulodi4(di_int a, di_int b, int* overflow)
{
const int N = (int)(sizeof(di_int) * CHAR_BIT);

View File

@ -18,7 +18,7 @@
/* Effects: sets *overflow to 1 if a * b overflows */
si_int
COMPILER_RT_ABI si_int
__mulosi4(si_int a, si_int b, int* overflow)
{
const int N = (int)(sizeof(si_int) * CHAR_BIT);

View File

@ -20,7 +20,7 @@
/* Effects: sets *overflow to 1 if a * b overflows */
ti_int
COMPILER_RT_ABI ti_int
__muloti4(ti_int a, ti_int b, int* overflow)
{
const int N = (int)(sizeof(ti_int) * CHAR_BIT);

View File

@ -17,7 +17,7 @@
/* Returns: the product of a + ib and c + id */
float _Complex
COMPILER_RT_ABI float _Complex
__mulsc3(float __a, float __b, float __c, float __d)
{
float __ac = __a * __c;

View File

@ -42,7 +42,7 @@ __mulddi3(du_int a, du_int b)
/* Returns: a * b */
ti_int
COMPILER_RT_ABI ti_int
__multi3(ti_int a, ti_int b)
{
twords x;

View File

@ -18,7 +18,7 @@
/* Effects: aborts if a * b overflows */
di_int
COMPILER_RT_ABI di_int
__mulvdi3(di_int a, di_int b)
{
const int N = (int)(sizeof(di_int) * CHAR_BIT);

View File

@ -18,7 +18,7 @@
/* Effects: aborts if a * b overflows */
si_int
COMPILER_RT_ABI si_int
__mulvsi3(si_int a, si_int b)
{
const int N = (int)(sizeof(si_int) * CHAR_BIT);

View File

@ -20,7 +20,7 @@
/* Effects: aborts if a * b overflows */
ti_int
COMPILER_RT_ABI ti_int
__mulvti3(ti_int a, ti_int b)
{
const int N = (int)(sizeof(ti_int) * CHAR_BIT);

View File

@ -19,7 +19,7 @@
/* Returns: the product of a + ib and c + id */
long double _Complex
COMPILER_RT_ABI long double _Complex
__mulxc3(long double __a, long double __b, long double __c, long double __d)
{
long double __ac = __a * __c;

View File

@ -16,6 +16,7 @@
ARM_EABI_FNALIAS(dneg, negdf2)
fp_t __negdf2(fp_t a) {
COMPILER_RT_ABI fp_t
__negdf2(fp_t a) {
return fromRep(toRep(a) ^ signBit);
}

View File

@ -16,7 +16,7 @@
/* Returns: -a */
di_int
COMPILER_RT_ABI di_int
__negdi2(di_int a)
{
/* Note: this routine is here for API compatibility; any sane compiler

View File

@ -18,7 +18,7 @@
/* Returns: -a */
ti_int
COMPILER_RT_ABI ti_int
__negti2(ti_int a)
{
/* Note: this routine is here for API compatibility; any sane compiler

View File

@ -20,7 +20,7 @@
/* Effects: aborts if -a overflows */
ti_int
COMPILER_RT_ABI ti_int
__negvti2(ti_int a)
{
const ti_int MIN = (ti_int)1 << ((int)(sizeof(ti_int) * CHAR_BIT)-1);

View File

@ -16,8 +16,6 @@
/* Returns: 1 if number of bits is odd else returns 0 */
si_int COMPILER_RT_ABI __paritysi2(si_int a);
COMPILER_RT_ABI si_int
__paritydi2(di_int a)
{

View File

@ -18,9 +18,7 @@
/* Returns: 1 if number of bits is odd else returns 0 */
si_int __paritydi2(di_int a);
si_int
COMPILER_RT_ABI si_int
__parityti2(ti_int a)
{
twords x;

View File

@ -18,7 +18,7 @@
/* Returns: count of 1 bits */
si_int
COMPILER_RT_ABI si_int
__popcountti2(ti_int a)
{
tu_int x3 = (tu_int)a;

View File

@ -18,7 +18,7 @@
/* Returns: a ^ b */
long double
COMPILER_RT_ABI long double
__powitf2(long double a, si_int b)
{
const int recip = b < 0;

View File

@ -18,7 +18,7 @@
/* Returns: a ^ b */
long double
COMPILER_RT_ABI long double
__powixf2(long double a, si_int b)
{
const int recip = b < 0;

View File

@ -15,9 +15,6 @@
#define DOUBLE_PRECISION
#include "fp_lib.h"
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.

View File

@ -15,8 +15,6 @@
#define SINGLE_PRECISION
#include "fp_lib.h"
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.

View File

@ -20,7 +20,7 @@
/* Effects: aborts if a - b overflows */
ti_int
COMPILER_RT_ABI ti_int
__subvti3(ti_int a, ti_int b)
{
ti_int s = a - b;

View File

@ -21,8 +21,9 @@ extern void __clear_cache(void* start, void* end);
*/
#if __ppc__ && !defined(__powerpc64__)
void __trampoline_setup(uint32_t* trampOnStack, int trampSizeAllocated,
const void* realFunc, void* localsPtr)
COMPILER_RT_ABI void
__trampoline_setup(uint32_t* trampOnStack, int trampSizeAllocated,
const void* realFunc, void* localsPtr)
{
/* should never happen, but if compiler did not allocate */
/* enough space on stack for the trampoline, abort */

View File

@ -21,7 +21,7 @@
* if (a > b) returns 2
*/
si_int
COMPILER_RT_ABI si_int
__ucmpti2(tu_int a, tu_int b)
{
utwords x;

View File

@ -14,8 +14,6 @@
#include "int_lib.h"
du_int COMPILER_RT_ABI __udivmoddi4(du_int a, du_int b, du_int* rem);
/* Returns: a / b */
COMPILER_RT_ABI du_int

View File

@ -14,9 +14,6 @@
#include "int_lib.h"
extern su_int COMPILER_RT_ABI __udivsi3(su_int n, su_int d);
/* Returns: a / b, *rem = a % b */
COMPILER_RT_ABI su_int

View File

@ -22,7 +22,7 @@
/* Translated from Figure 3-40 of The PowerPC Compiler Writer's Guide */
tu_int
COMPILER_RT_ABI tu_int
__udivmodti4(tu_int a, tu_int b, tu_int* rem)
{
const unsigned n_udword_bits = sizeof(du_int) * CHAR_BIT;

View File

@ -16,11 +16,9 @@
#ifdef CRT_HAS_128BIT
tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem);
/* Returns: a / b */
tu_int
COMPILER_RT_ABI tu_int
__udivti3(tu_int a, tu_int b)
{
return __udivmodti4(a, b, 0);

View File

@ -14,8 +14,6 @@
#include "int_lib.h"
du_int COMPILER_RT_ABI __udivmoddi4(du_int a, du_int b, du_int* rem);
/* Returns: a % b */
COMPILER_RT_ABI du_int

View File

@ -16,8 +16,6 @@
/* Returns: a % b */
su_int COMPILER_RT_ABI __udivsi3(su_int a, su_int b);
COMPILER_RT_ABI su_int
__umodsi3(su_int a, su_int b)
{

View File

@ -16,11 +16,9 @@
#ifdef CRT_HAS_128BIT
tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem);
/* Returns: a % b */
tu_int
COMPILER_RT_ABI tu_int
__umodti3(tu_int a, tu_int b)
{
tu_int r;