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>
This commit is contained in:
parent
053e23a694
commit
8ea0b1408e
|
@ -765,20 +765,15 @@ float64 helper_fre(CPUPPCState *env, float64 arg)
|
||||||
{
|
{
|
||||||
/* "Estimate" the reciprocal with actual division. */
|
/* "Estimate" the reciprocal with actual division. */
|
||||||
float64 ret = float64_div(float64_one, arg, &env->fp_status);
|
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 (unlikely(flags & float_flag_invalid_snan)) {
|
||||||
if (status & float_flag_invalid) {
|
float_invalid_op_vxsnan(env, GETPC());
|
||||||
if (float64_is_signaling_nan(arg, &env->fp_status)) {
|
}
|
||||||
/* sNaN reciprocal */
|
if (unlikely(flags & float_flag_divbyzero)) {
|
||||||
float_invalid_op_vxsnan(env, GETPC());
|
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 (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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue