[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 12/35] target/ppc: Update float_invalid_cvt for new flags
From: |
Richard Henderson |
Subject: |
[PATCH 12/35] target/ppc: Update float_invalid_cvt for new flags |
Date: |
Fri, 19 Nov 2021 17:04:39 +0100 |
Now that vxsnan is computed directly by softfloat,
we don't need to recompute it via classes.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/ppc/fpu_helper.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/target/ppc/fpu_helper.c b/target/ppc/fpu_helper.c
index 0d58fd82a6..6b8367a105 100644
--- a/target/ppc/fpu_helper.c
+++ b/target/ppc/fpu_helper.c
@@ -537,11 +537,11 @@ float64 helper_fdiv(CPUPPCState *env, float64 arg1,
float64 arg2)
return ret;
}
-static void float_invalid_cvt(CPUPPCState *env, bool set_fprc,
- uintptr_t retaddr, int class1)
+static void float_invalid_cvt(CPUPPCState *env, int flags,
+ bool set_fprc, uintptr_t retaddr)
{
float_invalid_op_vxcvi(env, set_fprc, retaddr);
- if (class1 & is_snan) {
+ if (flags & float_flag_invalid_snan) {
float_invalid_op_vxsnan(env, retaddr);
}
}
@@ -550,10 +550,10 @@ static void float_invalid_cvt(CPUPPCState *env, bool
set_fprc,
uint64_t helper_##op(CPUPPCState *env, float64 arg) \
{ \
uint64_t ret = float64_to_##cvt(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 & float_flag_invalid)) { \
- float_invalid_cvt(env, 1, GETPC(), float64_classify(arg)); \
+ if (unlikely(flags & float_flag_invalid)) { \
+ float_invalid_cvt(env, flags, 1, GETPC()); \
ret = nanval; \
} \
return ret; \
@@ -2746,7 +2746,7 @@ void helper_##op(CPUPPCState *env, ppc_vsr_t *xt,
ppc_vsr_t *xb) \
t.tfld = stp##_to_##ttp##_round_to_zero(xb->sfld, &env->fp_status); \
flags = env->fp_status.float_exception_flags; \
if (unlikely(flags & float_flag_invalid)) { \
- float_invalid_cvt(env, 0, GETPC(), stp##_classify(xb->sfld)); \
+ float_invalid_cvt(env, flags, 0, GETPC()); \
t.tfld = rnan; \
} \
all_flags |= flags; \
@@ -2789,10 +2789,12 @@ void helper_##op(CPUPPCState *env, uint32_t opcode,
\
ppc_vsr_t *xt, ppc_vsr_t *xb) \
{ \
ppc_vsr_t t = { }; \
+ int flags; \
\
t.tfld = stp##_to_##ttp##_round_to_zero(xb->sfld, &env->fp_status); \
- if (env->fp_status.float_exception_flags & float_flag_invalid) { \
- float_invalid_cvt(env, 0, GETPC(), stp##_classify(xb->sfld)); \
+ flags = get_float_exception_flags(&env->fp_status); \
+ if (flags & float_flag_invalid) { \
+ float_invalid_cvt(env, flags, 0, GETPC()); \
t.tfld = rnan; \
} \
\
--
2.25.1
- [PATCH 04/35] softfloat: Add flags specific to Inf / Inf and 0 / 0, (continued)
- [PATCH 04/35] softfloat: Add flags specific to Inf / Inf and 0 / 0, Richard Henderson, 2021/11/19
- [PATCH 02/35] softfloat: Add flag specific to Inf - Inf, Richard Henderson, 2021/11/19
- [PATCH 03/35] softfloat: Add flag specific to Inf * 0, Richard Henderson, 2021/11/19
- [PATCH 07/35] softfloat: Add flag specific to signaling nans, Richard Henderson, 2021/11/19
- [PATCH 08/35] target/ppc: Update float_invalid_op_addsub for new flags, Richard Henderson, 2021/11/19
- [PATCH 05/35] softfloat: Add flag specific to sqrt(-x), Richard Henderson, 2021/11/19
- [PATCH 06/35] softfloat: Add flag specific to convert non-nan to int, Richard Henderson, 2021/11/19
- [PATCH 10/35] target/ppc: Update float_invalid_op_div for new flags, Richard Henderson, 2021/11/19
- [PATCH 11/35] target/ppc: Move float_check_status from FPU_FCTI to translate, Richard Henderson, 2021/11/19
- [PATCH 09/35] target/ppc: Update float_invalid_op_mul for new flags, Richard Henderson, 2021/11/19
- [PATCH 12/35] target/ppc: Update float_invalid_cvt for new flags,
Richard Henderson <=
- [PATCH 15/35] target/ppc: Use FloatRoundMode in do_fri, Richard Henderson, 2021/11/19
- [PATCH 16/35] target/ppc: Tidy inexact handling in do_fri, Richard Henderson, 2021/11/19
- [PATCH 17/35] target/ppc: Clean up do_fri, Richard Henderson, 2021/11/19
- [PATCH 18/35] target/ppc: Update fmadd for new flags, Richard Henderson, 2021/11/19
- [PATCH 13/35] target/ppc: Fix VXCVI return value, Richard Henderson, 2021/11/19
- [PATCH 14/35] target/ppc: Remove inline from do_fri, Richard Henderson, 2021/11/19
- [PATCH 19/35] target/ppc: Split out do_fmadd, Richard Henderson, 2021/11/19
- [PATCH 20/35] target/ppc: Do not call do_float_check_status from do_fmadd, Richard Henderson, 2021/11/19
- [PATCH 21/35] target/ppc: Split out do_frsp, Richard Henderson, 2021/11/19
- [PATCH 23/35] target/ppc: Use helper_todouble in do_frsp, Richard Henderson, 2021/11/19