[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 027/102] target/ppc: Update float_invalid_op_addsub for new flags
From: |
Cédric Le Goater |
Subject: |
[PULL 027/102] target/ppc: Update float_invalid_op_addsub for new flags |
Date: |
Wed, 15 Dec 2021 18:02:42 +0100 |
From: Richard Henderson <richard.henderson@linaro.org>
Now that vxisi 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-9-richard.henderson@linaro.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
target/ppc/fpu_helper.c | 38 ++++++++++++++------------------------
1 file changed, 14 insertions(+), 24 deletions(-)
diff --git a/target/ppc/fpu_helper.c b/target/ppc/fpu_helper.c
index bb72715827c3..d8ad0250bccd 100644
--- a/target/ppc/fpu_helper.c
+++ b/target/ppc/fpu_helper.c
@@ -498,13 +498,12 @@ void helper_reset_fpstatus(CPUPPCState *env)
set_float_exception_flags(0, &env->fp_status);
}
-static void float_invalid_op_addsub(CPUPPCState *env, bool set_fpcc,
- uintptr_t retaddr, int classes)
+static void float_invalid_op_addsub(CPUPPCState *env, int flags,
+ bool set_fpcc, uintptr_t retaddr)
{
- if ((classes & ~is_neg) == is_inf) {
- /* Magnitude subtraction of infinities */
+ if (flags & float_flag_invalid_isi) {
float_invalid_op_vxisi(env, set_fpcc, retaddr);
- } else if (classes & is_snan) {
+ } else if (flags & float_flag_invalid_snan) {
float_invalid_op_vxsnan(env, retaddr);
}
}
@@ -513,12 +512,10 @@ static void float_invalid_op_addsub(CPUPPCState *env,
bool set_fpcc,
float64 helper_fadd(CPUPPCState *env, float64 arg1, float64 arg2)
{
float64 ret = float64_add(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)) {
- float_invalid_op_addsub(env, 1, GETPC(),
- float64_classify(arg1) |
- float64_classify(arg2));
+ if (unlikely(flags & float_flag_invalid)) {
+ float_invalid_op_addsub(env, flags, 1, GETPC());
}
return ret;
@@ -528,12 +525,10 @@ float64 helper_fadd(CPUPPCState *env, float64 arg1,
float64 arg2)
float64 helper_fsub(CPUPPCState *env, float64 arg1, float64 arg2)
{
float64 ret = float64_sub(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)) {
- float_invalid_op_addsub(env, 1, GETPC(),
- float64_classify(arg1) |
- float64_classify(arg2));
+ if (unlikely(flags & float_flag_invalid)) {
+ float_invalid_op_addsub(env, flags, 1, GETPC());
}
return ret;
@@ -1664,9 +1659,8 @@ void helper_##name(CPUPPCState *env, ppc_vsr_t *xt,
\
env->fp_status.float_exception_flags |= tstat.float_exception_flags; \
\
if (unlikely(tstat.float_exception_flags & float_flag_invalid)) { \
- float_invalid_op_addsub(env, sfprf, GETPC(), \
- tp##_classify(xa->fld) | \
- tp##_classify(xb->fld)); \
+ float_invalid_op_addsub(env, tstat.float_exception_flags, \
+ sfprf, GETPC()); \
} \
\
if (r2sp) { \
@@ -1708,9 +1702,7 @@ void helper_xsaddqp(CPUPPCState *env, uint32_t opcode,
env->fp_status.float_exception_flags |= tstat.float_exception_flags;
if (unlikely(tstat.float_exception_flags & float_flag_invalid)) {
- float_invalid_op_addsub(env, 1, GETPC(),
- float128_classify(xa->f128) |
- float128_classify(xb->f128));
+ float_invalid_op_addsub(env, tstat.float_exception_flags, 1, GETPC());
}
helper_compute_fprf_float128(env, t.f128);
@@ -3326,9 +3318,7 @@ void helper_xssubqp(CPUPPCState *env, uint32_t opcode,
env->fp_status.float_exception_flags |= tstat.float_exception_flags;
if (unlikely(tstat.float_exception_flags & float_flag_invalid)) {
- float_invalid_op_addsub(env, 1, GETPC(),
- float128_classify(xa->f128) |
- float128_classify(xb->f128));
+ float_invalid_op_addsub(env, tstat.float_exception_flags, 1, GETPC());
}
helper_compute_fprf_float128(env, t.f128);
--
2.31.1
- [PULL 013/102] ppc/pnv.c: add a friendly warning when accel=kvm is used, (continued)
- [PULL 013/102] ppc/pnv.c: add a friendly warning when accel=kvm is used, Cédric Le Goater, 2021/12/15
- [PULL 014/102] docs/system/ppc/powernv.rst: document KVM support status, Cédric Le Goater, 2021/12/15
- [PULL 018/102] docs: Rename ppc-spapr-hcalls.txt to ppc-spapr-hcalls.rst., Cédric Le Goater, 2021/12/15
- [PULL 019/102] Link new ppc-spapr-hcalls.rst file to pseries.rst., Cédric Le Goater, 2021/12/15
- [PULL 015/102] ppc/pnv.c: fix "system-id" FDT when -uuid is set, Cédric Le Goater, 2021/12/15
- [PULL 016/102] docs: Introducing pseries documentation., Cédric Le Goater, 2021/12/15
- [PULL 026/102] softfloat: Add flag specific to signaling nans, Cédric Le Goater, 2021/12/15
- [PULL 021/102] softfloat: Add flag specific to Inf - Inf, Cédric Le Goater, 2021/12/15
- [PULL 023/102] softfloat: Add flags specific to Inf / Inf and 0 / 0, Cédric Le Goater, 2021/12/15
- [PULL 025/102] softfloat: Add flag specific to convert non-nan to int, Cédric Le Goater, 2021/12/15
- [PULL 027/102] target/ppc: Update float_invalid_op_addsub for new flags,
Cédric Le Goater <=
- [PULL 022/102] softfloat: Add flag specific to Inf * 0, Cédric Le Goater, 2021/12/15
- [PULL 017/102] docs: rSTify ppc-spapr-hcalls.txt, Cédric Le Goater, 2021/12/15
- [PULL 028/102] target/ppc: Update float_invalid_op_mul for new flags, Cédric Le Goater, 2021/12/15
- [PULL 037/102] target/ppc: Update fmadd for new flags, Cédric Le Goater, 2021/12/15
- [PULL 024/102] softfloat: Add flag specific to sqrt(-x), Cédric Le Goater, 2021/12/15
- [PULL 031/102] target/ppc: Update float_invalid_cvt for new flags, Cédric Le Goater, 2021/12/15
- [PULL 041/102] target/ppc: Update do_frsp for new flags, Cédric Le Goater, 2021/12/15
- [PULL 020/102] softfloat: Extend float_exception_flags to 16 bits, Cédric Le Goater, 2021/12/15
- [PULL 035/102] target/ppc: Tidy inexact handling in do_fri, Cédric Le Goater, 2021/12/15
- [PULL 044/102] target/ppc: Update xsrqpi and xsrqpxp to new flags, Cédric Le Goater, 2021/12/15