[AArch64] Miscompile of fp operation `(a >= c) | (b >= c)`
Open
backend:AArch64
floating-point
miscompilation
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
This IR:
```llvm
define i1 @f(float %a, float %b, float %c) {
%4 = fcmp oge float %a, %c
%5 = fcmp oge float %b, %c
%6 = or i1 %4, %5
ret i1 %6
}
```
is lowered to
```asm
f:
fmaxnm s0, s0, s1
fcmp s0, s2
cset w0, ge
ret
```
For `a=c=+0.0` and `b=sNaN`, the IR returns `true` and the hardware returns `false`.
`llubi` output:
```
%1 = fcmp oge float 0.000000e+00, 0.000000e+00 => T
%2 = fcmp oge float +snan(0x1), 0.000000e+00 => F
%3 = or i1 %1, %2 => T
```
cc @regehr
Contributor guide
Assessment
This issue has not been assessed yet.