418b0f93d1
The SSE instruction implementations all fail to raise the expected IEEE floating-point exceptions because they do nothing to convert the exception state from the softfloat machinery into the exception flags in MXCSR. Fix this by adding such conversions. Unlike for x87, emulated SSE floating-point operations might be optimized using hardware floating point on the host, and so a different approach is taken that is compatible with such optimizations. The required invariant is that all exceptions set in env->sse_status (other than "denormal operand", for which the SSE semantics are different from those in the softfloat code) are ones that are set in the MXCSR; the emulated MXCSR is updated lazily when code reads MXCSR, while when code sets MXCSR, the exceptions in env->sse_status are set accordingly. A few instructions do not raise all the exceptions that would be raised by the softfloat code, and those instructions are made to save and restore the softfloat exception state accordingly. Nothing is done about "denormal operand"; setting that (only for the case when input denormals are *not* flushed to zero, the opposite of the logic in the softfloat code for such an exception) will require custom code for relevant instructions, or else architecture-specific conditionals in the softfloat code for when to set such an exception together with custom code for various SSE conversion and rounding instructions that do not set that exception. Nothing is done about trapping exceptions (for which there is minimal and largely broken support in QEMU's emulation in the x87 case and no support at all in the SSE case). Signed-off-by: Joseph Myers <joseph@codesourcery.com> Message-Id: <alpine.DEB.2.21.2006252358000.3832@digraph.polyomino.org.uk> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
24 lines
887 B
Makefile
24 lines
887 B
Makefile
obj-y += helper.o cpu.o gdbstub.o xsave_helper.o
|
|
obj-$(CONFIG_TCG) += translate.o
|
|
obj-$(CONFIG_TCG) += bpt_helper.o cc_helper.o excp_helper.o fpu_helper.o
|
|
obj-$(CONFIG_TCG) += int_helper.o mem_helper.o misc_helper.o mpx_helper.o
|
|
obj-$(CONFIG_TCG) += seg_helper.o smm_helper.o svm_helper.o
|
|
obj-$(call lnot,$(CONFIG_TCG)) += tcg-stub.o
|
|
obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o
|
|
ifeq ($(CONFIG_SOFTMMU),y)
|
|
obj-y += machine.o arch_memory_mapping.o arch_dump.o monitor.o
|
|
obj-$(CONFIG_KVM) += kvm.o
|
|
obj-$(CONFIG_HYPERV) += hyperv.o
|
|
obj-$(call lnot,$(CONFIG_HYPERV)) += hyperv-stub.o
|
|
ifeq ($(CONFIG_WIN32),y)
|
|
obj-$(CONFIG_HAX) += hax-all.o hax-mem.o hax-windows.o
|
|
endif
|
|
ifeq ($(CONFIG_POSIX),y)
|
|
obj-$(CONFIG_HAX) += hax-all.o hax-mem.o hax-posix.o
|
|
endif
|
|
obj-$(CONFIG_HVF) += hvf/
|
|
obj-$(CONFIG_WHPX) += whpx-all.o
|
|
endif
|
|
obj-$(CONFIG_SEV) += sev.o
|
|
obj-$(call lnot,$(CONFIG_SEV)) += sev-stub.o
|