This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Revert result operand ordering for pmin/pmax
ClosedPublic

Authored by samparker on Feb 21 2023, 2:58 AM.

Details

Summary

In D143581 I made a few changes around pmin and pmax, including reversing the operand ordering. Is this what's causing the issue with NaN propagation @tlively ?

Diff Detail

Event Timeline

samparker created this revision.Feb 21 2023, 2:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 21 2023, 2:59 AM
samparker requested review of this revision.Feb 21 2023, 2:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 21 2023, 2:59 AM
tlively accepted this revision.Feb 21 2023, 8:28 AM

Yes, pmin is rhs < lhs ? rhs : lhs and pmax is lhs < rhs ? rhs : lhs, so if either input is NaN, the result for either operation should be lhs. IIUC, before this patch NaN inputs would result in rhs instead.

This revision is now accepted and ready to land.Feb 21 2023, 8:28 AM
This revision was automatically updated to reflect the committed changes.