This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Add llvm.wasm.{min|max} intrinsic functions
AbandonedPublic

Authored by tlively on Sep 21 2018, 5:32 PM.

Details

Reviewers
aheejin
dschuff
Summary

These intrinsics are similar to llvm.minnum and llvm.maxnum except
that they follow WebAssembly's NaN propagating rules. Loosely, if
either argument is a NaN, the result is also a NaN. Depends on D52325.

Diff Detail

Event Timeline

tlively created this revision.Sep 21 2018, 5:32 PM

The big question I have about this CL is whether these intrinsics should be target-independent instead of specific to the wasm. Their functionality is certainly not wasm-specific. @dschuff what do you think? I would just have to rename them and add documentation to the language reference. The downside is that I expect getting this merged as target independent intrinsics would be more difficult.

tlively updated this revision to Diff 166586.Sep 21 2018, 5:55 PM
  • Add tests for f32 and f64
tlively planned changes to this revision.Sep 24 2018, 3:07 PM

As discussed today, I will make these intrinsics target-independent since they will be included in IEEE-754 2018.

tlively abandoned this revision.Sep 25 2018, 10:33 AM

Abandoned in favor of D52450.