target/i386: fix fscale handling of invalid exponent encodings
commitb40eec96b26028b68c3594fbf34b6d6f029df26a
authorJoseph Myers <joseph@codesourcery.com>
Thu, 7 May 2020 00:44:57 +0000 (7 00:44 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 10 Jun 2020 16:10:17 +0000 (10 12:10 -0400)
tree9d102ee76ffb044cc3fe3612d37e634c85cc3c05
parent0d48b436327955c69e2eb53f88aba9aa1e0dbaa0
target/i386: fix fscale handling of invalid exponent encodings

The fscale implementation does not check for invalid encodings in the
exponent operand, thus treating them like INT_MIN (the value returned
for invalid encodings by floatx80_to_int32_round_to_zero).  Fix it to
treat them similarly to signaling NaN exponents, thus generating a
quiet NaN result.

Signed-off-by: Joseph Myers <joseph@codesourcery.com>
Message-Id: <alpine.DEB.2.21.2005070044190.18350@digraph.polyomino.org.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/fpu_helper.c
tests/tcg/i386/test-i386-fscale.c