[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 39/72] target/arm: Copy entire float_status in is_ebf
From: |
Peter Maydell |
Subject: |
[PULL 39/72] target/arm: Copy entire float_status in is_ebf |
Date: |
Wed, 11 Dec 2024 16:19:31 +0000 |
From: Richard Henderson <richard.henderson@linaro.org>
Now that float_status has a bunch of fp parameters,
it is easier to copy an existing structure than create
one from scratch. Begin by copying the structure that
corresponds to the FPSR and make only the adjustments
required for BFloat16 semantics.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20241203203949.483774-2-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target/arm/tcg/vec_helper.c | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c
index e825d501a22..ad6f26545ac 100644
--- a/target/arm/tcg/vec_helper.c
+++ b/target/arm/tcg/vec_helper.c
@@ -2813,25 +2813,19 @@ bool is_ebf(CPUARMState *env, float_status *statusp,
float_status *oddstatusp)
* no effect on AArch32 instructions.
*/
bool ebf = is_a64(env) && env->vfp.fpcr & FPCR_EBF;
- *statusp = (float_status){
- .tininess_before_rounding = float_tininess_before_rounding,
- .float_rounding_mode = float_round_to_odd_inf,
- .flush_to_zero = true,
- .flush_inputs_to_zero = true,
- .default_nan_mode = true,
- };
+
+ *statusp = env->vfp.fp_status;
+ set_default_nan_mode(true, statusp);
if (ebf) {
- float_status *fpst = &env->vfp.fp_status;
- set_flush_to_zero(get_flush_to_zero(fpst), statusp);
- set_flush_inputs_to_zero(get_flush_inputs_to_zero(fpst), statusp);
- set_float_rounding_mode(get_float_rounding_mode(fpst), statusp);
-
/* EBF=1 needs to do a step with round-to-odd semantics */
*oddstatusp = *statusp;
set_float_rounding_mode(float_round_to_odd, oddstatusp);
+ } else {
+ set_flush_to_zero(true, statusp);
+ set_flush_inputs_to_zero(true, statusp);
+ set_float_rounding_mode(float_round_to_odd_inf, statusp);
}
-
return ebf;
}
--
2.34.1
- [PULL 26/72] target/sparc: Set Float3NaNPropRule explicitly, (continued)
- [PULL 26/72] target/sparc: Set Float3NaNPropRule explicitly, Peter Maydell, 2024/12/11
- [PULL 29/72] target/i386: Set Float3NaNPropRule explicitly, Peter Maydell, 2024/12/11
- [PULL 33/72] softfloat: Create floatx80 default NaN from parts64_default_nan, Peter Maydell, 2024/12/11
- [PULL 31/72] fpu: Remove use_first_nan field from float_status, Peter Maydell, 2024/12/11
- [PULL 32/72] target/m68k: Don't pass NULL float_status to floatx80_default_nan(), Peter Maydell, 2024/12/11
- [PULL 34/72] target/loongarch: Use normal float_status in fclass_s and fclass_d helpers, Peter Maydell, 2024/12/11
- [PULL 35/72] target/m68k: In frem helper, initialize local float_status from env->fp_status, Peter Maydell, 2024/12/11
- [PULL 36/72] target/m68k: Init local float_status from env fp_status in gdb get/set reg, Peter Maydell, 2024/12/11
- [PULL 37/72] target/sparc: Initialize local scratch float_status from env->fp_status, Peter Maydell, 2024/12/11
- [PULL 38/72] target/ppc: Use env->fp_status in helper_compute_fprf functions, Peter Maydell, 2024/12/11
- [PULL 39/72] target/arm: Copy entire float_status in is_ebf,
Peter Maydell <=
- [PULL 40/72] fpu: Allow runtime choice of default NaN value, Peter Maydell, 2024/12/11
- [PULL 41/72] tests/fp: Set default NaN pattern explicitly, Peter Maydell, 2024/12/11
- [PULL 43/72] target/i386: Set default NaN pattern explicitly, Peter Maydell, 2024/12/11
- [PULL 42/72] target/microblaze: Set default NaN pattern explicitly, Peter Maydell, 2024/12/11
- [PULL 44/72] target/hppa: Set default NaN pattern explicitly, Peter Maydell, 2024/12/11
- [PULL 45/72] target/alpha: Set default NaN pattern explicitly, Peter Maydell, 2024/12/11
- [PULL 46/72] target/arm: Set default NaN pattern explicitly, Peter Maydell, 2024/12/11
- [PULL 47/72] target/loongarch: Set default NaN pattern explicitly, Peter Maydell, 2024/12/11
- [PULL 48/72] target/m68k: Set default NaN pattern explicitly, Peter Maydell, 2024/12/11
- [PULL 50/72] target/openrisc: Set default NaN pattern explicitly, Peter Maydell, 2024/12/11