Skip to content

Commit

Permalink
fpu: replace LIT64 usage with UINT64_C for specialize constants
Browse files Browse the repository at this point in the history
We have a wrapper that does the right thing from stdint.h so lets use
it for our constants in softfloat-specialize.h

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
stsquad committed Aug 19, 2019
1 parent afd7605 commit f7e81a9
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions fpu/softfloat-specialize.h
Expand Up @@ -196,11 +196,11 @@ floatx80 floatx80_default_nan(float_status *status)
/* None of the targets that have snan_bit_is_one use floatx80. */
assert(!snan_bit_is_one(status));
#if defined(TARGET_M68K)
r.low = LIT64(0xFFFFFFFFFFFFFFFF);
r.low = UINT64_C(0xFFFFFFFFFFFFFFFF);
r.high = 0x7FFF;
#else
/* X86 */
r.low = LIT64(0xC000000000000000);
r.low = UINT64_C(0xC000000000000000);
r.high = 0xFFFF;
#endif
return r;
Expand All @@ -212,9 +212,9 @@ floatx80 floatx80_default_nan(float_status *status)

#define floatx80_infinity_high 0x7FFF
#if defined(TARGET_M68K)
#define floatx80_infinity_low LIT64(0x0000000000000000)
#define floatx80_infinity_low UINT64_C(0x0000000000000000)
#else
#define floatx80_infinity_low LIT64(0x8000000000000000)
#define floatx80_infinity_low UINT64_C(0x8000000000000000)
#endif

const floatx80 floatx80_infinity
Expand Down Expand Up @@ -667,7 +667,7 @@ int float64_is_signaling_nan(float64 a_, float_status *status)
return ((a << 1) >= 0xFFF0000000000000ULL);
} else {
return (((a >> 51) & 0xFFF) == 0xFFE)
&& (a & LIT64(0x0007FFFFFFFFFFFF));
&& (a & UINT64_C(0x0007FFFFFFFFFFFF));
}
#endif
}
Expand Down Expand Up @@ -707,7 +707,7 @@ static float64 commonNaNToFloat64(commonNaNT a, float_status *status)
if (mantissa) {
return make_float64(
(((uint64_t) a.sign) << 63)
| LIT64(0x7FF0000000000000)
| UINT64_C(0x7FF0000000000000)
| (a.high >> 12));
} else {
return float64_default_nan(status);
Expand Down Expand Up @@ -790,7 +790,7 @@ int floatx80_is_quiet_nan(floatx80 a, float_status *status)
&& (a.low == aLow);
} else {
return ((a.high & 0x7FFF) == 0x7FFF)
&& (LIT64(0x8000000000000000) <= ((uint64_t)(a.low << 1)));
&& (UINT64_C(0x8000000000000000) <= ((uint64_t)(a.low << 1)));
}
#endif
}
Expand All @@ -812,7 +812,7 @@ int floatx80_is_signaling_nan(floatx80 a, float_status *status)
} else {
uint64_t aLow;

aLow = a.low & ~LIT64(0x4000000000000000);
aLow = a.low & ~UINT64_C(0x4000000000000000);
return ((a.high & 0x7FFF) == 0x7FFF)
&& (uint64_t)(aLow << 1)
&& (a.low == aLow);
Expand All @@ -829,7 +829,7 @@ floatx80 floatx80_silence_nan(floatx80 a, float_status *status)
{
/* None of the targets that have snan_bit_is_one use floatx80. */
assert(!snan_bit_is_one(status));
a.low |= LIT64(0xC000000000000000);
a.low |= UINT64_C(0xC000000000000000);
return a;
}

Expand Down Expand Up @@ -874,7 +874,7 @@ static floatx80 commonNaNToFloatx80(commonNaNT a, float_status *status)
}

if (a.high >> 1) {
z.low = LIT64(0x8000000000000000) | a.high >> 1;
z.low = UINT64_C(0x8000000000000000) | a.high >> 1;
z.high = (((uint16_t)a.sign) << 15) | 0x7FFF;
} else {
z = floatx80_default_nan(status);
Expand Down Expand Up @@ -969,7 +969,7 @@ int float128_is_signaling_nan(float128 a, float_status *status)
&& (a.low || (a.high & 0x0000FFFFFFFFFFFFULL));
} else {
return (((a.high >> 47) & 0xFFFF) == 0xFFFE)
&& (a.low || (a.high & LIT64(0x00007FFFFFFFFFFF)));
&& (a.low || (a.high & UINT64_C(0x00007FFFFFFFFFFF)));
}
#endif
}
Expand All @@ -987,7 +987,7 @@ float128 float128_silence_nan(float128 a, float_status *status)
if (snan_bit_is_one(status)) {
return float128_default_nan(status);
} else {
a.high |= LIT64(0x0000800000000000);
a.high |= UINT64_C(0x0000800000000000);
return a;
}
#endif
Expand Down Expand Up @@ -1025,7 +1025,7 @@ static float128 commonNaNToFloat128(commonNaNT a, float_status *status)
}

shift128Right(a.high, a.low, 16, &z.high, &z.low);
z.high |= (((uint64_t)a.sign) << 63) | LIT64(0x7FFF000000000000);
z.high |= (((uint64_t)a.sign) << 63) | UINT64_C(0x7FFF000000000000);
return z;
}

Expand Down

0 comments on commit f7e81a9

Please sign in to comment.