xemu/target
Peter Maydell 1e8a98b538 target/i386: Return 'indefinite integer value' for invalid SSE fp->int conversions
The x86 architecture requires that all conversions from floating
point to integer which raise the 'invalid' exception (infinities of
both signs, NaN, and all values which don't fit in the destination
integer) return what the x86 spec calls the "indefinite integer
value", which is 0x8000_0000 for 32-bits or 0x8000_0000_0000_0000 for
64-bits.  The softfloat functions return the more usual behaviour of
positive overflows returning the maximum value that fits in the
destination integer format and negative overflows returning the
minimum value that fits.

Wrap the softfloat functions in x86-specific versions which
detect the 'invalid' condition and return the indefinite integer.

Note that we don't use these wrappers for the 3DNow! pf2id and pf2iw
instructions, which do return the minimum value that fits in
an int32 if the input float is a large negative number.

Fixes: https://bugs.launchpad.net/qemu/+bug/1815423
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20190805180332.10185-1-peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2019-08-20 17:26:20 +02:00
..
alpha configure: Define target access alignment in configure 2019-08-20 17:26:19 +02:00
arm target-arm queue: 2019-08-16 17:21:40 +01:00
cris Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
hppa configure: Define target access alignment in configure 2019-08-20 17:26:19 +02:00
i386 target/i386: Return 'indefinite integer value' for invalid SSE fp->int conversions 2019-08-20 17:26:20 +02:00
lm32 sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
m68k target/m68k: replace LIT64 with UINT64_C macros 2019-08-19 12:07:13 +01:00
microblaze targets (various): use softfloat-helpers.h where we can 2019-08-19 12:07:13 +01:00
mips configure: Define target access alignment in configure 2019-08-20 17:26:19 +02:00
moxie Include hw/boards.h a bit less 2019-08-16 13:31:53 +02:00
nios2 Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
openrisc Include hw/boards.h a bit less 2019-08-16 13:31:53 +02:00
ppc Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
riscv Implement parameter fields. 2019-08-19 16:55:30 +01:00
s390x targets (various): use softfloat-helpers.h where we can 2019-08-19 12:07:13 +01:00
sh4 configure: Define target access alignment in configure 2019-08-20 17:26:19 +02:00
sparc configure: Define target access alignment in configure 2019-08-20 17:26:19 +02:00
tilegx Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
tricore targets (various): use softfloat-helpers.h where we can 2019-08-19 12:07:13 +01:00
unicore32 targets (various): use softfloat-helpers.h where we can 2019-08-19 12:07:13 +01:00
xtensa configure: Define target access alignment in configure 2019-08-20 17:26:19 +02:00