aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2020-05-04 19:54:57 -0700
committerRichard Henderson <richard.henderson@linaro.org>2020-05-19 08:40:50 -0700
commitc120391c0090d9c40425c92cdb00f38ea8588ff6 (patch)
tree57a5bd58a1b4547686c308f2eed8f5f62048a3de /target
parentb240c9c497b9880ac0ba29465907d5ebecd48083 (diff)
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>
Diffstat (limited to 'target')
-rw-r--r--target/arm/sve_helper.c8
-rw-r--r--target/arm/vfp_helper.c8
-rw-r--r--target/m68k/softfloat.c70
-rw-r--r--target/mips/msa_helper.c10
4 files changed, 48 insertions, 48 deletions
diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c
index 0da254d402..e590db6637 100644
--- a/target/arm/sve_helper.c
+++ b/target/arm/sve_helper.c
@@ -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);
diff --git a/target/arm/vfp_helper.c b/target/arm/vfp_helper.c
index 88483d4066..42625747d1 100644
--- a/target/arm/vfp_helper.c
+++ b/target/arm/vfp_helper.c
@@ -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);
diff --git a/target/m68k/softfloat.c b/target/m68k/softfloat.c
index 24c313ed69..9f120cf15e 100644
--- a/target/m68k/softfloat.c
+++ b/target/m68k/softfloat.c
@@ -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;
diff --git a/target/mips/msa_helper.c b/target/mips/msa_helper.c
index 4065cfe4f7..3c7012c0b8 100644
--- a/target/mips/msa_helper.c
+++ b/target/mips/msa_helper.c
@@ -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);
}