forked from OSchip/llvm-project
				
			Move abi bits to separate header. Force AAPCS for EABI in accordance with ARM RTABI.
llvm-svn: 129769
This commit is contained in:
		
							parent
							
								
									75e3c1993c
								
							
						
					
					
						commit
						e63da933eb
					
				| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,6 +11,7 @@
 | 
			
		|||
 *
 | 
			
		||||
 * ===----------------------------------------------------------------------===
 | 
			
		||||
 */
 | 
			
		||||
#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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
__cmpdi2(di_int a, di_int b)
 | 
			
		||||
{
 | 
			
		||||
    dwords x;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,6 +11,7 @@
 | 
			
		|||
 *
 | 
			
		||||
 * ===----------------------------------------------------------------------===
 | 
			
		||||
 */
 | 
			
		||||
#include "abi.h"
 | 
			
		||||
 | 
			
		||||
#include "int_lib.h"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,6 +11,7 @@
 | 
			
		|||
 *
 | 
			
		||||
 * ===----------------------------------------------------------------------===
 | 
			
		||||
 */
 | 
			
		||||
#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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,15 +11,16 @@
 | 
			
		|||
 *
 | 
			
		||||
 * ===----------------------------------------------------------------------===
 | 
			
		||||
 */
 | 
			
		||||
#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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue