[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 030/101] target/ppc: Move float_check_status from FPU_FCTI to tran
From: |
Cédric Le Goater |
Subject: |
[PULL 030/101] target/ppc: Move float_check_status from FPU_FCTI to translate |
Date: |
Thu, 16 Dec 2021 21:25:03 +0100 |
From: Richard Henderson <richard.henderson@linaro.org>
Fixes a bug in which e.g XE enabled causes inexact to be raised
before the writeback to the architectural register.
All of the users of GEN_FLOAT_B either set set_fprf, or are one
of the convert-to-integer instructions that require this behaviour.
Split out the two gen_helper_* calls in gen_compute_fprf_float64
and protect only the first with set_fprf.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20211119160502.17432-12-richard.henderson@linaro.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
target/ppc/fpu_helper.c | 9 +++------
target/ppc/translate/fp-impl.c.inc | 3 ++-
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/target/ppc/fpu_helper.c b/target/ppc/fpu_helper.c
index 9bcd7abd165f..f453b0475116 100644
--- a/target/ppc/fpu_helper.c
+++ b/target/ppc/fpu_helper.c
@@ -600,12 +600,9 @@ 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); \
\
- if (unlikely(status)) { \
- if (status & float_flag_invalid) { \
- float_invalid_cvt(env, 1, GETPC(), float64_classify(arg)); \
- ret = nanval; \
- } \
- do_float_check_status(env, GETPC()); \
+ if (unlikely(status & float_flag_invalid)) { \
+ float_invalid_cvt(env, 1, GETPC(), float64_classify(arg)); \
+ ret = nanval; \
} \
return ret; \
}
diff --git a/target/ppc/translate/fp-impl.c.inc
b/target/ppc/translate/fp-impl.c.inc
index 8afd6a087d1d..0767e45d87d8 100644
--- a/target/ppc/translate/fp-impl.c.inc
+++ b/target/ppc/translate/fp-impl.c.inc
@@ -157,8 +157,9 @@ static void gen_f##name(DisasContext *ctx)
\
gen_helper_f##name(t1, cpu_env, t0); \
set_fpr(rD(ctx->opcode), t1); \
if (set_fprf) { \
- gen_compute_fprf_float64(t1); \
+ gen_helper_compute_fprf_float64(cpu_env, t1); \
} \
+ gen_helper_float_check_status(cpu_env); \
if (unlikely(Rc(ctx->opcode) != 0)) { \
gen_set_cr1_from_fpscr(ctx); \
} \
--
2.31.1
- [PULL 015/101] ppc/pnv.c: fix "system-id" FDT when -uuid is set, (continued)
- [PULL 015/101] ppc/pnv.c: fix "system-id" FDT when -uuid is set, Cédric Le Goater, 2021/12/16
- [PULL 020/101] softfloat: Extend float_exception_flags to 16 bits, Cédric Le Goater, 2021/12/16
- [PULL 031/101] target/ppc: Update float_invalid_cvt for new flags, Cédric Le Goater, 2021/12/16
- [PULL 013/101] ppc/pnv.c: add a friendly warning when accel=kvm is used, Cédric Le Goater, 2021/12/16
- [PULL 017/101] docs: rSTify ppc-spapr-hcalls.txt, Cédric Le Goater, 2021/12/16
- [PULL 039/101] target/ppc: Do not call do_float_check_status from do_fmadd, Cédric Le Goater, 2021/12/16
- [PULL 016/101] docs: Introducing pseries documentation., Cédric Le Goater, 2021/12/16
- [PULL 021/101] softfloat: Add flag specific to Inf - Inf, Cédric Le Goater, 2021/12/16
- [PULL 035/101] target/ppc: Tidy inexact handling in do_fri, Cédric Le Goater, 2021/12/16
- [PULL 024/101] softfloat: Add flag specific to sqrt(-x), Cédric Le Goater, 2021/12/16
- [PULL 030/101] target/ppc: Move float_check_status from FPU_FCTI to translate,
Cédric Le Goater <=
- [PULL 034/101] target/ppc: Use FloatRoundMode in do_fri, Cédric Le Goater, 2021/12/16
- [PULL 037/101] target/ppc: Update fmadd for new flags, Cédric Le Goater, 2021/12/16
- [PULL 029/101] target/ppc: Update float_invalid_op_div for new flags, Cédric Le Goater, 2021/12/16
- [PULL 033/101] target/ppc: Remove inline from do_fri, Cédric Le Goater, 2021/12/16
- [PULL 036/101] target/ppc: Clean up do_fri, Cédric Le Goater, 2021/12/16
- [PULL 056/101] target/ppc: Remove the software TLB model of 7450 CPUs, Cédric Le Goater, 2021/12/16
- [PULL 049/101] target/ppc: Add helpers for fadds, fsubs, fdivs, Cédric Le Goater, 2021/12/16
- [PULL 048/101] target/ppc: Add helper for fsqrts, Cédric Le Goater, 2021/12/16
- [PULL 051/101] target/ppc: Add helper for frsqrtes, Cédric Le Goater, 2021/12/16
- [PULL 046/101] softfloat: Add float64r32 arithmetic routines, Cédric Le Goater, 2021/12/16