qemu-e2k/tests/tcg
Joseph Myers 5eebc49d2d target/i386: reimplement fyl2xp1 using floatx80 operations
The x87 fyl2xp1 emulation is currently based around conversion to
double.  This is inherently unsuitable for a good emulation of any
floatx80 operation, even before considering that it is a particularly
naive implementation using double (adding 1 then using log rather than
attempting a better emulation using log1p).

Reimplement using the soft-float operations, as was done for f2xm1; as
in that case, m68k has related operations but not exactly this one and
it seemed safest to implement directly rather than reusing the m68k
code to avoid accumulation of errors.

A test is included with many randomly generated inputs.  The
assumption of the test is that the result in round-to-nearest mode
should always be one of the two closest floating-point numbers to the
mathematical value of y * log2(x + 1); the implementation aims to do
somewhat better than that (about 70 correct bits before rounding).  I
haven't investigated how accurate hardware is.

Intel manuals describe a narrower range of valid arguments to this
instruction than AMD manuals.  The implementation accepts the wider
range (it's needed anyway for the core code to be reusable in a
subsequent patch reimplementing fyl2x), but the test only has inputs
in the narrower range so that it's valid on hardware that may reject
or produce poor results for inputs outside that range.

Code in the previous implementation that sets C2 for some out-of-range
arguments is not carried forward to the new implementation; C2 is
undefined for this instruction and I suspect that code was just
cut-and-pasted from the trigonometric instructions (fcos, fptan, fsin,
fsincos) where C2 *is* defined to be set for out-of-range arguments.

Signed-off-by: Joseph Myers <joseph@codesourcery.com>

Message-Id: <alpine.DEB.2.21.2006172320190.20587@digraph.polyomino.org.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-06-26 09:39:38 -04:00
..
aarch64 tests/tcg: ensure -cpu max also used for plugin run 2020-06-16 14:49:05 +01:00
alpha
arm tests/tcg: build plugin list from contents of src directory 2020-06-16 14:49:05 +01:00
cris tests/tcg: add a multiarch linux-user gdb test 2020-05-06 09:29:26 +01:00
hppa
i386 target/i386: reimplement fyl2xp1 using floatx80 operations 2020-06-26 09:39:38 -04:00
lm32
m68k
minilib
mips
multiarch tests/tcg: add new threadcount test 2020-05-27 14:26:49 +01:00
openrisc
ppc
s390x
sh4
sparc64
x86_64 tests/tcg: remove extraneous pasting macros 2020-04-07 16:19:49 +01:00
xtensa
.gitignore
configure.sh tests/docker: use a gcc-10 based image for arm64 tests 2020-05-27 14:26:49 +01:00
Makefile.prereqs
Makefile.qemu
Makefile.target plugins: new lockstep plugin for debugging TCG changes 2020-06-16 14:49:05 +01:00
README

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".