[PATCH] D52852: [WebAssembly] __builtin_wasm_extract_lane_* builtins

Heejin Ahn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 3 16:58:38 PDT 2018


aheejin 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:")
----------------
- 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?


================
Comment at: test/CodeGen/builtins-wasm.c:112
+  // WEBASSEMBLY-NEXT: ret
+}
+
----------------
The same for the return values here.


Repository:
  rC Clang

https://reviews.llvm.org/D52852





More information about the cfe-commits mailing list