mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
fpu: Move m68k_denormal fmt flag into floatx80_behaviour
Currently we compile-time set an 'm68k_denormal' flag in the FloatFmt for floatx80 for m68k. This controls our handling of what the Intel documentation calls a "pseudo-denormal": a value where the exponent field is zero and the explicit integer bit is set. For x86, the x87 FPU is supposed to accept a pseudo-denormal as input, but never generate one on output. For m68k, these values are permitted on input and may be produced on output. Replace the flag in the FloatFmt with a flag indicating whether the float format has an explicit bit (which will be true for floatx80 for all targets, and false for every other float type). Then we can gate the handling of these pseudo-denormals on the setting of a floatx80_behaviour flag. As far as I can see from the code we don't actually handle the x86-mandated "accept on input but don't generate" behaviour, because the handling in partsN(canonicalize) looked at fmt->m68k_denormal. So I have added TODO comments to that effect. This commit doesn't change any behaviour for any target. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20250224111524.1101196-9-peter.maydell@linaro.org Message-id: 20250217125055.160887-7-peter.maydell@linaro.org
This commit is contained in:
parent
a261d3e331
commit
1e75d8247f
4 changed files with 49 additions and 9 deletions
|
@ -139,7 +139,8 @@ static void m68k_cpu_reset_hold(Object *obj, ResetType type)
|
|||
set_floatx80_behaviour(floatx80_default_inf_int_bit_is_zero |
|
||||
floatx80_pseudo_inf_valid |
|
||||
floatx80_pseudo_nan_valid |
|
||||
floatx80_unnormal_valid,
|
||||
floatx80_unnormal_valid |
|
||||
floatx80_pseudo_denormal_valid,
|
||||
&env->fp_status);
|
||||
|
||||
nan = floatx80_default_nan(&env->fp_status);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue