Page MenuHomePhabricator

[mlir][Standard] Add minf/maxf operations.
Needs RevisionPublic

Authored by herhut on Mon, Jun 29, 3:05 AM.

Details

Summary

Having min and max on floats is useful for lowering to special
hardware intrinsics.

Diff Detail

Event Timeline

herhut created this revision.Mon, Jun 29, 3:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptMon, Jun 29, 3:05 AM

Please document and test the semantics of these operations in presence of NaNs, and update docs/Rationale.md to mention why we have minf/maxf (presumably because they offer NaN-propagation semantics that cannot be expressed with a single cmpf+select).

mehdi_amini requested changes to this revision.Mon, Jun 29, 9:32 PM

So far we've consider these as easy to pattern match, anything changed here?

This revision now requires changes to proceed.Mon, Jun 29, 9:32 PM

So far we've consider these as easy to pattern match, anything changed here?

I think the intended semantics is to propagate NaNs, which can be implemented as various combinations of 4 operations that becomes less straightforward to match.