qemu-e2k/tests/tcg/i386
Joseph Myers 418b0f93d1 target/i386: fix IEEE SSE floating-point exception raising
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>
2020-07-10 18:02:17 -04:00
..
system tests/tcg/multiarch: move the system memory test 2019-05-28 10:28:51 +01:00
Makefile.softmmu-target tests/tcg: cleanup Makefile inclusions 2019-09-10 09:38:33 +01:00
Makefile.target target/i386: fix IEEE SSE floating-point exception raising 2020-07-10 18:02:17 -04:00
README tests/tcg: remove runcom test 2018-07-24 11:45:25 +01:00
hello-i386.c avoid TABs in files that only contain a few 2019-01-11 15:46:56 +01:00
test-i386-code16.S tests/tcg: move i386 specific tests into subdir 2018-06-20 20:22:34 +01:00
test-i386-f2xm1.c target/i386: reimplement f2xm1 using floatx80 operations 2020-06-26 09:39:37 -04:00
test-i386-fbstp.c target/i386: fix fbstp handling of out-of-range values 2020-06-10 12:10:25 -04:00
test-i386-fisttp.c target/i386: fix fisttpl, fisttpll handling of out-of-range values 2020-06-10 12:10:26 -04:00
test-i386-fldcst.c target/i386: fix floating-point load-constant rounding 2020-06-10 12:10:24 -04:00
test-i386-fp-exceptions.c target/i386: fix IEEE x87 floating-point exception raising 2020-06-10 12:10:51 -04:00
test-i386-fpatan.c target/i386: reimplement fpatan using floatx80 operations 2020-06-26 09:39:39 -04:00
test-i386-fprem.c tests/tcg/i386: add runner for test-i386-fprem 2018-06-20 20:22:34 +01:00
test-i386-fscale.c target/i386: fix fscale handling of rounding precision 2020-06-10 12:10:21 -04:00
test-i386-fxam.c target/i386: fix fxam handling of invalid encodings 2020-06-10 12:10:24 -04:00
test-i386-fxtract.c target/i386: implement special cases for fxtract 2020-06-10 12:10:16 -04:00
test-i386-fyl2x.c target/i386: reimplement fyl2x using floatx80 operations 2020-06-26 09:39:39 -04:00
test-i386-fyl2xp1.c target/i386: reimplement fyl2xp1 using floatx80 operations 2020-06-26 09:39:38 -04:00
test-i386-muldiv.h tests/tcg: move i386 specific tests into subdir 2018-06-20 20:22:34 +01:00
test-i386-pcmpistri.c target/i386: correct fix for pcmpxstrx substring search 2020-06-12 11:10:39 -04:00
test-i386-pseudo-denormal.c softfloat: fix floatx80 pseudo-denormal round to integer 2020-05-15 11:04:50 -07:00
test-i386-shift.h tests/tcg: move i386 specific tests into subdir 2018-06-20 20:22:34 +01:00
test-i386-snan-convert.c softfloat: silence sNaN for conversions to/from floatx80 2020-05-15 11:04:50 -07:00
test-i386-sse-exceptions.c target/i386: fix IEEE SSE floating-point exception raising 2020-07-10 18:02:17 -04:00
test-i386-ssse3.c tests/tcg: move i386 specific tests into subdir 2018-06-20 20:22:34 +01:00
test-i386-vm86.S tests/tcg: move i386 specific tests into subdir 2018-06-20 20:22:34 +01:00
test-i386.c Fixes i386 xchgq test 2018-12-11 18:41:25 +01:00
test-i386.h tests/tcg: move i386 specific tests into subdir 2018-06-20 20:22:34 +01:00

README

These are i386 specific guest programs

test-i386
---------

This program executes most of the 16 bit and 32 bit x86 instructions and
generates a text output, for comparison with the output obtained with
a real CPU or another emulator.

The Linux system call modify_ldt() is used to create x86 selectors
to test some 16 bit addressing and 32 bit with segmentation cases.

The Linux system call vm86() is used to test vm86 emulation.

Various exceptions are raised to test most of the x86 user space
exception reporting.

linux-test
----------

This program tests various Linux system calls. It is used to verify
that the system call parameters are correctly converted between target
and host CPUs.

test-i386-fprem
---------------

test-mmap
---------

sha1
----

hello-i386
----------