summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/builtins-wasm.c
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2018-10-05 00:58:07 +0000
committerThomas Lively <tlively@google.com>2018-10-05 00:58:07 +0000
commita347436f095904b958dbb01af5387ed79496ea45 (patch)
tree454664932f63f4cba48d576041a937f7a299f5e6 /clang/test/CodeGen/builtins-wasm.c
parentd6792c0c28b7516d5c90d3e98e394e51f9a0d472 (diff)
downloadbcm5719-llvm-a347436f095904b958dbb01af5387ed79496ea45.tar.gz
bcm5719-llvm-a347436f095904b958dbb01af5387ed79496ea45.zip
[WebAssembly] __builtin_wasm_replace_lane_* builtins
Summary: Depends on D52852. Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D52856 llvm-svn: 343835
Diffstat (limited to 'clang/test/CodeGen/builtins-wasm.c')
-rw-r--r--clang/test/CodeGen/builtins-wasm.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/clang/test/CodeGen/builtins-wasm.c b/clang/test/CodeGen/builtins-wasm.c
index a96f6705f73..6a4fcc10113 100644
--- a/clang/test/CodeGen/builtins-wasm.c
+++ b/clang/test/CodeGen/builtins-wasm.c
@@ -134,3 +134,41 @@ double f18(f64x2 v) {
// WEBASSEMBLY: extractelement <2 x double> %v, i32 1
// WEBASSEMBLY-NEXT: ret
}
+
+i8x16 f19(i8x16 v, int x) {
+ return __builtin_wasm_replace_lane_i8x16(v, 13, x);
+ // WEBASSEMBLY: trunc i32 %x to i8
+ // WEBASSEMBLY-NEXT: insertelement <16 x i8> %v, i8 %{{.*}}, i32 13
+ // WEBASSEMBLY-NEXT: ret
+}
+
+i16x8 f20(i16x8 v, int x) {
+ return __builtin_wasm_replace_lane_i16x8(v, 7, x);
+ // WEBASSEMBLY: trunc i32 %x to i16
+ // WEBASSEMBLY-NEXT: insertelement <8 x i16> %v, i16 %{{.*}}, i32 7
+ // WEBASSEMBLY-NEXT: ret
+}
+
+i32x4 f21(i32x4 v, int x) {
+ return __builtin_wasm_replace_lane_i32x4(v, 3, x);
+ // WEBASSEMBLY: insertelement <4 x i32> %v, i32 %x, i32 3
+ // WEBASSEMBLY-NEXT: ret
+}
+
+i64x2 f22(i64x2 v, long long x) {
+ return __builtin_wasm_replace_lane_i64x2(v, 1, x);
+ // WEBASSEMBLY: insertelement <2 x i64> %v, i64 %x, i32 1
+ // WEBASSEMBLY-NEXT: ret
+}
+
+f32x4 f23(f32x4 v, float x) {
+ return __builtin_wasm_replace_lane_f32x4(v, 3, x);
+ // WEBASSEMBLY: insertelement <4 x float> %v, float %x, i32 3
+ // WEBASSEMBLY-NEXT: ret
+}
+
+f64x2 f24(f64x2 v, double x) {
+ return __builtin_wasm_replace_lane_f64x2(v, 1, x);
+ // WEBASSEMBLY: insertelement <2 x double> %v, double %x, i32 1
+ // WEBASSEMBLY-NEXT: ret
+}
OpenPOWER on IntegriCloud