qemu-patch-raspberry4/tests/tcg
Joseph Myers 975af797f1 target/i386: fix IEEE x87 floating-point exception raising
Most x87 instruction implementations 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 the x87 status word.  There is special-case handling of division to
raise the divide-by-zero exception, but that handling is itself buggy:
it raises the exception in inappropriate cases (inf / 0 and nan / 0,
which should not raise any exceptions, and 0 / 0, which should raise
"invalid" instead).

Fix this by converting the floating-point exceptions raised during an
operation by the softfloat machinery into exceptions in the x87 status
word (passing through the existing fpu_set_exception function for
handling related to trapping exceptions).  There are special cases
where some functions convert to integer internally but exceptions from
that conversion are not always correct exceptions for the instruction
to raise.

There might be scope for some simplification if the softfloat
exception state either could always be assumed to be in sync with the
state in the status word, or could always be ignored at the start of
each instruction and just set to 0 then; I haven't looked into that in
detail, and it might run into interactions with the various ways the
emulation does not yet handle trapping exceptions properly.  I think
the approach taken here, of saving the softfloat state, setting
exceptions there to 0 and then merging the old exceptions back in
after carrying out the operation, is conservatively safe.

Signed-off-by: Joseph Myers <joseph@codesourcery.com>
Message-Id: <alpine.DEB.2.21.2005152120280.3469@digraph.polyomino.org.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-06-10 12:10:51 -04:00
..
aarch64 tests/tcg: fix invocation of the memory record/replay tests 2020-05-27 14:26:49 +01:00
alpha tests/tcg: move configuration to a sub-shell script 2019-09-10 14:09:00 +01:00
arm tests/tcg: add user version of dumb-as-bricks semiconsole test 2020-01-09 11:41:29 +00:00
cris tests/tcg: add a multiarch linux-user gdb test 2020-05-06 09:29:26 +01:00
hppa tests/tcg: move configuration to a sub-shell script 2019-09-10 14:09:00 +01:00
i386 target/i386: fix IEEE x87 floating-point exception raising 2020-06-10 12:10:51 -04:00
lm32 test: lm32: use semihosting for testing 2014-05-24 19:42:29 +02:00
m68k tests/tcg: move configuration to a sub-shell script 2019-09-10 14:09:00 +01:00
minilib tests/tcg: use EXTRA_CFLAGS everywhere 2019-09-10 09:38:33 +01:00
mips tests/tcg: move configuration to a sub-shell script 2019-09-10 14:09:00 +01:00
multiarch tests/tcg: add new threadcount test 2020-05-27 14:26:49 +01:00
openrisc target/openrisc: Rename the cpu from or32 to or1k 2017-02-14 08:14:58 +11:00
ppc tests/tcg: move configuration to a sub-shell script 2019-09-10 14:09:00 +01:00
s390x tests/tcg: target/s390x: Test MVC 2019-09-23 09:28:29 +02:00
sh4 tests/tcg: move configuration to a sub-shell script 2019-09-10 14:09:00 +01:00
sparc64 tests/tcg: move configuration to a sub-shell script 2019-09-10 14:09:00 +01:00
x86_64 tests/tcg: remove extraneous pasting macros 2020-04-07 16:19:49 +01:00
xtensa tests/tcg: move configuration to a sub-shell script 2019-09-10 14:09:00 +01:00
.gitignore tests/tcg: add .gitignore for in source builds 2019-09-10 14:14:31 +01:00
configure.sh tests/docker: use a gcc-10 based image for arm64 tests 2020-05-27 14:26:49 +01:00
Makefile.prereqs tests/tcg: ensure we re-configure if configure.sh is updated 2019-12-19 08:20:16 +00:00
Makefile.qemu tests/tcg: move configuration to a sub-shell script 2019-09-10 14:09:00 +01:00
Makefile.target tests/tcg: give debug builds a little bit longer 2020-02-25 20:20:23 +00:00
README tests/tcg/README: fix location for lm32 tests 2018-10-26 17:17:32 +02:00

This directory contains various interesting guest programs for
regression testing. Tests are either multi-arch, meaning they can be
built for all guest architectures that support linux-user executable,
or they are architecture specific.

CRIS
====
The testsuite for CRIS is in tests/tcg/cris.  You can run it
with "make test-cris".

LM32
====
The testsuite for LM32 is in tests/tcg/lm32.  You can run it
with "make test-lm32".