On 7/27/26 02:20, Peter Maydell wrote:
On Sun, 26 Jul 2026 at 19:22, Richard Henderson
<[email protected]> wrote:
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.
Do we emulate that software-assist in linux-user ? I couldn't see
any code for that at a quick glance.
Well, that's complicated by the fact that there are both software assist (/s) and
non-software assist (non-/s) instructions.
For software assist, we skip the input trap handling in linux-user:
#ifndef CONFIG_USER_ONLY
/* In system mode, raise exceptions for denormals like real
hardware. In user mode, proceed as if the OS completion
handler is handling the denormal as per spec. */
gen_helper_ieee_input_s(tcg_env, val);
#endif
For non-software assist, per above, there's no difference: always trap.
Some truly horrible decisions were made back in the 80's in the name of FOPS.
r~