diff options
author | ed <ed@FreeBSD.org> | 2011-12-31 19:01:48 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2011-12-31 19:01:48 +0000 |
commit | 0ece074de9d070fa87b7f58f9e96bce63db862d8 (patch) | |
tree | 21b838383a703c249dd4f0180c8566c40f70e0e3 /contrib/compiler-rt/lib/int_lib.h | |
parent | 55bd70ed9a164b6b2d84037c8362ff3725ff294b (diff) | |
parent | 6a5f9bc9ae3205be8bb5570b86a509fcd01a9db6 (diff) | |
download | FreeBSD-src-0ece074de9d070fa87b7f58f9e96bce63db862d8.zip FreeBSD-src-0ece074de9d070fa87b7f58f9e96bce63db862d8.tar.gz |
Upgrade libcompiler_rt to upstream revision 147390.
This version of libcompiler_rt adds support for __mulo[sdt]i4(), which
computes a multiply and its overflow flag. There are also a lot of
cleanup fixes to headers that don't really affect us.
Updating to this revision should make it a bit easier to contribute
changes back to the LLVM developers.
Diffstat (limited to 'contrib/compiler-rt/lib/int_lib.h')
-rw-r--r-- | contrib/compiler-rt/lib/int_lib.h | 148 |
1 files changed, 19 insertions, 129 deletions
diff --git a/contrib/compiler-rt/lib/int_lib.h b/contrib/compiler-rt/lib/int_lib.h index e1fd6b7..a87426c 100644 --- a/contrib/compiler-rt/lib/int_lib.h +++ b/contrib/compiler-rt/lib/int_lib.h @@ -16,141 +16,31 @@ #ifndef INT_LIB_H #define INT_LIB_H -/* Assumption: signed integral is 2's complement */ -/* Assumption: right shift of signed negative is arithmetic shift */ +/* Assumption: Signed integral is 2's complement. */ +/* Assumption: Right shift of signed negative is arithmetic shift. */ +/* Assumption: Endianness is little or big (not mixed). */ -#include <limits.h> -#include <stdint.h> -#include "endianness.h" -#include <math.h> +/* ABI macro definitions */ -/* If compiling for kernel use, call panic() instead of abort(). */ -#ifdef KERNEL_USE -extern void panic (const char *, ...); -#define compilerrt_abort() \ - panic("%s:%d: abort in %s", __FILE__, __LINE__, __FUNCTION__) +#if __ARM_EABI__ +# define ARM_EABI_FNALIAS(aeabi_name, name) \ + void __aeabi_##aeabi_name() __attribute__((alias("__" #name))); +# define COMPILER_RT_ABI __attribute__((pcs("aapcs"))) #else -#define compilerrt_abort() abort() +# define ARM_EABI_FNALIAS(aeabi_name, name) +# define COMPILER_RT_ABI #endif -#if !defined(INFINITY) && defined(HUGE_VAL) -#define INFINITY HUGE_VAL -#endif /* INFINITY */ - -typedef int si_int; -typedef unsigned su_int; - -typedef long long di_int; -typedef unsigned long long du_int; - -typedef union -{ - di_int all; - struct - { -#if _YUGA_LITTLE_ENDIAN - su_int low; - si_int high; -#else - si_int high; - su_int low; -#endif /* _YUGA_LITTLE_ENDIAN */ - }s; -} dwords; - -typedef union -{ - du_int all; - struct - { -#if _YUGA_LITTLE_ENDIAN - su_int low; - su_int high; -#else - su_int high; - su_int low; -#endif /* _YUGA_LITTLE_ENDIAN */ - }s; -} udwords; - -#if __x86_64 - -typedef int ti_int __attribute__ ((mode (TI))); -typedef unsigned tu_int __attribute__ ((mode (TI))); - -typedef union -{ - ti_int all; - struct - { -#if _YUGA_LITTLE_ENDIAN - du_int low; - di_int high; -#else - di_int high; - du_int low; -#endif /* _YUGA_LITTLE_ENDIAN */ - }s; -} twords; - -typedef union -{ - tu_int all; - struct - { -#if _YUGA_LITTLE_ENDIAN - du_int low; - du_int high; -#else - du_int high; - du_int low; -#endif /* _YUGA_LITTLE_ENDIAN */ - }s; -} utwords; - -static inline ti_int make_ti(di_int h, di_int l) { - twords r; - r.s.high = h; - r.s.low = l; - return r.all; -} - -static inline tu_int make_tu(du_int h, du_int l) { - utwords r; - r.s.high = h; - r.s.low = l; - return r.all; -} - -#endif /* __x86_64 */ - -typedef union -{ - su_int u; - float f; -} float_bits; - -typedef union -{ - udwords u; - double f; -} double_bits; +/* Include the standard compiler builtin headers we use functionality from. */ +#include <limits.h> +#include <stdint.h> +#include <stdbool.h> +#include <float.h> -typedef struct -{ -#if _YUGA_LITTLE_ENDIAN - udwords low; - udwords high; -#else - udwords high; - udwords low; -#endif /* _YUGA_LITTLE_ENDIAN */ -} uqwords; +/* Include the commonly used internal type definitions. */ +#include "int_types.h" -typedef union -{ - uqwords u; - long double f; -} long_double_bits; +/* Include internal utility function declarations. */ +#include "int_util.h" #endif /* INT_LIB_H */ |