unicorn/qemu/target
Peter Maydell 5899803c3c
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

Backports commit 1e8a98b53867f61da9ca09f411288e2085d323c4 from qemu
2019-11-18 21:48:03 -05:00
..
arm target/arm: Use tcg_gen_extrh_i64_i32 to extract the high word 2019-11-18 20:36:19 -05:00
i386 target/i386: Return 'indefinite integer value' for invalid SSE fp->int conversions 2019-11-18 21:48:03 -05:00
m68k target/m68k: replace LIT64 with UINT64_C macros 2019-11-18 21:05:59 -05:00
mips configure: Define target access alignment in configure 2019-11-18 21:41:35 -05:00
riscv target/riscv: Remove redundant declaration pragmas 2019-11-18 21:22:09 -05:00
sparc configure: Define target access alignment in configure 2019-11-18 21:41:35 -05:00