mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-11 14:15:35 +00:00
target-arm: Squash input denormals in FRECPS and FRSQRTS
The helper functions for FRECPS and FRSQRTS have special case handling that includes checks for zero inputs, so squash input denormals if necessary before those checks. This fixes incorrect output when the FPCR DZ bit is set to enable squashing of input denormals. Backports commit a8eb6e19991d1a7a6a7b04ac447548d30d75eb4a from qemu
This commit is contained in:
parent
337e658869
commit
1c275134ae
|
@ -209,6 +209,9 @@ float32 HELPER(recpsf_f32)(float32 a, float32 b, void *fpstp)
|
|||
{
|
||||
float_status *fpst = fpstp;
|
||||
|
||||
a = float32_squash_input_denormal(a, fpst);
|
||||
b = float32_squash_input_denormal(b, fpst);
|
||||
|
||||
a = float32_chs(a);
|
||||
if ((float32_is_infinity(a) && float32_is_zero(b)) ||
|
||||
(float32_is_infinity(b) && float32_is_zero(a))) {
|
||||
|
@ -221,6 +224,9 @@ float64 HELPER(recpsf_f64)(float64 a, float64 b, void *fpstp)
|
|||
{
|
||||
float_status *fpst = fpstp;
|
||||
|
||||
a = float64_squash_input_denormal(a, fpst);
|
||||
b = float64_squash_input_denormal(b, fpst);
|
||||
|
||||
a = float64_chs(a);
|
||||
if ((float64_is_infinity(a) && float64_is_zero(b)) ||
|
||||
(float64_is_infinity(b) && float64_is_zero(a))) {
|
||||
|
@ -233,6 +239,9 @@ float32 HELPER(rsqrtsf_f32)(float32 a, float32 b, void *fpstp)
|
|||
{
|
||||
float_status *fpst = fpstp;
|
||||
|
||||
a = float32_squash_input_denormal(a, fpst);
|
||||
b = float32_squash_input_denormal(b, fpst);
|
||||
|
||||
a = float32_chs(a);
|
||||
if ((float32_is_infinity(a) && float32_is_zero(b)) ||
|
||||
(float32_is_infinity(b) && float32_is_zero(a))) {
|
||||
|
@ -245,6 +254,9 @@ float64 HELPER(rsqrtsf_f64)(float64 a, float64 b, void *fpstp)
|
|||
{
|
||||
float_status *fpst = fpstp;
|
||||
|
||||
a = float64_squash_input_denormal(a, fpst);
|
||||
b = float64_squash_input_denormal(b, fpst);
|
||||
|
||||
a = float64_chs(a);
|
||||
if ((float64_is_infinity(a) && float64_is_zero(b)) ||
|
||||
(float64_is_infinity(b) && float64_is_zero(a))) {
|
||||
|
|
Loading…
Reference in a new issue