]> granicus.if.org Git - clang/commit
[WebAssembly] Trapping fptoint builtins and intrinsics
authorThomas Lively <tlively@google.com>
Tue, 15 Oct 2019 01:11:51 +0000 (01:11 +0000)
committerThomas Lively <tlively@google.com>
Tue, 15 Oct 2019 01:11:51 +0000 (01:11 +0000)
commit837a96eec129835f1c498b92c33037704a13bd91
tree0535179c46d24d920525d31015918f0e63270edc
parentcadc5f347808151935a6306afe20055dee34d42e
[WebAssembly] Trapping fptoint builtins and intrinsics

Summary:
The WebAssembly backend lowers fptoint instructions to a code sequence
that checks for overflow to avoid traps because fptoint is supposed to
be speculatable. These new builtins and intrinsics give users a way to
depend on the trapping semantics of the underlying instructions and
avoid the extra code generated normally.

Patch by coffee and tlively.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374856 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/BuiltinsWebAssembly.def
lib/CodeGen/CGBuiltin.cpp
test/CodeGen/builtins-wasm.c