summaryrefslogtreecommitdiffstats
path: root/contrib/compiler-rt/lib/builtins/fp_lib.h
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2016-02-06 13:39:20 +0000
committerdim <dim@FreeBSD.org>2016-02-06 13:39:20 +0000
commit9c27ec33f2c82fe6c60c9c375a88f96a1e10a6a2 (patch)
tree4efb8604227ede935238eb1c67b626da1265d459 /contrib/compiler-rt/lib/builtins/fp_lib.h
parentaef1771e36f9842a113b9905d0d5926fe9d694aa (diff)
parent75958af7df18c2ae942829da1a8cf3b5bbcaeff6 (diff)
downloadFreeBSD-src-9c27ec33f2c82fe6c60c9c375a88f96a1e10a6a2.zip
FreeBSD-src-9c27ec33f2c82fe6c60c9c375a88f96a1e10a6a2.tar.gz
Merge compiler-rt release_38 branch r258968.
Note that there is still a problem on amd64, causing SIGBUS in the early startup of Address Sanitizer. This is being investigated.
Diffstat (limited to 'contrib/compiler-rt/lib/builtins/fp_lib.h')
-rw-r--r--contrib/compiler-rt/lib/builtins/fp_lib.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/contrib/compiler-rt/lib/builtins/fp_lib.h b/contrib/compiler-rt/lib/builtins/fp_lib.h
index faebb99..223fb98 100644
--- a/contrib/compiler-rt/lib/builtins/fp_lib.h
+++ b/contrib/compiler-rt/lib/builtins/fp_lib.h
@@ -46,12 +46,12 @@ typedef float fp_t;
#define REP_C UINT32_C
#define significandBits 23
-static inline int rep_clz(rep_t a) {
+static __inline int rep_clz(rep_t a) {
return __builtin_clz(a);
}
// 32x32 --> 64 bit multiply
-static inline void wideMultiply(rep_t a, rep_t b, rep_t *hi, rep_t *lo) {
+static __inline void wideMultiply(rep_t a, rep_t b, rep_t *hi, rep_t *lo) {
const uint64_t product = (uint64_t)a*b;
*hi = product >> 32;
*lo = product;
@@ -66,7 +66,7 @@ typedef double fp_t;
#define REP_C UINT64_C
#define significandBits 52
-static inline int rep_clz(rep_t a) {
+static __inline int rep_clz(rep_t a) {
#if defined __LP64__
return __builtin_clzl(a);
#else
@@ -83,7 +83,7 @@ static inline int rep_clz(rep_t a) {
// 64x64 -> 128 wide multiply for platforms that don't have such an operation;
// many 64-bit platforms have this operation, but they tend to have hardware
// floating-point, so we don't bother with a special case for them here.
-static inline void wideMultiply(rep_t a, rep_t b, rep_t *hi, rep_t *lo) {
+static __inline void wideMultiply(rep_t a, rep_t b, rep_t *hi, rep_t *lo) {
// Each of the component 32x32 -> 64 products
const uint64_t plolo = loWord(a) * loWord(b);
const uint64_t plohi = loWord(a) * hiWord(b);
@@ -112,7 +112,7 @@ typedef long double fp_t;
// 128-bit integer, we let the constant be casted to 128-bit integer
#define significandBits 112
-static inline int rep_clz(rep_t a) {
+static __inline int rep_clz(rep_t a) {
const union
{
__uint128_t ll;
@@ -148,7 +148,7 @@ static inline int rep_clz(rep_t a) {
// 128x128 -> 256 wide multiply for platforms that don't have such an operation;
// many 64-bit platforms have this operation, but they tend to have hardware
// floating-point, so we don't bother with a special case for them here.
-static inline void wideMultiply(rep_t a, rep_t b, rep_t *hi, rep_t *lo) {
+static __inline void wideMultiply(rep_t a, rep_t b, rep_t *hi, rep_t *lo) {
const uint64_t product11 = Word_1(a) * Word_1(b);
const uint64_t product12 = Word_1(a) * Word_2(b);
@@ -228,28 +228,28 @@ static inline void wideMultiply(rep_t a, rep_t b, rep_t *hi, rep_t *lo) {
#define quietBit (implicitBit >> 1)
#define qnanRep (exponentMask | quietBit)
-static inline rep_t toRep(fp_t x) {
+static __inline rep_t toRep(fp_t x) {
const union { fp_t f; rep_t i; } rep = {.f = x};
return rep.i;
}
-static inline fp_t fromRep(rep_t x) {
+static __inline fp_t fromRep(rep_t x) {
const union { fp_t f; rep_t i; } rep = {.i = x};
return rep.f;
}
-static inline int normalize(rep_t *significand) {
+static __inline int normalize(rep_t *significand) {
const int shift = rep_clz(*significand) - rep_clz(implicitBit);
*significand <<= shift;
return 1 - shift;
}
-static inline void wideLeftShift(rep_t *hi, rep_t *lo, int count) {
+static __inline void wideLeftShift(rep_t *hi, rep_t *lo, int count) {
*hi = *hi << count | *lo >> (typeWidth - count);
*lo = *lo << count;
}
-static inline void wideRightShiftWithSticky(rep_t *hi, rep_t *lo, unsigned int count) {
+static __inline void wideRightShiftWithSticky(rep_t *hi, rep_t *lo, unsigned int count) {
if (count < typeWidth) {
const bool sticky = *lo << (typeWidth - count);
*lo = *hi << (typeWidth - count) | *lo >> count | sticky;
OpenPOWER on IntegriCloud