On 7/25/26 17:56, Matt Turner wrote:
helper_ieee_input is called for each operand of bare (non-/S) T-floating
arithmetic instructions. It was raising EXC_M_INV for any value with
exp == 0x7ff, which covers both NaN and Infinity.
This is wrong for Infinity. Infinity is a valid arithmetic operand;
operations like Inf + finite, Inf + Inf, or Inf * finite produce well-
defined IEEE results with no invalid-operation exception. Only NaN
inputs and indeterminate forms (Inf - Inf, 0 * Inf) are invalid.
No, this is modeling actual Alpha floating-point, not IEEE arithmetic.
Only normal finites are handled in hardware; everything else needs software
assitance.
r~
Indeterminate forms are already handled: the softfloat helpers set
float_flag_invalid in those cases, which soft_to_fpcr_exc converts to
FPCR_INV in env->error_code, and helper_fp_exc_raise then raises the
trap. No pre-operation check for Inf is needed.
Change the exp == 0x7ff check to also require frac != 0, matching the
existing behavior of helper_ieee_input_cmp.
Fixes: b99e80694cc6 ("target-alpha: Raise EXC_M_INV properly for fp inputs")
Signed-off-by: Matt Turner <[email protected]>