target/ppc: Update float_invalid_op_mul for new flags

Now that vximz and vxsnan are computed directly by
softfloat, we don't need to recompute it via classes.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20211119160502.17432-10-richard.henderson@linaro.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
This commit is contained in:
Richard Henderson 2021-12-17 17:57:14 +01:00 committed by Cédric Le Goater
parent 941298ecd7
commit 4edf55698f

View File

@ -534,13 +534,12 @@ float64 helper_fsub(CPUPPCState *env, float64 arg1, float64 arg2)
return ret; return ret;
} }
static void float_invalid_op_mul(CPUPPCState *env, bool set_fprc, static void float_invalid_op_mul(CPUPPCState *env, int flags,
uintptr_t retaddr, int classes) bool set_fprc, uintptr_t retaddr)
{ {
if ((classes & (is_zero | is_inf)) == (is_zero | is_inf)) { if (flags & float_flag_invalid_imz) {
/* Multiplication of zero by infinity */
float_invalid_op_vximz(env, set_fprc, retaddr); float_invalid_op_vximz(env, set_fprc, retaddr);
} else if (classes & is_snan) { } else if (flags & float_flag_invalid_snan) {
float_invalid_op_vxsnan(env, retaddr); float_invalid_op_vxsnan(env, retaddr);
} }
} }
@ -549,12 +548,10 @@ static void float_invalid_op_mul(CPUPPCState *env, bool set_fprc,
float64 helper_fmul(CPUPPCState *env, float64 arg1, float64 arg2) float64 helper_fmul(CPUPPCState *env, float64 arg1, float64 arg2)
{ {
float64 ret = float64_mul(arg1, arg2, &env->fp_status); float64 ret = float64_mul(arg1, arg2, &env->fp_status);
int status = get_float_exception_flags(&env->fp_status); int flags = get_float_exception_flags(&env->fp_status);
if (unlikely(status & float_flag_invalid)) { if (unlikely(flags & float_flag_invalid)) {
float_invalid_op_mul(env, 1, GETPC(), float_invalid_op_mul(env, flags, 1, GETPC());
float64_classify(arg1) |
float64_classify(arg2));
} }
return ret; return ret;
@ -1735,9 +1732,8 @@ void helper_##op(CPUPPCState *env, ppc_vsr_t *xt, \
env->fp_status.float_exception_flags |= tstat.float_exception_flags; \ env->fp_status.float_exception_flags |= tstat.float_exception_flags; \
\ \
if (unlikely(tstat.float_exception_flags & float_flag_invalid)) { \ if (unlikely(tstat.float_exception_flags & float_flag_invalid)) { \
float_invalid_op_mul(env, sfprf, GETPC(), \ float_invalid_op_mul(env, tstat.float_exception_flags, \
tp##_classify(xa->fld) | \ sfprf, GETPC()); \
tp##_classify(xb->fld)); \
} \ } \
\ \
if (r2sp) { \ if (r2sp) { \
@ -1775,9 +1771,7 @@ void helper_xsmulqp(CPUPPCState *env, uint32_t opcode,
env->fp_status.float_exception_flags |= tstat.float_exception_flags; env->fp_status.float_exception_flags |= tstat.float_exception_flags;
if (unlikely(tstat.float_exception_flags & float_flag_invalid)) { if (unlikely(tstat.float_exception_flags & float_flag_invalid)) {
float_invalid_op_mul(env, 1, GETPC(), float_invalid_op_mul(env, tstat.float_exception_flags, 1, GETPC());
float128_classify(xa->f128) |
float128_classify(xb->f128));
} }
helper_compute_fprf_float128(env, t.f128); helper_compute_fprf_float128(env, t.f128);