[WebAssembly] Saturating float to int intrinsics
authorThomas Lively <tlively@google.com>
Thu, 11 Oct 2018 00:01:25 +0000 (00:01 +0000)
committerThomas Lively <tlively@google.com>
Thu, 11 Oct 2018 00:01:25 +0000 (00:01 +0000)
commit2ebacb107bfebc7b60b238edea538570ad44cef9
treee2dcbd81ba4e02e85be7096afe91d40b1ea5dce3
parent7b2b0185ba6c4b21906310183e92e8b32f43a0d7
[WebAssembly] Saturating float to int intrinsics

Summary:
Although the saturating float to int instructions are already
emitted from normal IR, the fpto{s,u}i instructions produce poison
values if the argument cannot fit in the result type. These intrinsics
are therefore necessary to get guaranteed defined saturating behavior.

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

Differential Revision: https://reviews.llvm.org/D53004

llvm-svn: 344204
llvm/include/llvm/IR/IntrinsicsWebAssembly.td
llvm/lib/Target/WebAssembly/WebAssemblyInstrConv.td
llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
llvm/test/CodeGen/WebAssembly/conv.ll
llvm/test/CodeGen/WebAssembly/simd-intrinsics.ll