mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
softfloat: Replace flag with bool
We have had this on the to-do list for quite some time. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
@@ -93,7 +93,7 @@ this code that are retained.
|
||||
* 2008 revision and backward compatibility with their original choice.
|
||||
* Thus for MIPS we must make the choice at runtime.
|
||||
*/
|
||||
static inline flag snan_bit_is_one(float_status *status)
|
||||
static inline bool snan_bit_is_one(float_status *status)
|
||||
{
|
||||
#if defined(TARGET_MIPS)
|
||||
return status->snan_bit_is_one;
|
||||
@@ -114,7 +114,7 @@ static bool parts_is_snan_frac(uint64_t frac, float_status *status)
|
||||
#ifdef NO_SIGNALING_NANS
|
||||
return false;
|
||||
#else
|
||||
flag msb = extract64(frac, DECOMPOSED_BINARY_POINT - 1, 1);
|
||||
bool msb = extract64(frac, DECOMPOSED_BINARY_POINT - 1, 1);
|
||||
return msb == snan_bit_is_one(status);
|
||||
#endif
|
||||
}
|
||||
@@ -236,7 +236,7 @@ void float_raise(uint8_t flags, float_status *status)
|
||||
| Internal canonical NaN format.
|
||||
*----------------------------------------------------------------------------*/
|
||||
typedef struct {
|
||||
flag sign;
|
||||
bool sign;
|
||||
uint64_t high, low;
|
||||
} commonNaNT;
|
||||
|
||||
@@ -374,7 +374,7 @@ static float32 commonNaNToFloat32(commonNaNT a, float_status *status)
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
static int pickNaN(FloatClass a_cls, FloatClass b_cls,
|
||||
flag aIsLargerSignificand)
|
||||
bool aIsLargerSignificand)
|
||||
{
|
||||
#if defined(TARGET_ARM) || defined(TARGET_MIPS) || defined(TARGET_HPPA)
|
||||
/* ARM mandated NaN propagation rules (see FPProcessNaNs()), take
|
||||
@@ -584,7 +584,7 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass b_cls, FloatClass c_cls,
|
||||
|
||||
static float32 propagateFloat32NaN(float32 a, float32 b, float_status *status)
|
||||
{
|
||||
flag aIsLargerSignificand;
|
||||
bool aIsLargerSignificand;
|
||||
uint32_t av, bv;
|
||||
FloatClass a_cls, b_cls;
|
||||
|
||||
@@ -722,7 +722,7 @@ static float64 commonNaNToFloat64(commonNaNT a, float_status *status)
|
||||
|
||||
static float64 propagateFloat64NaN(float64 a, float64 b, float_status *status)
|
||||
{
|
||||
flag aIsLargerSignificand;
|
||||
bool aIsLargerSignificand;
|
||||
uint64_t av, bv;
|
||||
FloatClass a_cls, b_cls;
|
||||
|
||||
@@ -890,7 +890,7 @@ static floatx80 commonNaNToFloatx80(commonNaNT a, float_status *status)
|
||||
|
||||
floatx80 propagateFloatx80NaN(floatx80 a, floatx80 b, float_status *status)
|
||||
{
|
||||
flag aIsLargerSignificand;
|
||||
bool aIsLargerSignificand;
|
||||
FloatClass a_cls, b_cls;
|
||||
|
||||
/* This is not complete, but is good enough for pickNaN. */
|
||||
@@ -1038,7 +1038,7 @@ static float128 commonNaNToFloat128(commonNaNT a, float_status *status)
|
||||
static float128 propagateFloat128NaN(float128 a, float128 b,
|
||||
float_status *status)
|
||||
{
|
||||
flag aIsLargerSignificand;
|
||||
bool aIsLargerSignificand;
|
||||
FloatClass a_cls, b_cls;
|
||||
|
||||
/* This is not complete, but is good enough for pickNaN. */
|
||||
|
||||
+94
-96
File diff suppressed because it is too large
Load Diff
@@ -74,22 +74,22 @@ static inline void set_floatx80_rounding_precision(int val,
|
||||
status->floatx80_rounding_precision = val;
|
||||
}
|
||||
|
||||
static inline void set_flush_to_zero(flag val, float_status *status)
|
||||
static inline void set_flush_to_zero(bool val, float_status *status)
|
||||
{
|
||||
status->flush_to_zero = val;
|
||||
}
|
||||
|
||||
static inline void set_flush_inputs_to_zero(flag val, float_status *status)
|
||||
static inline void set_flush_inputs_to_zero(bool val, float_status *status)
|
||||
{
|
||||
status->flush_inputs_to_zero = val;
|
||||
}
|
||||
|
||||
static inline void set_default_nan_mode(flag val, float_status *status)
|
||||
static inline void set_default_nan_mode(bool val, float_status *status)
|
||||
{
|
||||
status->default_nan_mode = val;
|
||||
}
|
||||
|
||||
static inline void set_snan_bit_is_one(flag val, float_status *status)
|
||||
static inline void set_snan_bit_is_one(bool val, float_status *status)
|
||||
{
|
||||
status->snan_bit_is_one = val;
|
||||
}
|
||||
@@ -114,17 +114,17 @@ static inline int get_floatx80_rounding_precision(float_status *status)
|
||||
return status->floatx80_rounding_precision;
|
||||
}
|
||||
|
||||
static inline flag get_flush_to_zero(float_status *status)
|
||||
static inline bool get_flush_to_zero(float_status *status)
|
||||
{
|
||||
return status->flush_to_zero;
|
||||
}
|
||||
|
||||
static inline flag get_flush_inputs_to_zero(float_status *status)
|
||||
static inline bool get_flush_inputs_to_zero(float_status *status)
|
||||
{
|
||||
return status->flush_inputs_to_zero;
|
||||
}
|
||||
|
||||
static inline flag get_default_nan_mode(float_status *status)
|
||||
static inline bool get_default_nan_mode(float_status *status)
|
||||
{
|
||||
return status->default_nan_mode;
|
||||
}
|
||||
|
||||
@@ -756,11 +756,9 @@ static inline uint32_t estimateSqrt32(int aExp, uint32_t a)
|
||||
| Otherwise, returns 0.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
static inline flag eq128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 )
|
||||
static inline bool eq128(uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1)
|
||||
{
|
||||
|
||||
return ( a0 == b0 ) && ( a1 == b1 );
|
||||
|
||||
return a0 == b0 && a1 == b1;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
@@ -769,11 +767,9 @@ static inline flag eq128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 )
|
||||
| Otherwise, returns 0.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
static inline flag le128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 )
|
||||
static inline bool le128(uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1)
|
||||
{
|
||||
|
||||
return ( a0 < b0 ) || ( ( a0 == b0 ) && ( a1 <= b1 ) );
|
||||
|
||||
return a0 < b0 || (a0 == b0 && a1 <= b1);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
@@ -782,11 +778,9 @@ static inline flag le128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 )
|
||||
| returns 0.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
static inline flag lt128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 )
|
||||
static inline bool lt128(uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1)
|
||||
{
|
||||
|
||||
return ( a0 < b0 ) || ( ( a0 == b0 ) && ( a1 < b1 ) );
|
||||
|
||||
return a0 < b0 || (a0 == b0 && a1 < b1);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
@@ -795,11 +789,9 @@ static inline flag lt128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 )
|
||||
| Otherwise, returns 0.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
static inline flag ne128( uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1 )
|
||||
static inline bool ne128(uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1)
|
||||
{
|
||||
|
||||
return ( a0 != b0 ) || ( a1 != b1 );
|
||||
|
||||
return a0 != b0 || a1 != b1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -80,12 +80,6 @@ this code that are retained.
|
||||
#ifndef SOFTFLOAT_TYPES_H
|
||||
#define SOFTFLOAT_TYPES_H
|
||||
|
||||
/* This 'flag' type must be able to hold at least 0 and 1. It should
|
||||
* probably be replaced with 'bool' but the uses would need to be audited
|
||||
* to check that they weren't accidentally relying on it being a larger type.
|
||||
*/
|
||||
typedef uint8_t flag;
|
||||
|
||||
/*
|
||||
* Software IEC/IEEE floating-point types.
|
||||
*/
|
||||
@@ -169,12 +163,12 @@ typedef struct float_status {
|
||||
uint8_t float_exception_flags;
|
||||
signed char floatx80_rounding_precision;
|
||||
/* should denormalised results go to zero and set the inexact flag? */
|
||||
flag flush_to_zero;
|
||||
bool flush_to_zero;
|
||||
/* should denormalised inputs go to zero and set the input_denormal flag? */
|
||||
flag flush_inputs_to_zero;
|
||||
flag default_nan_mode;
|
||||
bool flush_inputs_to_zero;
|
||||
bool default_nan_mode;
|
||||
/* not always used -- see snan_bit_is_one() in softfloat-specialize.h */
|
||||
flag snan_bit_is_one;
|
||||
bool snan_bit_is_one;
|
||||
} float_status;
|
||||
|
||||
#endif /* SOFTFLOAT_TYPES_H */
|
||||
|
||||
@@ -440,7 +440,7 @@ static inline float32 float32_set_sign(float32 a, int sign)
|
||||
| significand.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
static inline float32 packFloat32(flag zSign, int zExp, uint32_t zSig)
|
||||
static inline float32 packFloat32(bool zSign, int zExp, uint32_t zSig)
|
||||
{
|
||||
return make_float32(
|
||||
(((uint32_t)zSign) << 31) + (((uint32_t)zExp) << 23) + zSig);
|
||||
@@ -722,7 +722,7 @@ static inline int32_t extractFloatx80Exp(floatx80 a)
|
||||
| `a'.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
static inline flag extractFloatx80Sign(floatx80 a)
|
||||
static inline bool extractFloatx80Sign(floatx80 a)
|
||||
{
|
||||
return a.high >> 15;
|
||||
}
|
||||
@@ -732,7 +732,7 @@ static inline flag extractFloatx80Sign(floatx80 a)
|
||||
| extended double-precision floating-point value, returning the result.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
static inline floatx80 packFloatx80(flag zSign, int32_t zExp, uint64_t zSig)
|
||||
static inline floatx80 packFloatx80(bool zSign, int32_t zExp, uint64_t zSig)
|
||||
{
|
||||
floatx80 z;
|
||||
|
||||
@@ -783,7 +783,7 @@ floatx80 propagateFloatx80NaN(floatx80 a, floatx80 b, float_status *status);
|
||||
| Floating-Point Arithmetic.
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
floatx80 roundAndPackFloatx80(int8_t roundingPrecision, flag zSign,
|
||||
floatx80 roundAndPackFloatx80(int8_t roundingPrecision, bool zSign,
|
||||
int32_t zExp, uint64_t zSig0, uint64_t zSig1,
|
||||
float_status *status);
|
||||
|
||||
@@ -797,7 +797,7 @@ floatx80 roundAndPackFloatx80(int8_t roundingPrecision, flag zSign,
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
floatx80 normalizeRoundAndPackFloatx80(int8_t roundingPrecision,
|
||||
flag zSign, int32_t zExp,
|
||||
bool zSign, int32_t zExp,
|
||||
uint64_t zSig0, uint64_t zSig1,
|
||||
float_status *status);
|
||||
|
||||
|
||||
@@ -3201,7 +3201,7 @@ void HELPER(NAME)(void *vd, void *vn, void *vg, void *status, uint32_t desc) \
|
||||
*/
|
||||
static inline float32 sve_f16_to_f32(float16 f, float_status *fpst)
|
||||
{
|
||||
flag save = get_flush_inputs_to_zero(fpst);
|
||||
bool save = get_flush_inputs_to_zero(fpst);
|
||||
float32 ret;
|
||||
|
||||
set_flush_inputs_to_zero(false, fpst);
|
||||
@@ -3212,7 +3212,7 @@ static inline float32 sve_f16_to_f32(float16 f, float_status *fpst)
|
||||
|
||||
static inline float64 sve_f16_to_f64(float16 f, float_status *fpst)
|
||||
{
|
||||
flag save = get_flush_inputs_to_zero(fpst);
|
||||
bool save = get_flush_inputs_to_zero(fpst);
|
||||
float64 ret;
|
||||
|
||||
set_flush_inputs_to_zero(false, fpst);
|
||||
@@ -3223,7 +3223,7 @@ static inline float64 sve_f16_to_f64(float16 f, float_status *fpst)
|
||||
|
||||
static inline float16 sve_f32_to_f16(float32 f, float_status *fpst)
|
||||
{
|
||||
flag save = get_flush_to_zero(fpst);
|
||||
bool save = get_flush_to_zero(fpst);
|
||||
float16 ret;
|
||||
|
||||
set_flush_to_zero(false, fpst);
|
||||
@@ -3234,7 +3234,7 @@ static inline float16 sve_f32_to_f16(float32 f, float_status *fpst)
|
||||
|
||||
static inline float16 sve_f64_to_f16(float64 f, float_status *fpst)
|
||||
{
|
||||
flag save = get_flush_to_zero(fpst);
|
||||
bool save = get_flush_to_zero(fpst);
|
||||
float16 ret;
|
||||
|
||||
set_flush_to_zero(false, fpst);
|
||||
|
||||
@@ -531,7 +531,7 @@ float32 HELPER(vfp_fcvt_f16_to_f32)(uint32_t a, void *fpstp, uint32_t ahp_mode)
|
||||
* it would affect flushing input denormals.
|
||||
*/
|
||||
float_status *fpst = fpstp;
|
||||
flag save = get_flush_inputs_to_zero(fpst);
|
||||
bool save = get_flush_inputs_to_zero(fpst);
|
||||
set_flush_inputs_to_zero(false, fpst);
|
||||
float32 r = float16_to_float32(a, !ahp_mode, fpst);
|
||||
set_flush_inputs_to_zero(save, fpst);
|
||||
@@ -544,7 +544,7 @@ uint32_t HELPER(vfp_fcvt_f32_to_f16)(float32 a, void *fpstp, uint32_t ahp_mode)
|
||||
* it would affect flushing output denormals.
|
||||
*/
|
||||
float_status *fpst = fpstp;
|
||||
flag save = get_flush_to_zero(fpst);
|
||||
bool save = get_flush_to_zero(fpst);
|
||||
set_flush_to_zero(false, fpst);
|
||||
float16 r = float32_to_float16(a, !ahp_mode, fpst);
|
||||
set_flush_to_zero(save, fpst);
|
||||
@@ -557,7 +557,7 @@ float64 HELPER(vfp_fcvt_f16_to_f64)(uint32_t a, void *fpstp, uint32_t ahp_mode)
|
||||
* it would affect flushing input denormals.
|
||||
*/
|
||||
float_status *fpst = fpstp;
|
||||
flag save = get_flush_inputs_to_zero(fpst);
|
||||
bool save = get_flush_inputs_to_zero(fpst);
|
||||
set_flush_inputs_to_zero(false, fpst);
|
||||
float64 r = float16_to_float64(a, !ahp_mode, fpst);
|
||||
set_flush_inputs_to_zero(save, fpst);
|
||||
@@ -570,7 +570,7 @@ uint32_t HELPER(vfp_fcvt_f64_to_f16)(float64 a, void *fpstp, uint32_t ahp_mode)
|
||||
* it would affect flushing output denormals.
|
||||
*/
|
||||
float_status *fpst = fpstp;
|
||||
flag save = get_flush_to_zero(fpst);
|
||||
bool save = get_flush_to_zero(fpst);
|
||||
set_flush_to_zero(false, fpst);
|
||||
float16 r = float64_to_float16(a, !ahp_mode, fpst);
|
||||
set_flush_to_zero(save, fpst);
|
||||
|
||||
+35
-35
@@ -49,7 +49,7 @@ static floatx80 propagateFloatx80NaNOneArg(floatx80 a, float_status *status)
|
||||
|
||||
floatx80 floatx80_mod(floatx80 a, floatx80 b, float_status *status)
|
||||
{
|
||||
flag aSign, zSign;
|
||||
bool aSign, zSign;
|
||||
int32_t aExp, bExp, expDiff;
|
||||
uint64_t aSig0, aSig1, bSig;
|
||||
uint64_t qTemp, term0, term1;
|
||||
@@ -132,7 +132,7 @@ floatx80 floatx80_mod(floatx80 a, floatx80 b, float_status *status)
|
||||
|
||||
floatx80 floatx80_getman(floatx80 a, float_status *status)
|
||||
{
|
||||
flag aSign;
|
||||
bool aSign;
|
||||
int32_t aExp;
|
||||
uint64_t aSig;
|
||||
|
||||
@@ -166,7 +166,7 @@ floatx80 floatx80_getman(floatx80 a, float_status *status)
|
||||
|
||||
floatx80 floatx80_getexp(floatx80 a, float_status *status)
|
||||
{
|
||||
flag aSign;
|
||||
bool aSign;
|
||||
int32_t aExp;
|
||||
uint64_t aSig;
|
||||
|
||||
@@ -202,7 +202,7 @@ floatx80 floatx80_getexp(floatx80 a, float_status *status)
|
||||
|
||||
floatx80 floatx80_scale(floatx80 a, floatx80 b, float_status *status)
|
||||
{
|
||||
flag aSign, bSign;
|
||||
bool aSign, bSign;
|
||||
int32_t aExp, bExp, shiftCount;
|
||||
uint64_t aSig, bSig;
|
||||
|
||||
@@ -258,7 +258,7 @@ floatx80 floatx80_scale(floatx80 a, floatx80 b, float_status *status)
|
||||
|
||||
floatx80 floatx80_move(floatx80 a, float_status *status)
|
||||
{
|
||||
flag aSign;
|
||||
bool aSign;
|
||||
int32_t aExp;
|
||||
uint64_t aSig;
|
||||
|
||||
@@ -306,7 +306,7 @@ static int32_t floatx80_make_compact(int32_t aExp, uint64_t aSig)
|
||||
|
||||
floatx80 floatx80_lognp1(floatx80 a, float_status *status)
|
||||
{
|
||||
flag aSign;
|
||||
bool aSign;
|
||||
int32_t aExp;
|
||||
uint64_t aSig, fSig;
|
||||
|
||||
@@ -505,7 +505,7 @@ floatx80 floatx80_lognp1(floatx80 a, float_status *status)
|
||||
|
||||
floatx80 floatx80_logn(floatx80 a, float_status *status)
|
||||
{
|
||||
flag aSign;
|
||||
bool aSign;
|
||||
int32_t aExp;
|
||||
uint64_t aSig, fSig;
|
||||
|
||||
@@ -673,7 +673,7 @@ floatx80 floatx80_logn(floatx80 a, float_status *status)
|
||||
|
||||
floatx80 floatx80_log10(floatx80 a, float_status *status)
|
||||
{
|
||||
flag aSign;
|
||||
bool aSign;
|
||||
int32_t aExp;
|
||||
uint64_t aSig;
|
||||
|
||||
@@ -730,7 +730,7 @@ floatx80 floatx80_log10(floatx80 a, float_status *status)
|
||||
|
||||
floatx80 floatx80_log2(floatx80 a, float_status *status)
|
||||
{
|
||||
flag aSign;
|
||||
bool aSign;
|
||||
int32_t aExp;
|
||||
uint64_t aSig;
|
||||
|
||||
@@ -797,7 +797,7 @@ floatx80 floatx80_log2(floatx80 a, float_status *status)
|
||||
|
||||
floatx80 floatx80_etox(floatx80 a, float_status *status)
|
||||
{
|
||||
flag aSign;
|
||||
bool aSign;
|
||||
int32_t aExp;
|
||||
uint64_t aSig;
|
||||
|
||||
@@ -805,7 +805,7 @@ floatx80 floatx80_etox(floatx80 a, float_status *status)
|
||||
|
||||
int32_t compact, n, j, k, m, m1;
|
||||
floatx80 fp0, fp1, fp2, fp3, l2, scale, adjscale;
|
||||
flag adjflag;
|
||||
bool adjflag;
|
||||
|
||||
aSig = extractFloatx80Frac(a);
|
||||
aExp = extractFloatx80Exp(a);
|
||||
@@ -981,7 +981,7 @@ floatx80 floatx80_etox(floatx80 a, float_status *status)
|
||||
|
||||
floatx80 floatx80_twotox(floatx80 a, float_status *status)
|
||||
{
|
||||
flag aSign;
|
||||
bool aSign;
|
||||
int32_t aExp;
|
||||
uint64_t aSig;
|
||||
|
||||
@@ -1131,7 +1131,7 @@ floatx80 floatx80_twotox(floatx80 a, float_status *status)
|
||||
|
||||
floatx80 floatx80_tentox(floatx80 a, float_status *status)
|
||||
{
|
||||
flag aSign;
|
||||
bool aSign;
|
||||
int32_t aExp;
|
||||
uint64_t aSig;
|
||||
|
||||
@@ -1286,7 +1286,7 @@ floatx80 floatx80_tentox(floatx80 a, float_status *status)
|
||||
|
||||
floatx80 floatx80_tan(floatx80 a, float_status *status)
|
||||
{
|
||||
flag aSign, xSign;
|
||||
bool aSign, xSign;
|
||||
int32_t aExp, xExp;
|
||||
uint64_t aSig, xSig;
|
||||
|
||||
@@ -1295,7 +1295,7 @@ floatx80 floatx80_tan(floatx80 a, float_status *status)
|
||||
int32_t compact, l, n, j;
|
||||
floatx80 fp0, fp1, fp2, fp3, fp4, fp5, invtwopi, twopi1, twopi2;
|
||||
float32 twoto63;
|
||||
flag endflag;
|
||||
bool endflag;
|
||||
|
||||
aSig = extractFloatx80Frac(a);
|
||||
aExp = extractFloatx80Exp(a);
|
||||
@@ -1344,10 +1344,10 @@ floatx80 floatx80_tan(floatx80 a, float_status *status)
|
||||
xExp -= 0x3FFF;
|
||||
if (xExp <= 28) {
|
||||
l = 0;
|
||||
endflag = 1;
|
||||
endflag = true;
|
||||
} else {
|
||||
l = xExp - 27;
|
||||
endflag = 0;
|
||||
endflag = false;
|
||||
}
|
||||
invtwopi = packFloatx80(0, 0x3FFE - l,
|
||||
UINT64_C(0xA2F9836E4E44152A)); /* INVTWOPI */
|
||||
@@ -1372,7 +1372,7 @@ floatx80 floatx80_tan(floatx80 a, float_status *status)
|
||||
fp1 = floatx80_sub(fp1, fp4, status); /* FP1 is a := r - p */
|
||||
fp0 = floatx80_add(fp0, fp1, status); /* FP0 is R := A+a */
|
||||
|
||||
if (endflag > 0) {
|
||||
if (endflag) {
|
||||
n = floatx80_to_int32(fp2, status);
|
||||
goto tancont;
|
||||
}
|
||||
@@ -1496,7 +1496,7 @@ floatx80 floatx80_tan(floatx80 a, float_status *status)
|
||||
|
||||
floatx80 floatx80_sin(floatx80 a, float_status *status)
|
||||
{
|
||||
flag aSign, xSign;
|
||||
bool aSign, xSign;
|
||||
int32_t aExp, xExp;
|
||||
uint64_t aSig, xSig;
|
||||
|
||||
@@ -1505,7 +1505,7 @@ floatx80 floatx80_sin(floatx80 a, float_status *status)
|
||||
int32_t compact, l, n, j;
|
||||
floatx80 fp0, fp1, fp2, fp3, fp4, fp5, x, invtwopi, twopi1, twopi2;
|
||||
float32 posneg1, twoto63;
|
||||
flag endflag;
|
||||
bool endflag;
|
||||
|
||||
aSig = extractFloatx80Frac(a);
|
||||
aExp = extractFloatx80Exp(a);
|
||||
@@ -1554,10 +1554,10 @@ floatx80 floatx80_sin(floatx80 a, float_status *status)
|
||||
xExp -= 0x3FFF;
|
||||
if (xExp <= 28) {
|
||||
l = 0;
|
||||
endflag = 1;
|
||||
endflag = true;
|
||||
} else {
|
||||
l = xExp - 27;
|
||||
endflag = 0;
|
||||
endflag = false;
|
||||
}
|
||||
invtwopi = packFloatx80(0, 0x3FFE - l,
|
||||
UINT64_C(0xA2F9836E4E44152A)); /* INVTWOPI */
|
||||
@@ -1582,7 +1582,7 @@ floatx80 floatx80_sin(floatx80 a, float_status *status)
|
||||
fp1 = floatx80_sub(fp1, fp4, status); /* FP1 is a := r - p */
|
||||
fp0 = floatx80_add(fp0, fp1, status); /* FP0 is R := A+a */
|
||||
|
||||
if (endflag > 0) {
|
||||
if (endflag) {
|
||||
n = floatx80_to_int32(fp2, status);
|
||||
goto sincont;
|
||||
}
|
||||
@@ -1735,7 +1735,7 @@ floatx80 floatx80_sin(floatx80 a, float_status *status)
|
||||
|
||||
floatx80 floatx80_cos(floatx80 a, float_status *status)
|
||||
{
|
||||
flag aSign, xSign;
|
||||
bool aSign, xSign;
|
||||
int32_t aExp, xExp;
|
||||
uint64_t aSig, xSig;
|
||||
|
||||
@@ -1744,7 +1744,7 @@ floatx80 floatx80_cos(floatx80 a, float_status *status)
|
||||
int32_t compact, l, n, j;
|
||||
floatx80 fp0, fp1, fp2, fp3, fp4, fp5, x, invtwopi, twopi1, twopi2;
|
||||
float32 posneg1, twoto63;
|
||||
flag endflag;
|
||||
bool endflag;
|
||||
|
||||
aSig = extractFloatx80Frac(a);
|
||||
aExp = extractFloatx80Exp(a);
|
||||
@@ -1793,10 +1793,10 @@ floatx80 floatx80_cos(floatx80 a, float_status *status)
|
||||
xExp -= 0x3FFF;
|
||||
if (xExp <= 28) {
|
||||
l = 0;
|
||||
endflag = 1;
|
||||
endflag = true;
|
||||
} else {
|
||||
l = xExp - 27;
|
||||
endflag = 0;
|
||||
endflag = false;
|
||||
}
|
||||
invtwopi = packFloatx80(0, 0x3FFE - l,
|
||||
UINT64_C(0xA2F9836E4E44152A)); /* INVTWOPI */
|
||||
@@ -1821,7 +1821,7 @@ floatx80 floatx80_cos(floatx80 a, float_status *status)
|
||||
fp1 = floatx80_sub(fp1, fp4, status); /* FP1 is a := r - p */
|
||||
fp0 = floatx80_add(fp0, fp1, status); /* FP0 is R := A+a */
|
||||
|
||||
if (endflag > 0) {
|
||||
if (endflag) {
|
||||
n = floatx80_to_int32(fp2, status);
|
||||
goto sincont;
|
||||
}
|
||||
@@ -1972,7 +1972,7 @@ floatx80 floatx80_cos(floatx80 a, float_status *status)
|
||||
|
||||
floatx80 floatx80_atan(floatx80 a, float_status *status)
|
||||
{
|
||||
flag aSign;
|
||||
bool aSign;
|
||||
int32_t aExp;
|
||||
uint64_t aSig;
|
||||
|
||||
@@ -2169,7 +2169,7 @@ floatx80 floatx80_atan(floatx80 a, float_status *status)
|
||||
|
||||
floatx80 floatx80_asin(floatx80 a, float_status *status)
|
||||
{
|
||||
flag aSign;
|
||||
bool aSign;
|
||||
int32_t aExp;
|
||||
uint64_t aSig;
|
||||
|
||||
@@ -2234,7 +2234,7 @@ floatx80 floatx80_asin(floatx80 a, float_status *status)
|
||||
|
||||
floatx80 floatx80_acos(floatx80 a, float_status *status)
|
||||
{
|
||||
flag aSign;
|
||||
bool aSign;
|
||||
int32_t aExp;
|
||||
uint64_t aSig;
|
||||
|
||||
@@ -2303,7 +2303,7 @@ floatx80 floatx80_acos(floatx80 a, float_status *status)
|
||||
|
||||
floatx80 floatx80_atanh(floatx80 a, float_status *status)
|
||||
{
|
||||
flag aSign;
|
||||
bool aSign;
|
||||
int32_t aExp;
|
||||
uint64_t aSig;
|
||||
|
||||
@@ -2368,7 +2368,7 @@ floatx80 floatx80_atanh(floatx80 a, float_status *status)
|
||||
|
||||
floatx80 floatx80_etoxm1(floatx80 a, float_status *status)
|
||||
{
|
||||
flag aSign;
|
||||
bool aSign;
|
||||
int32_t aExp;
|
||||
uint64_t aSig;
|
||||
|
||||
@@ -2620,7 +2620,7 @@ floatx80 floatx80_etoxm1(floatx80 a, float_status *status)
|
||||
|
||||
floatx80 floatx80_tanh(floatx80 a, float_status *status)
|
||||
{
|
||||
flag aSign, vSign;
|
||||
bool aSign, vSign;
|
||||
int32_t aExp, vExp;
|
||||
uint64_t aSig, vSig;
|
||||
|
||||
@@ -2735,7 +2735,7 @@ floatx80 floatx80_tanh(floatx80 a, float_status *status)
|
||||
|
||||
floatx80 floatx80_sinh(floatx80 a, float_status *status)
|
||||
{
|
||||
flag aSign;
|
||||
bool aSign;
|
||||
int32_t aExp;
|
||||
uint64_t aSig;
|
||||
|
||||
|
||||
@@ -5508,7 +5508,7 @@ static inline int get_enabled_exceptions(const CPUMIPSState *env, int c)
|
||||
return c & enable;
|
||||
}
|
||||
|
||||
static inline float16 float16_from_float32(int32_t a, flag ieee,
|
||||
static inline float16 float16_from_float32(int32_t a, bool ieee,
|
||||
float_status *status)
|
||||
{
|
||||
float16 f_val;
|
||||
@@ -5527,7 +5527,7 @@ static inline float32 float32_from_float64(int64_t a, float_status *status)
|
||||
return a < 0 ? (f_val | (1 << 31)) : f_val;
|
||||
}
|
||||
|
||||
static inline float32 float32_from_float16(int16_t a, flag ieee,
|
||||
static inline float32 float32_from_float16(int16_t a, bool ieee,
|
||||
float_status *status)
|
||||
{
|
||||
float32 f_val;
|
||||
@@ -6564,7 +6564,7 @@ void helper_msa_fexdo_df(CPUMIPSState *env, uint32_t df, uint32_t wd,
|
||||
* IEEE and "ARM" format. The latter gains extra exponent
|
||||
* range by omitting the NaN/Inf encodings.
|
||||
*/
|
||||
flag ieee = 1;
|
||||
bool ieee = true;
|
||||
|
||||
MSA_FLOAT_BINOP(Lh(pwx, i), from_float32, pws->w[i], ieee, 16);
|
||||
MSA_FLOAT_BINOP(Rh(pwx, i), from_float32, pwt->w[i], ieee, 16);
|
||||
@@ -7178,7 +7178,7 @@ void helper_msa_fexupl_df(CPUMIPSState *env, uint32_t df, uint32_t wd,
|
||||
* IEEE and "ARM" format. The latter gains extra exponent
|
||||
* range by omitting the NaN/Inf encodings.
|
||||
*/
|
||||
flag ieee = 1;
|
||||
bool ieee = true;
|
||||
|
||||
MSA_FLOAT_BINOP(pwx->w[i], from_float16, Lh(pws, i), ieee, 32);
|
||||
}
|
||||
@@ -7214,7 +7214,7 @@ void helper_msa_fexupr_df(CPUMIPSState *env, uint32_t df, uint32_t wd,
|
||||
* IEEE and "ARM" format. The latter gains extra exponent
|
||||
* range by omitting the NaN/Inf encodings.
|
||||
*/
|
||||
flag ieee = 1;
|
||||
bool ieee = true;
|
||||
|
||||
MSA_FLOAT_BINOP(pwx->w[i], from_float16, Rh(pws, i), ieee, 32);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user