qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 for-10.0 29/54] target/loongarch: Use normal float_status


From: Richard Henderson
Subject: Re: [PATCH v2 for-10.0 29/54] target/loongarch: Use normal float_status in fclass_s and fclass_d helpers
Date: Mon, 2 Dec 2024 11:21:52 -0600
User-agent: Mozilla Thunderbird

On 12/2/24 07:13, Peter Maydell wrote:
In target/loongarch's helper_fclass_s() and helper_fclass_d() we pass
a zero-initialized float_status struct to float32_is_quiet_nan() and
float64_is_quiet_nan(), with the cryptic comment "for
snan_bit_is_one".

This pattern appears to have been copied from target/riscv, where it
is used because the functions there do not have ready access to the
CPU state struct. The comment presumably refers to the fact that the
main reason the is_quiet_nan() functions want the float_state is
because they want to know about the snan_bit_is_one config.

In the loongarch helpers, though, we have the CPU state struct
to hand. Use the usual env->fp_status here. This avoids our needing
to track that we need to update the initializer of the local
float_status structs when the core softfloat code adds new
options for targets to configure their behaviour.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
It would be nice to get the riscv fclass_s etc also not to use a
stunt float_status, but plumbing the env through would require
fiddling with the macro magic, and in practice for the is_quiet_nan
functions it works out OK.
---
  target/loongarch/tcg/fpu_helper.c | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]