diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2019-08-05 19:03:32 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-08-20 17:26:20 +0200 |
commit | 1e8a98b53867f61da9ca09f411288e2085d323c4 (patch) | |
tree | 2c764041860c7013088876d8142e10813ad9cb18 /include/exec | |
parent | 1f670a95b370651bcf3721aa0941d57e185478cf (diff) |
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>
Diffstat (limited to 'include/exec')
0 files changed, 0 insertions, 0 deletions