aboutsummaryrefslogtreecommitdiff
path: root/target/ppc/fpu_helper.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2021-12-17 17:57:15 +0100
committerCédric Le Goater <clg@kaod.org>2021-12-17 17:57:15 +0100
commit8ea0b1408e680ecd08a48c51fb1e4d0ec8cbdc15 (patch)
tree46bef947483be6df4d97aa06a66558daae81fb33 /target/ppc/fpu_helper.c
parent053e23a6942bc3208fff4a097483d4afce79a1ee (diff)
downloadqemu-8ea0b1408e680ecd08a48c51fb1e4d0ec8cbdc15.zip
qemu-8ea0b1408e680ecd08a48c51fb1e4d0ec8cbdc15.tar.gz
qemu-8ea0b1408e680ecd08a48c51fb1e4d0ec8cbdc15.tar.bz2
target/ppc: Update fre to new flags
Use float_flag_invalid_snan instead of recomputing the snan-ness of the operand. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20211119160502.17432-27-richard.henderson@linaro.org> Signed-off-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to 'target/ppc/fpu_helper.c')
-rw-r--r--target/ppc/fpu_helper.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/target/ppc/fpu_helper.c b/target/ppc/fpu_helper.c
index 853e0aa..aef81a8 100644
--- a/target/ppc/fpu_helper.c
+++ b/target/ppc/fpu_helper.c
@@ -765,20 +765,15 @@ float64 helper_fre(CPUPPCState *env, float64 arg)
{
/* "Estimate" the reciprocal with actual division. */
float64 ret = float64_div(float64_one, arg, &env->fp_status);
- int status = get_float_exception_flags(&env->fp_status);
+ int flags = get_float_exception_flags(&env->fp_status);
- if (unlikely(status)) {
- if (status & float_flag_invalid) {
- if (float64_is_signaling_nan(arg, &env->fp_status)) {
- /* sNaN reciprocal */
- float_invalid_op_vxsnan(env, GETPC());
- }
- }
- if (status & float_flag_divbyzero) {
- float_zero_divide_excp(env, GETPC());
- /* For FPSCR.ZE == 0, the result is 1/2. */
- ret = float64_set_sign(float64_half, float64_is_neg(arg));
- }
+ if (unlikely(flags & float_flag_invalid_snan)) {
+ float_invalid_op_vxsnan(env, GETPC());
+ }
+ if (unlikely(flags & float_flag_divbyzero)) {
+ float_zero_divide_excp(env, GETPC());
+ /* For FPSCR.ZE == 0, the result is 1/2. */
+ ret = float64_set_sign(float64_half, float64_is_neg(arg));
}
return ret;