Open Muon opened 1 year ago
@llvm/issue-subscribers-backend-mips
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?
For MIPSr2/r3/r5, we have an option -mnan=2008/legacy to swtich it. For r6, 2008 is required.
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