Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APFloat incorrectly generates signaling NaNs on MIPS #60796

Open
Muon opened this issue Feb 16, 2023 · 3 comments
Open

APFloat incorrectly generates signaling NaNs on MIPS #60796

Muon opened this issue Feb 16, 2023 · 3 comments

Comments

@Muon
Copy link

Muon commented Feb 16, 2023

The signaling bit convention on MIPS is opposite that of x86 and ARM, but APFloat doesn't know that. As a result, constant folding to a NaN erroneously produces a signaling NaN instead of a quiet NaN on MIPS: https://godbolt.org/z/TP5hePhWP

@llvmbot
Copy link
Collaborator

llvmbot commented Feb 16, 2023

@llvm/issue-subscribers-backend-mips

@RalfJung
Copy link
Contributor

The signaling bit convention on MIPS

From what I understand, this is true for some MIPS chips, but other more recent chips actually make this runtime-configurable. For those chips it is impossible to know at compiletime which NaN needs to be produced to get a quiet NaN, isn't it?

@wzssyqa
Copy link
Contributor

wzssyqa commented Aug 28, 2023

For MIPSr2/r3/r5, we have an option -mnan=2008/legacy to swtich it.
For r6, 2008 is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants