summaryrefslogtreecommitdiffstats
path: root/fpu
diff options
context:
space:
mode:
authorRichard Henderson2021-12-17 17:57:14 +0100
committerCédric Le Goater2021-12-17 17:57:14 +0100
commit81254b02eb2a551d7794d542cbdff03e8349355e (patch)
tree7a9f059810987d830479692524bb94b7a4760a8a /fpu
parentsoftfloat: Add flag specific to sqrt(-x) (diff)
downloadqemu-81254b02eb2a551d7794d542cbdff03e8349355e.tar.gz
qemu-81254b02eb2a551d7794d542cbdff03e8349355e.tar.xz
qemu-81254b02eb2a551d7794d542cbdff03e8349355e.zip
softfloat: Add flag specific to convert non-nan to int
PowerPC has this flag, and it's easier to compute it here than after the fact. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20211119160502.17432-7-richard.henderson@linaro.org> Signed-off-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to 'fpu')
-rw-r--r--fpu/softfloat-parts.c.inc14
1 files changed, 7 insertions, 7 deletions
diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc
index cc8c2c3aee..ce580347dd 100644
--- a/fpu/softfloat-parts.c.inc
+++ b/fpu/softfloat-parts.c.inc
@@ -1055,7 +1055,7 @@ static int64_t partsN(float_to_sint)(FloatPartsN *p, FloatRoundMode rmode,
break;
case float_class_inf:
- flags = float_flag_invalid;
+ flags = float_flag_invalid | float_flag_invalid_cvti;
r = p->sign ? min : max;
break;
@@ -1077,11 +1077,11 @@ static int64_t partsN(float_to_sint)(FloatPartsN *p, FloatRoundMode rmode,
if (r <= -(uint64_t)min) {
r = -r;
} else {
- flags = float_flag_invalid;
+ flags = float_flag_invalid | float_flag_invalid_cvti;
r = min;
}
} else if (r > max) {
- flags = float_flag_invalid;
+ flags = float_flag_invalid | float_flag_invalid_cvti;
r = max;
}
break;
@@ -1120,7 +1120,7 @@ static uint64_t partsN(float_to_uint)(FloatPartsN *p, FloatRoundMode rmode,
break;
case float_class_inf:
- flags = float_flag_invalid;
+ flags = float_flag_invalid | float_flag_invalid_cvti;
r = p->sign ? 0 : max;
break;
@@ -1138,15 +1138,15 @@ static uint64_t partsN(float_to_uint)(FloatPartsN *p, FloatRoundMode rmode,
}
if (p->sign) {
- flags = float_flag_invalid;
+ flags = float_flag_invalid | float_flag_invalid_cvti;
r = 0;
} else if (p->exp > DECOMPOSED_BINARY_POINT) {
- flags = float_flag_invalid;
+ flags = float_flag_invalid | float_flag_invalid_cvti;
r = max;
} else {
r = p->frac_hi >> (DECOMPOSED_BINARY_POINT - p->exp);
if (r > max) {
- flags = float_flag_invalid;
+ flags = float_flag_invalid | float_flag_invalid_cvti;
r = max;
}
}