[PATCH] D52852: [WebAssembly] __builtin_wasm_extract_lane_* builtins

Thomas Lively via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 3 20:54:08 PDT 2018


tlively added inline comments.


================
Comment at: include/clang/Basic/BuiltinsWebAssembly.def:46
+BUILTIN(__builtin_wasm_extract_lane_s_i16x8, "iV8sIi", "ncV:128:")
+BUILTIN(__builtin_wasm_extract_lane_u_i16x8, "iV8sIi", "ncV:128:")
+BUILTIN(__builtin_wasm_extract_lane_i32x4, "iV4iIi", "ncV:128:")
----------------
craig.topper wrote:
> aheejin wrote:
> > - I guess the return types should be the same as its element type, because we are translating to not wasm but LLVM IR instructions and `extractelement`'s return type and element type are the same.
> > - What does `I` mean in the second argument? The instruction says it is required for constant folding. How is the generated IR different if we use it?
> The I makes Sema ensure it is a Integer Constant Expression.
I want these builtins to mimic the underlying wasm instructions as much as possible. I believe end users are more likely to be looking at the WebAssembly spec than the LLVM  language reference when using these functions.


Repository:
  rC Clang

https://reviews.llvm.org/D52852





More information about the cfe-commits mailing list