]> granicus.if.org Git - clang/commit
[WebAssembly] Add builtin and intrinsic for v8x16.swizzle
authorThomas Lively <tlively@google.com>
Wed, 9 Oct 2019 17:45:47 +0000 (17:45 +0000)
committerThomas Lively <tlively@google.com>
Wed, 9 Oct 2019 17:45:47 +0000 (17:45 +0000)
commitbcf02e2dea95f7741edf9a5b5c0a9a6e6ad2703e
treeb7dbcfb349cb96f3c343d7bd4f9ba26c2185f5e5
parentefd8c82e8735a6b31605a8fb2b1acd44b2c044ef
[WebAssembly] Add builtin and intrinsic for v8x16.swizzle

Summary:
This clang builtin and corresponding LLVM intrinsic are necessary to
expose the exact semantics of the underlying WebAssembly instruction
to users. LLVM produces a poison value if the dynamic swizzle indices
are greater than the vector size, but the WebAssembly instruction sets
the corresponding output lane to zero. Users who depend on this
behavior can safely use this builtin.

Depends on D68527.

Reviewers: aheejin, dschuff

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

Tags: #clang, #llvm

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

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