qemu-cr16/target/i386
Peter Maydell 28f13bccbe fpu: allow flushing of output denormals to be after rounding
Currently we handle flushing of output denormals in uncanon_normal
always before we deal with rounding.  This works for architectures
that detect tininess before rounding, but is usually not the right
place when the architecture detects tininess after rounding.  For
example, for x86 the SDM states that the MXCSR FTZ control bit causes
outputs to be flushed to zero "when it detects a floating-point
underflow condition".  This means that we mustn't flush to zero if
the input is such that after rounding it is no longer tiny.

At least one of our guest architectures does underflow detection
after rounding but flushing of denormals before rounding (MIPS MSA);
this means we need to have a config knob for this that is separate
from our existing tininess_before_rounding setting.

Add an ftz_detection flag.  For consistency with
tininess_before_rounding, we make it default to "detect ftz after
rounding"; this means that we need to explicitly set the flag to
"detect ftz before rounding" on every existing architecture that sets
flush_to_zero, so that this commit has no behaviour change.
(This means more code change here but for the long term a less
confusing API.)

For several architectures the current behaviour is either
definitely or possibly wrong; annotate those with TODO comments.
These architectures are definitely wrong (and should detect
ftz after rounding):
 * x86
 * Alpha

For these architectures the spec is unclear:
 * MIPS (for non-MSA)
 * RX
 * SH4

PA-RISC makes ftz detection IMPDEF, but we aren't setting the
"tininess before rounding" setting that we ought to.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2025-02-11 16:22:07 +00:00
..
hvf i386/cpu: Extract a common fucntion to setup value of MSR_CORE_THREAD_COUNT 2025-01-10 23:34:44 +01:00
kvm i386/cpu: Extract a common fucntion to setup value of MSR_CORE_THREAD_COUNT 2025-01-10 23:34:44 +01:00
nvmm include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
tcg fpu: allow flushing of output denormals to be after rounding 2025-02-11 16:22:07 +00:00
whpx include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
arch_dump.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
arch_memory_mapping.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
confidential-guest.c target/i386: introduce x86-confidential-guest 2024-04-23 17:35:25 +02:00
confidential-guest.h target/i386/confidential-guest: Fix comment of x86_confidential_guest_kvm_type() 2025-01-10 23:34:44 +01:00
cpu-apic.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
cpu-dump.c target/i386: remove CC_OP_CLR 2024-10-31 18:28:33 +01:00
cpu-internal.h include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
cpu-param.h target/*: Remove TARGET_LONG_BITS from cpu-param.h 2025-02-08 12:41:33 -08:00
cpu-qom.h target: Move ArchCPUClass definition to 'cpu.h' 2023-11-07 13:08:48 +01:00
cpu-system.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
cpu.c target/i386: Add new CPU model ClearwaterForest 2025-01-23 11:50:53 +01:00
cpu.h target/i386: Add new CPU model ClearwaterForest 2025-01-23 11:50:53 +01:00
gdbstub.c target/i386/gdbstub: Expose orig_ax 2024-10-13 10:05:51 -07:00
helper.c accel/tcg: Move tcg_cflags_has/set() to 'exec/translation-block.h' 2024-12-20 17:44:57 +01:00
helper.h target/i386: optimize computation of ZF from CC_OP_DYNAMIC 2024-10-31 18:28:33 +01:00
host-cpu.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
host-cpu.h
Kconfig i386: select correct components for no-board build 2024-05-10 15:45:15 +02:00
machine.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
meson.build include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
monitor.c qapi: Move include/qapi/qmp/ to include/qobject/ 2025-02-10 15:33:16 +01:00
ops_sse.h target/i386: set CC_OP in helpers if they want CC_OP_EFLAGS 2024-05-25 13:28:01 +02:00
sev-system-stub.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
sev.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
sev.h target/i386/sev: Reduce system specific declarations 2024-12-20 17:44:56 +01:00
svm.h target/i386: check intercept for XSETBV 2023-10-17 15:20:53 +02:00
trace-events target/i386/sev: Use size_t for object sizes 2024-06-28 19:26:54 +02:00
trace.h
xsave_helper.c