Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
I would expect ordered comparisons to lower to fminnan/fmaxnan if the constant vector was on the left hand side and the variable vector was on the right hand side. That way, any NaNs in the variable vector would compare as false and then be returned when the select chooses the right hand side.
test/CodeGen/WebAssembly/simd-arith.ll | ||
---|---|---|
725 ↗ | (On Diff #166948) | If we have a constant vector in the right hand side, it will be still lowered to f32x4.min, right? |
test/CodeGen/WebAssembly/simd-arith.ll | ||
---|---|---|
725 ↗ | (On Diff #166948) | No, not with an ordered comparison. If the constant (non-zero, non-NaN) vector is on the right and the variable vector on the left happens to contains a NaN, the ordered comparison will be false for that lane. Then the select will choose the constant from the right hand side rather than the NaN, so that scenario would not exhibit wasm's NaN propagation behavior. |