Skip to content

[ARM64_DYNAREC] Fix NaN detection operand typo#3820

Merged
ptitSeb merged 1 commit intoptitSeb:mainfrom
devarajabc:0504
May 4, 2026
Merged

[ARM64_DYNAREC] Fix NaN detection operand typo#3820
ptitSeb merged 1 commit intoptitSeb:mainfrom
devarajabc:0504

Conversation

@devarajabc
Copy link
Copy Markdown
Contributor

@devarajabc devarajabc commented May 3, 2026

The fastnan=0 path of VSQRTSS compared v1 against itself for NaN detection, but v1 is never assigned in this case where the input is loaded into d0 by GETEXSS.

Before fix:

sqrt(4.0)                        0x40000000 2
sqrt(-1.0)                       0xffc00000 -NaN
sqrt(+QNaN)                      0xffc00000 -NaN     <-- expected 0x7fc00000 (+NaN)
sqrt(-QNaN)                      0xffc00000 -NaN

After fix:

sqrt(4.0)                        0x40000000 2
sqrt(-1.0)                       0xffc00000 -NaN
sqrt(+QNaN)                      0x7fc00000 +NaN
sqrt(-QNaN)                      0xffc00000 -NaN

Thanks !

The fastnan=0 path of VSQRTSS compared `v1` against itself for NaN
detection, but `v1` is never assigned in this case where the input is
loaded into `d0` by GETEXSS.

Before fix:
    sqrt(4.0)                        0x40000000 2
    sqrt(-1.0)                       0xffc00000 -NaN
    sqrt(+QNaN)                      0xffc00000 -NaN     <-- expected 0x7fc00000 (+NaN)
    sqrt(-QNaN)                      0xffc00000 -NaN

After fix:
    sqrt(4.0)                        0x40000000 2
    sqrt(-1.0)                       0xffc00000 -NaN
    sqrt(+QNaN)                      0x7fc00000 +NaN
    sqrt(-QNaN)                      0xffc00000 -NaN
@ptitSeb
Copy link
Copy Markdown
Owner

ptitSeb commented May 4, 2026

Indeed!

@ptitSeb ptitSeb merged commit dfaabd0 into ptitSeb:main May 4, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants