OSDN Git Service

target/ppc: Use helper_todouble/tosingle in helper_xststdcsp
authorRichard Henderson <richard.henderson@linaro.org>
Fri, 17 Dec 2021 16:57:16 +0000 (17:57 +0100)
committerCédric Le Goater <clg@kaod.org>
Fri, 17 Dec 2021 16:57:16 +0000 (17:57 +0100)
commita1f1c731c6515313d81630eff8867f0cba27dec5
treecd6b14e6142f1f30bc57a90d0e021c865edd58eb
parent7d82ea34840e1d53bb173ad628b0f2371741d138
target/ppc: Use helper_todouble/tosingle in helper_xststdcsp

When computing the predicate "is this value currently formatted
for single precision", we do not want to round the value according
to the current rounding mode, nor perform a floating-point equality.
We want to see if the N bits that make up single-precision are the
only ones set within the register, and then a bitwise equality.

Fixes a bug in which a single-precision NaN is considered !SP,
because float64_eq(nan, nan) is always false.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20211119160502.17432-35-richard.henderson@linaro.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
target/ppc/fpu_helper.c