On 2/4/26 15:17, Max Chou wrote:
According to Intel's x87 FPU specification (Table 8-10, Vol. 1), arithmetic
operations on operands in unsupported formats (including pseudo-NaNs) must
return the QNaN floating-point indefinite value.

The helper functions for FPATAN, FYL2XP1, and FYL2X incorrectly check for
signaling NaN before checking for invalid encodings. This causes pseudo-NaNs
to be treated as valid signaling NaNs and silenced, rather than being
rejected as unsupported formats.

Reorder the checks to test floatx80_invalid_encoding before
floatx80_is_signaling_nan, matching the correct behavior already
implemented in helper_fscale.

Signed-off-by: Max Chou<[email protected]>
---
  target/i386/tcg/fpu_helper.c | 30 +++++++++++++++---------------
  1 file changed, 15 insertions(+), 15 deletions(-)

Good catch.

Reviewed-by: Richard Henderson <[email protected]>


r~

Reply via email to