tlively created this revision.
tlively added reviewers: aheejin, dschuff.
Herald added subscribers: wingo, ecnelises, sunfish, hiraditya, 
jgravelle-google, sbc100.
tlively requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

Add tests checking that each SIMD intrinsic produces the expected instruction.
Assembly tests are generally discouraged in clang, but in this case we actually
care about the specific instruction being generated from the intrinsics. There
are nine problems with the current intrinsic codegen and they are marked in the
tests with FIXMEs.

Also fix the names of a few instructions to match the spec, fix the ordering of
*_const intrinsics, and add the missing wasm_i64x2_make intrinsic.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101684

Files:
  clang/lib/Headers/wasm_simd128.h
  clang/test/Headers/wasm.c
  llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
  llvm/test/CodeGen/WebAssembly/simd-intrinsics.ll
  llvm/test/MC/WebAssembly/simd-encodings.s

Index: llvm/test/MC/WebAssembly/simd-encodings.s
===================================================================
--- llvm/test/MC/WebAssembly/simd-encodings.s
+++ llvm/test/MC/WebAssembly/simd-encodings.s
@@ -313,8 +313,8 @@
     # CHECK: v128.load64_zero 32 # encoding: [0xfd,0x5d,0x03,0x20]
     v128.load64_zero 32
 
-    # CHECK: f32x4.demote_zero_f64x2 # encoding: [0xfd,0x5e]
-    f32x4.demote_zero_f64x2
+    # CHECK: f32x4.demote_f64x2_zero # encoding: [0xfd,0x5e]
+    f32x4.demote_f64x2_zero
 
     # CHECK: f64x2.promote_low_f32x4 # encoding: [0xfd,0x5f]
     f64x2.promote_low_f32x4
@@ -767,11 +767,11 @@
     # CHECK: f32x4.convert_i32x4_u # encoding: [0xfd,0xfb,0x01]
     f32x4.convert_i32x4_u
 
-    # CHECK: i32x4.trunc_sat_zero_f64x2_s # encoding: [0xfd,0xfc,0x01]
-    i32x4.trunc_sat_zero_f64x2_s
+    # CHECK: i32x4.trunc_sat_f64x2_s_zero # encoding: [0xfd,0xfc,0x01]
+    i32x4.trunc_sat_f64x2_s_zero
 
-    # CHECK: i32x4.trunc_sat_zero_f64x2_u # encoding: [0xfd,0xfd,0x01]
-    i32x4.trunc_sat_zero_f64x2_u
+    # CHECK: i32x4.trunc_sat_f64x2_u_zero # encoding: [0xfd,0xfd,0x01]
+    i32x4.trunc_sat_f64x2_u_zero
 
     # CHECK: f64x2.convert_low_i32x4_s # encoding: [0xfd,0xfe,0x01]
     f64x2.convert_low_i32x4_s
Index: llvm/test/CodeGen/WebAssembly/simd-intrinsics.ll
===================================================================
--- llvm/test/CodeGen/WebAssembly/simd-intrinsics.ll
+++ llvm/test/CodeGen/WebAssembly/simd-intrinsics.ll
@@ -530,24 +530,24 @@
   ret <4 x i32> %a
 }
 
-; CHECK-LABEL: trunc_sat_zero_s_v4i32:
-; CHECK-NEXT: .functype trunc_sat_zero_s_v4i32 (v128) -> (v128){{$}}
-; CHECK-NEXT: i32x4.trunc_sat_zero_f64x2_s $push[[R:[0-9]+]]=, $0{{$}}
+; CHECK-LABEL: trunc_sat_s_zero_v4i32:
+; CHECK-NEXT: .functype trunc_sat_s_zero_v4i32 (v128) -> (v128){{$}}
+; CHECK-NEXT: i32x4.trunc_sat_f64x2_s_zero $push[[R:[0-9]+]]=, $0{{$}}
 ; CHECK-NEXT: return $pop[[R]]{{$}}
 declare <2 x i32> @llvm.fptosi.sat.v2i32.v2f64(<2 x double>)
-define <4 x i32> @trunc_sat_zero_s_v4i32(<2 x double> %x) {
+define <4 x i32> @trunc_sat_s_zero_v4i32(<2 x double> %x) {
   %v = call <2 x i32> @llvm.fptosi.sat.v2i32.v2f64(<2 x double> %x)
   %a = shufflevector <2 x i32> %v, <2 x i32> <i32 0, i32 0>,
            <4 x i32> <i32 0, i32 1, i32 2, i32 3>
   ret <4 x i32> %a
 }
 
-; CHECK-LABEL: trunc_sat_zero_u_v4i32:
-; CHECK-NEXT: .functype trunc_sat_zero_u_v4i32 (v128) -> (v128){{$}}
-; CHECK-NEXT: i32x4.trunc_sat_zero_f64x2_u $push[[R:[0-9]+]]=, $0{{$}}
+; CHECK-LABEL: trunc_sat_u_zero_v4i32:
+; CHECK-NEXT: .functype trunc_sat_u_zero_v4i32 (v128) -> (v128){{$}}
+; CHECK-NEXT: i32x4.trunc_sat_f64x2_u_zero $push[[R:[0-9]+]]=, $0{{$}}
 ; CHECK-NEXT: return $pop[[R]]{{$}}
 declare <2 x i32> @llvm.fptoui.sat.v2i32.v2f64(<2 x double>)
-define <4 x i32> @trunc_sat_zero_u_v4i32(<2 x double> %x) {
+define <4 x i32> @trunc_sat_u_zero_v4i32(<2 x double> %x) {
   %v = call <2 x i32> @llvm.fptoui.sat.v2i32.v2f64(<2 x double> %x)
   %a = shufflevector <2 x i32> %v, <2 x i32> <i32 0, i32 0>,
            <4 x i32> <i32 0, i32 1, i32 2, i32 3>
@@ -724,7 +724,7 @@
 
 ; CHECK-LABEL: demote_zero_v4f32:
 ; CHECK-NEXT: .functype demote_zero_v4f32 (v128) -> (v128){{$}}
-; CHECK-NEXT: f32x4.demote_zero_f64x2 $push[[R:[0-9]+]]=, $0{{$}}
+; CHECK-NEXT: f32x4.demote_f64x2_zero $push[[R:[0-9]+]]=, $0{{$}}
 ; CHECK-NEXT: return $pop[[R]]{{$}}
 declare <4 x float> @llvm.wasm.demote.zero(<2 x double>)
 define <4 x float> @demote_zero_v4f32(<2 x double> %a) {
Index: llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
===================================================================
--- llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
+++ llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
@@ -1102,9 +1102,9 @@
   SDNode<"WebAssemblyISD::TRUNC_SAT_ZERO_S", trunc_sat_zero_t>;
 def trunc_sat_zero_u :
   SDNode<"WebAssemblyISD::TRUNC_SAT_ZERO_U", trunc_sat_zero_t>;
-defm "" : SIMDConvert<I32x4, F64x2, trunc_sat_zero_s, "trunc_sat_zero_f64x2_s",
+defm "" : SIMDConvert<I32x4, F64x2, trunc_sat_zero_s, "trunc_sat_f64x2_s_zero",
                       0xfc>;
-defm "" : SIMDConvert<I32x4, F64x2, trunc_sat_zero_u, "trunc_sat_zero_f64x2_u",
+defm "" : SIMDConvert<I32x4, F64x2, trunc_sat_zero_u, "trunc_sat_f64x2_u_zero",
                       0xfd>;
 
 // Integer to floating point: convert
@@ -1261,7 +1261,7 @@
 
 // Prototype f64x2 conversions
 defm "" : SIMDConvert<F32x4, F64x2, int_wasm_demote_zero,
-                      "demote_zero_f64x2", 0x5e>;
+                      "demote_f64x2_zero", 0x5e>;
 defm "" : SIMDConvert<F64x2, F32x4, int_wasm_promote_low,
                       "promote_low_f32x4", 0x5f>;
 
Index: clang/test/Headers/wasm.c
===================================================================
--- clang/test/Headers/wasm.c
+++ clang/test/Headers/wasm.c
@@ -1,1007 +1,1594 @@
-// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
 // REQUIRES: webassembly-registered-target
 // expected-no-diagnostics
 
-// RUN: %clang %s -S -emit-llvm -o - -target wasm32-unknown-unknown -msimd128 | FileCheck %s
+// RUN: %clang %s -O2 -S -o - -target wasm32-unknown-unknown -msimd128 | FileCheck %s
 
 #include <wasm_simd128.h>
 
-static v128_t test_v128_load(const void *mem) {
+// CHECK-LABEL: test_v128_load:
+// CHECK: v128.load 0:p2align=0{{$}}
+v128_t test_v128_load(const void *mem) {
   return wasm_v128_load(mem);
 }
 
-static v128_t test_v128_load8_splat(const void *mem) {
+// CHECK-LABEL: test_v128_load8_splat:
+// CHECK: v128.load8_splat 0{{$}}
+v128_t test_v128_load8_splat(const void *mem) {
   return wasm_v128_load8_splat(mem);
 }
 
-static v128_t test_v128_load16_splat(const void *mem) {
+// CHECK-LABEL: test_v128_load16_splat:
+// CHECK: v128.load16_splat 0:p2align=0{{$}}
+v128_t test_v128_load16_splat(const void *mem) {
   return wasm_v128_load16_splat(mem);
 }
 
-static v128_t test_v128_load32_splat(const void *mem) {
+// CHECK-LABEL: test_v128_load32_splat:
+// CHECK: v128.load32_splat 0:p2align=0{{$}}
+v128_t test_v128_load32_splat(const void *mem) {
   return wasm_v128_load32_splat(mem);
 }
 
-static v128_t test_v128_load64_splat(const void *mem) {
+// CHECK-LABEL: test_v128_load64_splat:
+// CHECK: v128.load64_splat 0:p2align=0{{$}}
+v128_t test_v128_load64_splat(const void *mem) {
   return wasm_v128_load64_splat(mem);
 }
 
-static v128_t test_i16x8_load8x8(const void *mem) {
+// CHECK-LABEL: test_i16x8_load8x8:
+// CHECK: i16x8.load8x8_s 0:p2align=0{{$}}
+v128_t test_i16x8_load8x8(const void *mem) {
   return wasm_i16x8_load8x8(mem);
 }
 
-static v128_t test_u16x8_load8x8(const void *mem) {
+// CHECK-LABEL: test_u16x8_load8x8:
+// CHECK: i16x8.load8x8_u 0:p2align=0{{$}}
+v128_t test_u16x8_load8x8(const void *mem) {
   return wasm_u16x8_load8x8(mem);
 }
 
-static v128_t test_i32x4_load16x4(const void *mem) {
+// CHECK-LABEL: test_i32x4_load16x4:
+// CHECK: i32x4.load16x4_s 0:p2align=0{{$}}
+v128_t test_i32x4_load16x4(const void *mem) {
   return wasm_i32x4_load16x4(mem);
 }
 
-static v128_t test_u32x4_load16x4(const void *mem) {
+// CHECK-LABEL: test_u32x4_load16x4:
+// CHECK: i32x4.load16x4_u 0:p2align=0{{$}}
+v128_t test_u32x4_load16x4(const void *mem) {
   return wasm_u32x4_load16x4(mem);
 }
 
-static v128_t test_i64x2_load32x2(const void *mem) {
+// CHECK-LABEL: test_i64x2_load32x2:
+// CHECK: i64x2.load32x2_s 0:p2align=0{{$}}
+v128_t test_i64x2_load32x2(const void *mem) {
   return wasm_i64x2_load32x2(mem);
 }
 
-static v128_t test_u64x2_load32x2(const void *mem) {
+// CHECK-LABEL: test_u64x2_load32x2:
+// CHECK: i64x2.load32x2_u 0:p2align=0{{$}}
+v128_t test_u64x2_load32x2(const void *mem) {
   return wasm_u64x2_load32x2(mem);
 }
 
-static v128_t test_v128_load32_zero(const void *mem) {
+// CHECK-LABEL: test_v128_load32_zero:
+// CHECK:      v128.const 0, 0, 0, 0{{$}}
+// CHECK-NEXT: local.get  0{{$}}
+// CHECK-NEXT: i32.load   0:p2align=0{{$}}
+// CHECK-NEXT: i32x4.replace_lane 0{{$}}
+// FIXME: v128.load32_zero 0:p2align=0{{$}}
+v128_t test_v128_load32_zero(const void *mem) {
   return wasm_v128_load32_zero(mem);
 }
 
-static v128_t test_v128_load64_zero(const void *mem) {
+// CHECK-LABEL: test_v128_load64_zero:
+// CHECK:      v128.const 0, 0{{$}}
+// CHECK-NEXT: local.get  0{{$}}
+// CHECK-NEXT: i64.load   0:p2align=0{{$}}
+// CHECK-NEXT: i64x2.replace_lane 0{{$}}
+// FIXME: v128.load64_zero 0:p2align=0{{$}}
+v128_t test_v128_load64_zero(const void *mem) {
   return wasm_v128_load64_zero(mem);
 }
 
-static v128_t test_v128_load8_lane(uint8_t *ptr, v128_t vec) {
+// CHECK-LABEL: test_v128_load8_lane:
+// CHECK: v128.load8_lane 0, 15{{$}}
+v128_t test_v128_load8_lane(uint8_t *ptr, v128_t vec) {
   return wasm_v128_load8_lane(ptr, vec, 15);
 }
 
-static v128_t test_v128_load16_lane(uint16_t *ptr, v128_t vec) {
+// CHECK-LABEL: test_v128_load16_lane:
+// CHECK: v128.load16_lane 0, 7{{$}}
+// FIXME: v128.load16_lane 0:p2align=0, 7{{$}}
+v128_t test_v128_load16_lane(uint16_t *ptr, v128_t vec) {
   return wasm_v128_load16_lane(ptr, vec, 7);
 }
 
-static v128_t test_v128_load32_lane(uint32_t *ptr, v128_t vec) {
+// CHECK-LABEL: test_v128_load32_lane:
+// CHECK: v128.load32_lane 0, 3{{$}}
+// FIXME: v128.load32_lane 0:p2align=0, 3{{$}}
+v128_t test_v128_load32_lane(uint32_t *ptr, v128_t vec) {
   return wasm_v128_load32_lane(ptr, vec, 3);
 }
 
-static v128_t test_v128_load64_lane(uint64_t *ptr, v128_t vec) {
+// CHECK-LABEL: test_v128_load64_lane:
+// CHECK: v128.load64_lane 0, 1{{$}}
+// FIXME: v128.load64_lane 0:p2align=0, 1{{$}}
+v128_t test_v128_load64_lane(uint64_t *ptr, v128_t vec) {
   return wasm_v128_load64_lane(ptr, vec, 1);
 }
 
-static void test_v128_store(void *mem, v128_t a) {
+// CHECK-LABEL: test_v128_store:
+// CHECK: v128.store 0:p2align=0{{$}}
+void test_v128_store(void *mem, v128_t a) {
   return wasm_v128_store(mem, a);
 }
 
-static void test_v128_store8_lane(uint8_t *ptr, v128_t vec) {
+// CHECK-LABEL: test_v128_store8_lane:
+// CHECK: v128.store8_lane 0, 15{{$}}
+void test_v128_store8_lane(uint8_t *ptr, v128_t vec) {
   return wasm_v128_store8_lane(ptr, vec, 15);
 }
 
-static void test_v128_store16_lane(uint16_t *ptr, v128_t vec) {
+// CHECK-LABEL: test_v128_store16_lane:
+// CHECK: v128.store16_lane 0, 7{{$}}
+// FIXME: v128.store16_lane 0:p2align=0, 7{{$}}
+void test_v128_store16_lane(uint16_t *ptr, v128_t vec) {
   return wasm_v128_store16_lane(ptr, vec, 7);
 }
 
-static void test_v128_store32_lane(uint32_t *ptr, v128_t vec) {
+// CHECK-LABEL: test_v128_store32_lane:
+// CHECK: v128.store32_lane 0, 3{{$}}
+// FIXME: v128.store32_lane 0:p2align=0, 3{{$}}
+void test_v128_store32_lane(uint32_t *ptr, v128_t vec) {
   return wasm_v128_store32_lane(ptr, vec, 3);
 }
 
-static void test_v128_store64_lane(uint64_t *ptr, v128_t vec) {
+// CHECK-LABEL: test_v128_store64_lane:
+// CHECK: v128.store64_lane 0, 1{{$}}
+// FIXME: v128.store64_lane 0:p2align=0, 1{{$}}
+void test_v128_store64_lane(uint64_t *ptr, v128_t vec) {
   return wasm_v128_store64_lane(ptr, vec, 1);
 }
 
-static v128_t test_i8x16_make(int8_t c0, int8_t c1, int8_t c2, int8_t c3, int8_t c4, int8_t c5, int8_t c6, int8_t c7, int8_t c8, int8_t c9, int8_t c10, int8_t c11, int8_t c12, int8_t c13, int8_t c14, int8_t c15) {
+// CHECK-LABEL: test_i8x16_make:
+// CHECK:      local.get 0{{$}}
+// CHECK-NEXT: i8x16.splat{{$}}
+// CHECK-NEXT: local.get 1{{$}}
+// CHECK-NEXT: i8x16.replace_lane 1{{$}}
+// CHECK-NEXT: local.get 2{{$}}
+// CHECK-NEXT: i8x16.replace_lane 2{{$}}
+// CHECK-NEXT: local.get 3{{$}}
+// CHECK-NEXT: i8x16.replace_lane 3{{$}}
+// CHECK-NEXT: local.get 4{{$}}
+// CHECK-NEXT: i8x16.replace_lane 4{{$}}
+// CHECK-NEXT: local.get 5{{$}}
+// CHECK-NEXT: i8x16.replace_lane 5{{$}}
+// CHECK-NEXT: local.get 6{{$}}
+// CHECK-NEXT: i8x16.replace_lane 6{{$}}
+// CHECK-NEXT: local.get 7{{$}}
+// CHECK-NEXT: i8x16.replace_lane 7{{$}}
+// CHECK-NEXT: local.get 8{{$}}
+// CHECK-NEXT: i8x16.replace_lane 8{{$}}
+// CHECK-NEXT: local.get 9{{$}}
+// CHECK-NEXT: i8x16.replace_lane 9{{$}}
+// CHECK-NEXT: local.get 10{{$}}
+// CHECK-NEXT: i8x16.replace_lane 10{{$}}
+// CHECK-NEXT: local.get 11{{$}}
+// CHECK-NEXT: i8x16.replace_lane 11{{$}}
+// CHECK-NEXT: local.get 12{{$}}
+// CHECK-NEXT: i8x16.replace_lane 12{{$}}
+// CHECK-NEXT: local.get 13{{$}}
+// CHECK-NEXT: i8x16.replace_lane 13{{$}}
+// CHECK-NEXT: local.get 14{{$}}
+// CHECK-NEXT: i8x16.replace_lane 14{{$}}
+// CHECK-NEXT: local.get 15{{$}}
+// CHECK-NEXT: i8x16.replace_lane 15{{$}}
+v128_t test_i8x16_make(int8_t c0, int8_t c1, int8_t c2, int8_t c3, int8_t c4, int8_t c5, int8_t c6, int8_t c7, int8_t c8, int8_t c9, int8_t c10, int8_t c11, int8_t c12, int8_t c13, int8_t c14, int8_t c15) {
   return wasm_i8x16_make(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15);
 }
 
-static v128_t test_i16x8_make(int16_t c0, int16_t c1, int16_t c2, int16_t c3, int16_t c4, int16_t c5, int16_t c6, int16_t c7) {
+// CHECK-LABEL: test_i16x8_make:
+// CHECK:      local.get 0{{$}}
+// CHECK-NEXT: i16x8.splat{{$}}
+// CHECK-NEXT: local.get 1{{$}}
+// CHECK-NEXT: i16x8.replace_lane 1{{$}}
+// CHECK-NEXT: local.get 2{{$}}
+// CHECK-NEXT: i16x8.replace_lane 2{{$}}
+// CHECK-NEXT: local.get 3{{$}}
+// CHECK-NEXT: i16x8.replace_lane 3{{$}}
+// CHECK-NEXT: local.get 4{{$}}
+// CHECK-NEXT: i16x8.replace_lane 4{{$}}
+// CHECK-NEXT: local.get 5{{$}}
+// CHECK-NEXT: i16x8.replace_lane 5{{$}}
+// CHECK-NEXT: local.get 6{{$}}
+// CHECK-NEXT: i16x8.replace_lane 6{{$}}
+// CHECK-NEXT: local.get 7{{$}}
+// CHECK-NEXT: i16x8.replace_lane 7{{$}}
+v128_t test_i16x8_make(int16_t c0, int16_t c1, int16_t c2, int16_t c3, int16_t c4, int16_t c5, int16_t c6, int16_t c7) {
   return wasm_i16x8_make(c0, c1, c2, c3, c4, c5, c6, c7);
 }
 
-static v128_t test_i32x4_make(int32_t c0, int32_t c1, int32_t c2, int32_t c3) {
+// CHECK-LABEL: test_i32x4_make:
+// CHECK:      local.get 0{{$}}
+// CHECK-NEXT: i32x4.splat{{$}}
+// CHECK-NEXT: local.get 1{{$}}
+// CHECK-NEXT: i32x4.replace_lane 1{{$}}
+// CHECK-NEXT: local.get 2{{$}}
+// CHECK-NEXT: i32x4.replace_lane 2{{$}}
+// CHECK-NEXT: local.get 3{{$}}
+// CHECK-NEXT: i32x4.replace_lane 3{{$}}
+v128_t test_i32x4_make(int32_t c0, int32_t c1, int32_t c2, int32_t c3) {
   return wasm_i32x4_make(c0, c1, c2, c3);
 }
 
-static v128_t test_f32x4_make(float c0, float c1, float c2, float c3) {
-  return wasm_f32x4_make(c0, c1, c2, c3);
+// CHECK-LABEL: test_i64x2_make:
+// CHECK:      local.get 0{{$}}
+// CHECK-NEXT: i64x2.splat{{$}}
+// CHECK-NEXT: local.get 1{{$}}
+// CHECK-NEXT: i64x2.replace_lane 1{{$}}
+v128_t test_i64x2_make(int64_t c0, int64_t c1) {
+  return wasm_i64x2_make(c0, c1);
 }
 
-static v128_t test_i64x2_make(int64_t c0, int64_t c1) {
-  return wasm_i64x2_make(c0, c1);
+// CHECK-LABEL: test_f32x4_make:
+// CHECK:      local.get 0{{$}}
+// CHECK-NEXT: f32x4.splat{{$}}
+// CHECK-NEXT: local.get 1{{$}}
+// CHECK-NEXT: f32x4.replace_lane 1{{$}}
+// CHECK-NEXT: local.get 2{{$}}
+// CHECK-NEXT: f32x4.replace_lane 2{{$}}
+// CHECK-NEXT: local.get 3{{$}}
+// CHECK-NEXT: f32x4.replace_lane 3{{$}}
+v128_t test_f32x4_make(float c0, float c1, float c2, float c3) {
+  return wasm_f32x4_make(c0, c1, c2, c3);
 }
 
-static v128_t test_f64x2_make(double c0, double c1) {
+// CHECK-LABEL: test_f64x2_make:
+// CHECK:      local.get 0{{$}}
+// CHECK-NEXT: f64x2.splat{{$}}
+// CHECK-NEXT: local.get 1{{$}}
+// CHECK-NEXT: f64x2.replace_lane 1{{$}}
+v128_t test_f64x2_make(double c0, double c1) {
   return wasm_f64x2_make(c0, c1);
 }
 
-static v128_t test_i8x16_const() {
+// CHECK-LABEL: test_i8x16_const:
+// CHECK: v128.const 50462976, 117835012, 185207048, 252579084{{$}}
+v128_t test_i8x16_const() {
   return wasm_i8x16_const(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
 }
 
-static v128_t test_i16x8_const() {
+// CHECK-LABEL: test_i16x8_const:
+// CHECK: v128.const 65536, 196610, 327684, 458758{{$}}
+v128_t test_i16x8_const() {
   return wasm_i16x8_const(0, 1, 2, 3, 4, 5, 6, 7);
 }
 
-static v128_t test_i32x4_const() {
+// CHECK-LABEL: test_i32x4_const:
+// CHECK: v128.const 0, 1, 2, 3{{$}}
+v128_t test_i32x4_const() {
   return wasm_i32x4_const(0, 1, 2, 3);
 }
 
-static v128_t test_f32x4_const() {
-  return wasm_f32x4_const(0, 1, 2, 3);
+// CHECK-LABEL: test_i64x2_const:
+// CHECK: v128.const 0, 0, 1, 0{{$}}
+v128_t test_i64x2_const() {
+  return wasm_i64x2_const(0, 1);
 }
 
-static v128_t test_i64x2_const() {
-  return wasm_i64x2_const(0, 1);
+// CHECK-LABEL: test_f32x4_const:
+// CHECK: v128.const 0, 1065353216, 1073741824, 1077936128{{$}}
+v128_t test_f32x4_const() {
+  return wasm_f32x4_const(0, 1, 2, 3);
 }
 
-static v128_t test_f64x2_const() {
+// CHECK-LABEL: test_f64x2_const:
+// CHECK: v128.const 0, 0, 0, 1072693248{{$}}
+v128_t test_f64x2_const() {
   return wasm_f64x2_const(0, 1);
 }
 
-static v128_t test_i8x16_splat(int8_t a) {
+// CHECK-LABEL: test_i8x16_splat:
+// CHECK: i8x16.splat{{$}}
+v128_t test_i8x16_splat(int8_t a) {
   return wasm_i8x16_splat(a);
 }
 
-static int8_t test_i8x16_extract_lane(vec128_t a) {
+// CHECK-LABEL: test_i8x16_extract_lane:
+// CHECK: i8x16.extract_lane_s 15{{$}}
+int8_t test_i8x16_extract_lane(v128_t a) {
   return wasm_i8x16_extract_lane(a, 15);
 }
 
-static uint8_t test_u8x16_extract_lane(v128_t a) {
+// CHECK-LABEL: test_u8x16_extract_lane:
+// CHECK: i8x16.extract_lane_u 15{{$}}
+uint8_t test_u8x16_extract_lane(v128_t a) {
   return wasm_u8x16_extract_lane(a, 15);
 }
 
-static v128_t test_i8x16_replace_lane(v128_t a, i, b) {
-  return wasm_i8x16_replace_lane(a, i, b);
+// CHECK-LABEL: test_i8x16_replace_lane:
+// CHECK: i8x16.replace_lane 15{{$}}
+v128_t test_i8x16_replace_lane(v128_t a, int8_t b) {
+  return wasm_i8x16_replace_lane(a, 15, b);
 }
 
-static v128_t test_i16x8_splat(int16_t a) {
-  return wasm_i16x8_splat(int16_t a);
+// CHECK-LABEL: test_i16x8_splat:
+// CHECK: i16x8.splat{{$}}
+v128_t test_i16x8_splat(int16_t a) {
+  return wasm_i16x8_splat(a);
 }
 
-static int16_t test_i16x8_extract_lane(v128_t a, i) {
-  return wasm_i16x8_extract_lane(a, i);
+// CHECK-LABEL: test_i16x8_extract_lane:
+// CHECK: i16x8.extract_lane_s 7{{$}}
+int16_t test_i16x8_extract_lane(v128_t a) {
+  return wasm_i16x8_extract_lane(a, 7);
 }
 
-static uint16_t test_u16x8_extract_lane(v128_t a, i) {
-  return wasm_u16x8_extract_lane(a, i);
+// CHECK-LABEL: test_u16x8_extract_lane:
+// CHECK: i16x8.extract_lane_u 7{{$}}
+uint16_t test_u16x8_extract_lane(v128_t a) {
+  return wasm_u16x8_extract_lane(a, 7);
 }
 
-static v128_t test_i16x8_replace_lane(v128_t a, i, b) {
-  return wasm_i16x8_replace_lane(a, i, b);
+// CHECK-LABEL: test_i16x8_replace_lane:
+// CHECK: i16x8.replace_lane 7{{$}}
+v128_t test_i16x8_replace_lane(v128_t a, int16_t b) {
+  return wasm_i16x8_replace_lane(a, 7, b);
 }
 
-static v128_t test_i32x4_splat(int32_t a) {
-  return wasm_i32x4_splat(int32_t a);
+// CHECK-LABEL: test_i32x4_splat:
+// CHECK: i32x4.splat{{$}}
+v128_t test_i32x4_splat(int32_t a) {
+  return wasm_i32x4_splat(a);
 }
 
-static int32_t test_i32x4_extract_lane(v128_t a, i) {
-  return wasm_i32x4_extract_lane(a, i);
+// CHECK-LABEL: test_i32x4_extract_lane:
+// CHECK: i32x4.extract_lane 3{{$}}
+int32_t test_i32x4_extract_lane(v128_t a) {
+  return wasm_i32x4_extract_lane(a, 3);
 }
 
-static v128_t test_i32x4_replace_lane(v128_t a, i, b) {
-  return wasm_i32x4_replace_lane(a, i, b);
+// CHECK-LABEL: test_i32x4_replace_lane:
+// CHECK: i32x4.replace_lane 3{{$}}
+v128_t test_i32x4_replace_lane(v128_t a, int32_t b) {
+  return wasm_i32x4_replace_lane(a, 3, b);
 }
 
-static v128_t test_i64x2_splat(int64_t a) {
-  return wasm_i64x2_splat(int64_t a);
+// CHECK-LABEL: test_i64x2_splat:
+// CHECK: i64x2.splat{{$}}
+v128_t test_i64x2_splat(int64_t a) {
+  return wasm_i64x2_splat(a);
 }
 
-static int64_t test_i64x2_extract_lane(v128_t a, i) {
-  return wasm_i64x2_extract_lane(a, i);
+// CHECK-LABEL: test_i64x2_extract_lane:
+// CHECK: i64x2.extract_lane 1{{$}}
+int64_t test_i64x2_extract_lane(v128_t a) {
+  return wasm_i64x2_extract_lane(a, 1);
 }
 
-static v128_t test_i64x2_replace_lane(v128_t a, i, b){
-  return wasm_i64x2_replace_lane(a, i, b);
+// CHECK-LABEL: test_i64x2_replace_lane:
+// CHECK: i64x2.replace_lane 1{{$}}
+v128_t test_i64x2_replace_lane(v128_t a, int64_t b) {
+  return wasm_i64x2_replace_lane(a, 1, b);
 }
 
-static v128_t test_f32x4_splat(float a) {
-  return wasm_f32x4_splat(float a);
+// CHECK-LABEL: test_f32x4_splat:
+// CHECK: f32x4.splat{{$}}
+v128_t test_f32x4_splat(float a) {
+  return wasm_f32x4_splat(a);
 }
 
-static float test_f32x4_extract_lane(v128_t a, i) {
-  return wasm_f32x4_extract_lane(a, i);
+// CHECK-LABEL: test_f32x4_extract_lane:
+// CHECK: f32x4.extract_lane 3{{$}}
+float test_f32x4_extract_lane(v128_t a) {
+  return wasm_f32x4_extract_lane(a, 3);
 }
 
-static v128_t test_f32x4_replace_lane(v128_t a, i, b) {
-  return wasm_f32x4_replace_lane(a, i, b);
+// CHECK-LABEL: test_f32x4_replace_lane:
+// CHECK: f32x4.replace_lane 3{{$}}
+v128_t test_f32x4_replace_lane(v128_t a, float b) {
+  return wasm_f32x4_replace_lane(a, 3, b);
 }
 
-static v128_t test_f64x2_splat(double a) {
-  return wasm_f64x2_splat(double a);
+// CHECK-LABEL: test_f64x2_splat:
+// CHECK: f64x2.splat{{$}}
+v128_t test_f64x2_splat(double a) {
+  return wasm_f64x2_splat(a);
 }
 
-static double test_f64x2_extract_lane(v128_t a, i) {
-  return wasm_f64x2_extract_lane(a, i);
+// CHECK-LABEL: test_f64x2_extract_lane:
+// CHECK: f64x2.extract_lane 1{{$}}
+double test_f64x2_extract_lane(v128_t a) {
+  return wasm_f64x2_extract_lane(a, 1);
 }
 
-static v128_t test_f64x2_replace_lane(v128_t a, i, b) {
-  return wasm_f64x2_replace_lane(a, i, b);
+// CHECK-LABEL: test_f64x2_replace_lane:
+// CHECK: f64x2.replace_lane 1{{$}}
+v128_t test_f64x2_replace_lane(v128_t a, double b) {
+  return wasm_f64x2_replace_lane(a, 1, b);
 }
 
-static v128_t test_i8x16_eq(v128_t a, v128_t b) {
-  return wasm_i8x16_eq(v128_t a, v128_t b);
+// CHECK-LABEL: test_i8x16_eq:
+// CHECK: i8x16.eq{{$}}
+v128_t test_i8x16_eq(v128_t a, v128_t b) {
+  return wasm_i8x16_eq(a, b);
 }
 
-static v128_t test_i8x16_ne(v128_t a, v128_t b) {
-  return wasm_i8x16_ne(v128_t a, v128_t b);
+// CHECK-LABEL: test_i8x16_ne:
+// CHECK: i8x16.ne{{$}}
+v128_t test_i8x16_ne(v128_t a, v128_t b) {
+  return wasm_i8x16_ne(a, b);
 }
 
-static v128_t test_i8x16_lt(v128_t a, v128_t b) {
-  return wasm_i8x16_lt(v128_t a, v128_t b);
+// CHECK-LABEL: test_i8x16_lt:
+// CHECK: i8x16.lt_s{{$}}
+v128_t test_i8x16_lt(v128_t a, v128_t b) {
+  return wasm_i8x16_lt(a, b);
 }
 
-static v128_t test_u8x16_lt(v128_t a, v128_t b) {
-  return wasm_u8x16_lt(v128_t a, v128_t b);
+// CHECK-LABEL: test_u8x16_lt:
+// CHECK: i8x16.lt_u{{$}}
+v128_t test_u8x16_lt(v128_t a, v128_t b) {
+  return wasm_u8x16_lt(a, b);
 }
 
-static v128_t test_i8x16_gt(v128_t a, v128_t b) {
-  return wasm_i8x16_gt(v128_t a, v128_t b);
+// CHECK-LABEL: test_i8x16_gt:
+// CHECK: i8x16.gt_s{{$}}
+v128_t test_i8x16_gt(v128_t a, v128_t b) {
+  return wasm_i8x16_gt(a, b);
 }
 
-static v128_t test_u8x16_gt(v128_t a, v128_t b) {
-  return wasm_u8x16_gt(v128_t a, v128_t b);
+// CHECK-LABEL: test_u8x16_gt:
+// CHECK: i8x16.gt_u{{$}}
+v128_t test_u8x16_gt(v128_t a, v128_t b) {
+  return wasm_u8x16_gt(a, b);
 }
 
-static v128_t test_i8x16_le(v128_t a, v128_t b) {
-  return wasm_i8x16_le(v128_t a, v128_t b);
+// CHECK-LABEL: test_i8x16_le:
+// CHECK: i8x16.le_s{{$}}
+v128_t test_i8x16_le(v128_t a, v128_t b) {
+  return wasm_i8x16_le(a, b);
 }
 
-static v128_t test_u8x16_le(v128_t a, v128_t b) {
-  return wasm_u8x16_le(v128_t a, v128_t b);
+// CHECK-LABEL: test_u8x16_le:
+// CHECK: i8x16.le_u{{$}}
+v128_t test_u8x16_le(v128_t a, v128_t b) {
+  return wasm_u8x16_le(a, b);
 }
 
-static v128_t test_i8x16_ge(v128_t a, v128_t b) {
-  return wasm_i8x16_ge(v128_t a, v128_t b);
+// CHECK-LABEL: test_i8x16_ge:
+// CHECK: i8x16.ge_s{{$}}
+v128_t test_i8x16_ge(v128_t a, v128_t b) {
+  return wasm_i8x16_ge(a, b);
 }
 
-static v128_t test_u8x16_ge(v128_t a, v128_t b) {
-  return wasm_u8x16_ge(v128_t a, v128_t b);
+// CHECK-LABEL: test_u8x16_ge:
+// CHECK: i8x16.ge_u{{$}}
+v128_t test_u8x16_ge(v128_t a, v128_t b) {
+  return wasm_u8x16_ge(a, b);
 }
 
-static v128_t test_i16x8_eq(v128_t a, v128_t b) {
-  return wasm_i16x8_eq(v128_t a, v128_t b);
+// CHECK-LABEL: test_i16x8_eq:
+// CHECK: i16x8.eq{{$}}
+v128_t test_i16x8_eq(v128_t a, v128_t b) {
+  return wasm_i16x8_eq(a, b);
 }
 
-static v128_t test_i16x8_ne(v128_t a, v128_t b) {
-  return wasm_i16x8_ne(v128_t a, v128_t b);
+// CHECK-LABEL: test_i16x8_ne:
+// CHECK: i16x8.ne{{$}}
+v128_t test_i16x8_ne(v128_t a, v128_t b) {
+  return wasm_i16x8_ne(a, b);
 }
 
-static v128_t test_i16x8_lt(v128_t a, v128_t b) {
-  return wasm_i16x8_lt(v128_t a, v128_t b);
+// CHECK-LABEL: test_i16x8_lt:
+// CHECK: i16x8.lt_s{{$}}
+v128_t test_i16x8_lt(v128_t a, v128_t b) {
+  return wasm_i16x8_lt(a, b);
 }
 
-static v128_t test_u16x8_lt(v128_t a, v128_t b) {
-  return wasm_u16x8_lt(v128_t a, v128_t b);
+// CHECK-LABEL: test_u16x8_lt:
+// CHECK: i16x8.lt_u{{$}}
+v128_t test_u16x8_lt(v128_t a, v128_t b) {
+  return wasm_u16x8_lt(a, b);
 }
 
-static v128_t test_i16x8_gt(v128_t a, v128_t b) {
-  return wasm_i16x8_gt(v128_t a, v128_t b);
+// CHECK-LABEL: test_i16x8_gt:
+// CHECK: i16x8.gt_s{{$}}
+v128_t test_i16x8_gt(v128_t a, v128_t b) {
+  return wasm_i16x8_gt(a, b);
 }
 
-static v128_t test_u16x8_gt(v128_t a, v128_t b) {
-  return wasm_u16x8_gt(v128_t a, v128_t b);
+// CHECK-LABEL: test_u16x8_gt:
+// CHECK: i16x8.gt_u{{$}}
+v128_t test_u16x8_gt(v128_t a, v128_t b) {
+  return wasm_u16x8_gt(a, b);
 }
 
-static v128_t test_i16x8_le(v128_t a, v128_t b) {
-  return wasm_i16x8_le(v128_t a, v128_t b);
+// CHECK-LABEL: test_i16x8_le:
+// CHECK: i16x8.le_s{{$}}
+v128_t test_i16x8_le(v128_t a, v128_t b) {
+  return wasm_i16x8_le(a, b);
 }
 
-static v128_t test_u16x8_le(v128_t a, v128_t b) {
-  return wasm_u16x8_le(v128_t a, v128_t b);
+// CHECK-LABEL: test_u16x8_le:
+// CHECK: i16x8.le_u{{$}}
+v128_t test_u16x8_le(v128_t a, v128_t b) {
+  return wasm_u16x8_le(a, b);
 }
 
-static v128_t test_i16x8_ge(v128_t a, v128_t b) {
-  return wasm_i16x8_ge(v128_t a, v128_t b);
+// CHECK-LABEL: test_i16x8_ge:
+// CHECK: i16x8.ge_s{{$}}
+v128_t test_i16x8_ge(v128_t a, v128_t b) {
+  return wasm_i16x8_ge(a, b);
 }
 
-static v128_t test_u16x8_ge(v128_t a, v128_t b) {
-  return wasm_u16x8_ge(v128_t a, v128_t b);
+// CHECK-LABEL: test_u16x8_ge:
+// CHECK: i16x8.ge_u{{$}}
+v128_t test_u16x8_ge(v128_t a, v128_t b) {
+  return wasm_u16x8_ge(a, b);
 }
 
-static v128_t test_i32x4_eq(v128_t a, v128_t b) {
-  return wasm_i32x4_eq(v128_t a, v128_t b);
+// CHECK-LABEL: test_i32x4_eq:
+// CHECK: i32x4.eq{{$}}
+v128_t test_i32x4_eq(v128_t a, v128_t b) {
+  return wasm_i32x4_eq(a, b);
 }
 
-static v128_t test_i32x4_ne(v128_t a, v128_t b) {
-  return wasm_i32x4_ne(v128_t a, v128_t b);
+// CHECK-LABEL: test_i32x4_ne:
+// CHECK: i32x4.ne{{$}}
+v128_t test_i32x4_ne(v128_t a, v128_t b) {
+  return wasm_i32x4_ne(a, b);
 }
 
-static v128_t test_i32x4_lt(v128_t a, v128_t b) {
-  return wasm_i32x4_lt(v128_t a, v128_t b);
+// CHECK-LABEL: test_i32x4_lt:
+// CHECK: i32x4.lt_s{{$}}
+v128_t test_i32x4_lt(v128_t a, v128_t b) {
+  return wasm_i32x4_lt(a, b);
 }
 
-static v128_t test_u32x4_lt(v128_t a, v128_t b) {
-  return wasm_u32x4_lt(v128_t a, v128_t b);
+// CHECK-LABEL: test_u32x4_lt:
+// CHECK: i32x4.lt_u{{$}}
+v128_t test_u32x4_lt(v128_t a, v128_t b) {
+  return wasm_u32x4_lt(a, b);
 }
 
-static v128_t test_i32x4_gt(v128_t a, v128_t b) {
-  return wasm_i32x4_gt(v128_t a, v128_t b);
+// CHECK-LABEL: test_i32x4_gt:
+// CHECK: i32x4.gt_s{{$}}
+v128_t test_i32x4_gt(v128_t a, v128_t b) {
+  return wasm_i32x4_gt(a, b);
 }
 
-static v128_t test_u32x4_gt(v128_t a, v128_t b) {
-  return wasm_u32x4_gt(v128_t a, v128_t b);
+// CHECK-LABEL: test_u32x4_gt:
+// CHECK: i32x4.gt_u{{$}}
+v128_t test_u32x4_gt(v128_t a, v128_t b) {
+  return wasm_u32x4_gt(a, b);
 }
 
-static v128_t test_i32x4_le(v128_t a, v128_t b) {
-  return wasm_i32x4_le(v128_t a, v128_t b);
+// CHECK-LABEL: test_i32x4_le:
+// CHECK: i32x4.le_s{{$}}
+v128_t test_i32x4_le(v128_t a, v128_t b) {
+  return wasm_i32x4_le(a, b);
 }
 
-static v128_t test_u32x4_le(v128_t a, v128_t b) {
-  return wasm_u32x4_le(v128_t a, v128_t b);
+// CHECK-LABEL: test_u32x4_le:
+// CHECK: i32x4.le_u{{$}}
+v128_t test_u32x4_le(v128_t a, v128_t b) {
+  return wasm_u32x4_le(a, b);
 }
 
-static v128_t test_i32x4_ge(v128_t a, v128_t b) {
-  return wasm_i32x4_ge(v128_t a, v128_t b);
+// CHECK-LABEL: test_i32x4_ge:
+// CHECK: i32x4.ge_s{{$}}
+v128_t test_i32x4_ge(v128_t a, v128_t b) {
+  return wasm_i32x4_ge(a, b);
 }
 
-static v128_t test_u32x4_ge(v128_t a, v128_t b) {
-  return wasm_u32x4_ge(v128_t a, v128_t b);
+// CHECK-LABEL: test_u32x4_ge:
+// CHECK: i32x4.ge_u{{$}}
+v128_t test_u32x4_ge(v128_t a, v128_t b) {
+  return wasm_u32x4_ge(a, b);
 }
 
-static v128_t test_i64x2_eq(v128_t a, v128_t b) {
-  return wasm_i64x2_eq(v128_t a, v128_t b);
+// CHECK-LABEL: test_i64x2_eq:
+// CHECK: i64x2.eq{{$}}
+v128_t test_i64x2_eq(v128_t a, v128_t b) {
+  return wasm_i64x2_eq(a, b);
 }
 
-static v128_t test_i64x2_ne(v128_t a, v128_t b) {
-  return wasm_i64x2_ne(v128_t a, v128_t b);
+// CHECK-LABEL: test_i64x2_ne:
+// CHECK: i64x2.ne{{$}}
+v128_t test_i64x2_ne(v128_t a, v128_t b) {
+  return wasm_i64x2_ne(a, b);
 }
 
-static v128_t test_i64x2_lt(v128_t a, v128_t b) {
-  return wasm_i64x2_lt(v128_t a, v128_t b);
+// CHECK-LABEL: test_i64x2_lt:
+// CHECK: i64x2.lt_s{{$}}
+v128_t test_i64x2_lt(v128_t a, v128_t b) {
+  return wasm_i64x2_lt(a, b);
 }
 
-static v128_t test_i64x2_gt(v128_t a, v128_t b) {
-  return wasm_i64x2_gt(v128_t a, v128_t b);
+// CHECK-LABEL: test_i64x2_gt:
+// CHECK: i64x2.gt_s{{$}}
+v128_t test_i64x2_gt(v128_t a, v128_t b) {
+  return wasm_i64x2_gt(a, b);
 }
 
-static v128_t test_i64x2_le(v128_t a, v128_t b) {
-  return wasm_i64x2_le(v128_t a, v128_t b);
+// CHECK-LABEL: test_i64x2_le:
+// CHECK: i64x2.le_s{{$}}
+v128_t test_i64x2_le(v128_t a, v128_t b) {
+  return wasm_i64x2_le(a, b);
 }
 
-static v128_t test_i64x2_ge(v128_t a, v128_t b) {
-  return wasm_i64x2_ge(v128_t a, v128_t b);
+// CHECK-LABEL: test_i64x2_ge:
+// CHECK: i64x2.ge_s{{$}}
+v128_t test_i64x2_ge(v128_t a, v128_t b) {
+  return wasm_i64x2_ge(a, b);
 }
 
-static v128_t test_f32x4_eq(v128_t a, v128_t b) {
-  return wasm_f32x4_eq(v128_t a, v128_t b);
+// CHECK-LABEL: test_f32x4_eq:
+// CHECK: f32x4.eq{{$}}
+v128_t test_f32x4_eq(v128_t a, v128_t b) {
+  return wasm_f32x4_eq(a, b);
 }
 
-static v128_t test_f32x4_ne(v128_t a, v128_t b) {
-  return wasm_f32x4_ne(v128_t a, v128_t b);
+// CHECK-LABEL: test_f32x4_ne:
+// CHECK: f32x4.ne{{$}}
+v128_t test_f32x4_ne(v128_t a, v128_t b) {
+  return wasm_f32x4_ne(a, b);
 }
 
-static v128_t test_f32x4_lt(v128_t a, v128_t b) {
-  return wasm_f32x4_lt(v128_t a, v128_t b);
+// CHECK-LABEL: test_f32x4_lt:
+// CHECK: f32x4.lt{{$}}
+v128_t test_f32x4_lt(v128_t a, v128_t b) {
+  return wasm_f32x4_lt(a, b);
 }
 
-static v128_t test_f32x4_gt(v128_t a, v128_t b) {
-  return wasm_f32x4_gt(v128_t a, v128_t b);
+// CHECK-LABEL: test_f32x4_gt:
+// CHECK: f32x4.gt{{$}}
+v128_t test_f32x4_gt(v128_t a, v128_t b) {
+  return wasm_f32x4_gt(a, b);
 }
 
-static v128_t test_f32x4_le(v128_t a, v128_t b) {
-  return wasm_f32x4_le(v128_t a, v128_t b);
+// CHECK-LABEL: test_f32x4_le:
+// CHECK: f32x4.le{{$}}
+v128_t test_f32x4_le(v128_t a, v128_t b) {
+  return wasm_f32x4_le(a, b);
 }
 
-static v128_t test_f32x4_ge(v128_t a, v128_t b) {
-  return wasm_f32x4_ge(v128_t a, v128_t b);
+// CHECK-LABEL: test_f32x4_ge:
+// CHECK: f32x4.ge{{$}}
+v128_t test_f32x4_ge(v128_t a, v128_t b) {
+  return wasm_f32x4_ge(a, b);
 }
 
-static v128_t test_f64x2_eq(v128_t a, v128_t b) {
-  return wasm_f64x2_eq(v128_t a, v128_t b);
+// CHECK-LABEL: test_f64x2_eq:
+// CHECK: f64x2.eq{{$}}
+v128_t test_f64x2_eq(v128_t a, v128_t b) {
+  return wasm_f64x2_eq(a, b);
 }
 
-static v128_t test_f64x2_ne(v128_t a, v128_t b) {
-  return wasm_f64x2_ne(v128_t a, v128_t b);
+// CHECK-LABEL: test_f64x2_ne:
+// CHECK: f64x2.ne{{$}}
+v128_t test_f64x2_ne(v128_t a, v128_t b) {
+  return wasm_f64x2_ne(a, b);
 }
 
-static v128_t test_f64x2_lt(v128_t a, v128_t b) {
-  return wasm_f64x2_lt(v128_t a, v128_t b);
+// CHECK-LABEL: test_f64x2_lt:
+// CHECK: f64x2.lt{{$}}
+v128_t test_f64x2_lt(v128_t a, v128_t b) {
+  return wasm_f64x2_lt(a, b);
 }
 
-static v128_t test_f64x2_gt(v128_t a, v128_t b) {
-  return wasm_f64x2_gt(v128_t a, v128_t b);
+// CHECK-LABEL: test_f64x2_gt:
+// CHECK: f64x2.gt{{$}}
+v128_t test_f64x2_gt(v128_t a, v128_t b) {
+  return wasm_f64x2_gt(a, b);
 }
 
-static v128_t test_f64x2_le(v128_t a, v128_t b) {
-  return wasm_f64x2_le(v128_t a, v128_t b);
+// CHECK-LABEL: test_f64x2_le:
+// CHECK: f64x2.le{{$}}
+v128_t test_f64x2_le(v128_t a, v128_t b) {
+  return wasm_f64x2_le(a, b);
 }
 
-static v128_t test_f64x2_ge(v128_t a, v128_t b) {
-  return wasm_f64x2_ge(v128_t a, v128_t b);
+// CHECK-LABEL: test_f64x2_ge:
+// CHECK: f64x2.ge{{$}}
+v128_t test_f64x2_ge(v128_t a, v128_t b) {
+  return wasm_f64x2_ge(a, b);
 }
 
-static v128_t test_v128_not(v128_t a) {
-  return wasm_v128_not(v128_t a);
+// CHECK-LABEL: test_v128_not:
+// CHECK: v128.not{{$}}
+v128_t test_v128_not(v128_t a) {
+  return wasm_v128_not(a);
 }
 
-static v128_t test_v128_and(v128_t a, v128_t b) {
-  return wasm_v128_and(v128_t a, v128_t b);
+// CHECK-LABEL: test_v128_and:
+// CHECK: v128.and{{$}}
+v128_t test_v128_and(v128_t a, v128_t b) {
+  return wasm_v128_and(a, b);
 }
 
-static v128_t test_v128_or(v128_t a, v128_t b) {
-  return wasm_v128_or(v128_t a, v128_t b);
+// CHECK-LABEL: test_v128_or:
+// CHECK: v128.or{{$}}
+v128_t test_v128_or(v128_t a, v128_t b) {
+  return wasm_v128_or(a, b);
 }
 
-static v128_t test_v128_xor(v128_t a, v128_t b) {
-  return wasm_v128_xor(v128_t a, v128_t b);
+// CHECK-LABEL: test_v128_xor:
+// CHECK: v128.xor{{$}}
+v128_t test_v128_xor(v128_t a, v128_t b) {
+  return wasm_v128_xor(a, b);
 }
 
-static v128_t test_v128_andnot(v128_t a, v128_t b) {
-  return wasm_v128_andnot(v128_t a, v128_t b);
+// CHECK-LABEL: test_v128_andnot:
+// CHECK: v128.andnot{{$}}
+v128_t test_v128_andnot(v128_t a, v128_t b) {
+  return wasm_v128_andnot(a, b);
 }
 
-static bool test_v128_any_true(v128_t a) {
-  return wasm_v128_any_true(v128_t a);
+// CHECK-LABEL: test_v128_any_true:
+// CHECK: v128.any_true{{$}}
+bool test_v128_any_true(v128_t a) {
+  return wasm_v128_any_true(a);
 }
 
-static v128_t test_v128_bitselect(v128_t a, v128_t b, v128_t mask) {
-  return wasm_v128_bitselect(v128_t a, v128_t b, v128_t mask);
+// CHECK-LABEL: test_v128_bitselect:
+// CHECK: v128.bitselect{{$}}
+v128_t test_v128_bitselect(v128_t a, v128_t b, v128_t mask) {
+  return wasm_v128_bitselect(a, b, mask);
 }
 
-static v128_t test_i8x16_abs(v128_t a) {
-  return wasm_i8x16_abs(v128_t a);
+// CHECK-LABEL: test_i8x16_abs:
+// CHECK: i8x16.abs{{$}}
+v128_t test_i8x16_abs(v128_t a) {
+  return wasm_i8x16_abs(a);
 }
 
-static v128_t test_i8x16_neg(v128_t a) {
-  return wasm_i8x16_neg(v128_t a);
+// CHECK-LABEL: test_i8x16_neg:
+// CHECK: i8x16.neg{{$}}
+v128_t test_i8x16_neg(v128_t a) {
+  return wasm_i8x16_neg(a);
 }
 
-static bool test_i8x16_all_true(v128_t a) {
-  return wasm_i8x16_all_true(v128_t a);
+// CHECK-LABEL: test_i8x16_all_true:
+// CHECK: i8x16.all_true{{$}}
+bool test_i8x16_all_true(v128_t a) {
+  return wasm_i8x16_all_true(a);
 }
 
-static int32_t test_i8x16_bitmask(v128_t a) {
-  return wasm_i8x16_bitmask(v128_t a);
+// CHECK-LABEL: test_i8x16_bitmask:
+// CHECK: i8x16.bitmask{{$}}
+int32_t test_i8x16_bitmask(v128_t a) {
+  return wasm_i8x16_bitmask(a);
 }
 
-static v128_t test_i8x16_popcnt(v128_t a) {
-  return wasm_i8x16_popcnt(v128_t a);
+// CHECK-LABEL: test_i8x16_popcnt:
+// CHECK: i8x16.popcnt{{$}}
+v128_t test_i8x16_popcnt(v128_t a) {
+  return wasm_i8x16_popcnt(a);
 }
 
-static v128_t test_i8x16_shl(v128_t a, int32_t b) {
-  return wasm_i8x16_shl(v128_t a, int32_t b);
+// CHECK-LABEL: test_i8x16_shl:
+// CHECK: i8x16.shl{{$}}
+v128_t test_i8x16_shl(v128_t a, int32_t b) {
+  return wasm_i8x16_shl(a, b);
 }
 
-static v128_t test_i8x16_shr(v128_t a, int32_t b) {
-  return wasm_i8x16_shr(v128_t a, int32_t b);
+// CHECK-LABEL: test_i8x16_shr:
+// CHECK: i8x16.shr_s{{$}}
+v128_t test_i8x16_shr(v128_t a, int32_t b) {
+  return wasm_i8x16_shr(a, b);
 }
 
-static v128_t test_u8x16_shr(v128_t a, int32_t b) {
-  return wasm_u8x16_shr(v128_t a, int32_t b);
+// CHECK-LABEL: test_u8x16_shr:
+// CHECK: i8x16.shr_u{{$}}
+v128_t test_u8x16_shr(v128_t a, int32_t b) {
+  return wasm_u8x16_shr(a, b);
 }
 
-static v128_t test_i8x16_add(v128_t a, v128_t b) {
-  return wasm_i8x16_add(v128_t a, v128_t b);
+// CHECK-LABEL: test_i8x16_add:
+// CHECK: i8x16.add{{$}}
+v128_t test_i8x16_add(v128_t a, v128_t b) {
+  return wasm_i8x16_add(a, b);
 }
 
-static v128_t test_i8x16_add_sat(v128_t a, v128_t b) {
-  return wasm_i8x16_add_sat(v128_t a, v128_t b);
+// CHECK-LABEL: test_i8x16_add_sat:
+// CHECK: i8x16.add_sat_s{{$}}
+v128_t test_i8x16_add_sat(v128_t a, v128_t b) {
+  return wasm_i8x16_add_sat(a, b);
 }
 
-static v128_t test_u8x16_add_sat(v128_t a, v128_t b) {
-  return wasm_u8x16_add_sat(v128_t a, v128_t b);
+// CHECK-LABEL: test_u8x16_add_sat:
+// CHECK: i8x16.add_sat_u{{$}}
+v128_t test_u8x16_add_sat(v128_t a, v128_t b) {
+  return wasm_u8x16_add_sat(a, b);
 }
 
-static v128_t test_i8x16_sub(v128_t a, v128_t b) {
-  return wasm_i8x16_sub(v128_t a, v128_t b);
+// CHECK-LABEL: test_i8x16_sub:
+// CHECK: i8x16.sub{{$}}
+v128_t test_i8x16_sub(v128_t a, v128_t b) {
+  return wasm_i8x16_sub(a, b);
 }
 
-static v128_t test_i8x16_sub_sat(v128_t a, v128_t b) {
-  return wasm_i8x16_sub_sat(v128_t a, v128_t b);
+// CHECK-LABEL: test_i8x16_sub_sat:
+// CHECK: i8x16.sub_sat_s{{$}}
+v128_t test_i8x16_sub_sat(v128_t a, v128_t b) {
+  return wasm_i8x16_sub_sat(a, b);
 }
 
-static v128_t test_u8x16_sub_sat(v128_t a, v128_t b) {
-  return wasm_u8x16_sub_sat(v128_t a, v128_t b);
+// CHECK-LABEL: test_u8x16_sub_sat:
+// CHECK: i8x16.sub_sat_u{{$}}
+v128_t test_u8x16_sub_sat(v128_t a, v128_t b) {
+  return wasm_u8x16_sub_sat(a, b);
 }
 
-static v128_t test_i8x16_min(v128_t a, v128_t b) {
-  return wasm_i8x16_min(v128_t a, v128_t b);
+// CHECK-LABEL: test_i8x16_min:
+// CHECK: i8x16.min_s{{$}}
+v128_t test_i8x16_min(v128_t a, v128_t b) {
+  return wasm_i8x16_min(a, b);
 }
 
-static v128_t test_u8x16_min(v128_t a, v128_t b) {
-  return wasm_u8x16_min(v128_t a, v128_t b);
+// CHECK-LABEL: test_u8x16_min:
+// CHECK: i8x16.min_u{{$}}
+v128_t test_u8x16_min(v128_t a, v128_t b) {
+  return wasm_u8x16_min(a, b);
 }
 
-static v128_t test_i8x16_max(v128_t a, v128_t b) {
-  return wasm_i8x16_max(v128_t a, v128_t b);
+// CHECK-LABEL: test_i8x16_max:
+// CHECK: i8x16.max_s{{$}}
+v128_t test_i8x16_max(v128_t a, v128_t b) {
+  return wasm_i8x16_max(a, b);
 }
 
-static v128_t test_u8x16_max(v128_t a, v128_t b) {
-  return wasm_u8x16_max(v128_t a, v128_t b);
+// CHECK-LABEL: test_u8x16_max:
+// CHECK: i8x16.max_u{{$}}
+v128_t test_u8x16_max(v128_t a, v128_t b) {
+  return wasm_u8x16_max(a, b);
 }
 
-static v128_t test_u8x16_avgr(v128_t a, v128_t b) {
-  return wasm_u8x16_avgr(v128_t a, v128_t b);
+// CHECK-LABEL: test_u8x16_avgr:
+// CHECK: i8x16.avgr_u{{$}}
+v128_t test_u8x16_avgr(v128_t a, v128_t b) {
+  return wasm_u8x16_avgr(a, b);
 }
 
-static v128_t test_i16x8_abs(v128_t a) {
-  return wasm_i16x8_abs(v128_t a);
+// CHECK-LABEL: test_i16x8_abs:
+// CHECK: i16x8.abs{{$}}
+v128_t test_i16x8_abs(v128_t a) {
+  return wasm_i16x8_abs(a);
 }
 
-static v128_t test_i16x8_neg(v128_t a) {
-  return wasm_i16x8_neg(v128_t a);
+// CHECK-LABEL: test_i16x8_neg:
+// CHECK: i16x8.neg{{$}}
+v128_t test_i16x8_neg(v128_t a) {
+  return wasm_i16x8_neg(a);
 }
 
-static bool test_i16x8_all_true(v128_t a) {
-  return wasm_i16x8_all_true(v128_t a);
+// CHECK-LABEL: test_i16x8_all_true:
+// CHECK: i16x8.all_true{{$}}
+bool test_i16x8_all_true(v128_t a) {
+  return wasm_i16x8_all_true(a);
 }
 
-static int32_t test_i16x8_bitmask(v128_t a) {
-  return wasm_i16x8_bitmask(v128_t a);
+// CHECK-LABEL: test_i16x8_bitmask:
+// CHECK: i16x8.bitmask{{$}}
+int32_t test_i16x8_bitmask(v128_t a) {
+  return wasm_i16x8_bitmask(a);
 }
 
-static v128_t test_i16x8_shl(v128_t a, int32_t b) {
-  return wasm_i16x8_shl(v128_t a, int32_t b);
+// CHECK-LABEL: test_i16x8_shl:
+// CHECK: i16x8.shl{{$}}
+v128_t test_i16x8_shl(v128_t a, int32_t b) {
+  return wasm_i16x8_shl(a, b);
 }
 
-static v128_t test_i16x8_shr(v128_t a, int32_t b) {
-  return wasm_i16x8_shr(v128_t a, int32_t b);
+// CHECK-LABEL: test_i16x8_shr:
+// CHECK: i16x8.shr_s{{$}}
+v128_t test_i16x8_shr(v128_t a, int32_t b) {
+  return wasm_i16x8_shr(a, b);
 }
 
-static v128_t test_u16x8_shr(v128_t a, int32_t b) {
-  return wasm_u16x8_shr(v128_t a, int32_t b);
+// CHECK-LABEL: test_u16x8_shr:
+// CHECK: i16x8.shr_u{{$}}
+v128_t test_u16x8_shr(v128_t a, int32_t b) {
+  return wasm_u16x8_shr(a, b);
 }
 
-static v128_t test_i16x8_add(v128_t a, v128_t b) {
-  return wasm_i16x8_add(v128_t a, v128_t b);
+// CHECK-LABEL: test_i16x8_add:
+// CHECK: i16x8.add{{$}}
+v128_t test_i16x8_add(v128_t a, v128_t b) {
+  return wasm_i16x8_add(a, b);
 }
 
-static v128_t test_i16x8_add_sat(v128_t a, v128_t b) {
-  return wasm_i16x8_add_sat(v128_t a, v128_t b);
+// CHECK-LABEL: test_i16x8_add_sat:
+// CHECK: i16x8.add_sat_s{{$}}
+v128_t test_i16x8_add_sat(v128_t a, v128_t b) {
+  return wasm_i16x8_add_sat(a, b);
 }
 
-static v128_t test_u16x8_add_sat(v128_t a, v128_t b) {
-  return wasm_u16x8_add_sat(v128_t a, v128_t b);
+// CHECK-LABEL: test_u16x8_add_sat:
+// CHECK: i16x8.add_sat_u{{$}}
+v128_t test_u16x8_add_sat(v128_t a, v128_t b) {
+  return wasm_u16x8_add_sat(a, b);
 }
 
-static v128_t test_i16x8_sub(v128_t a, v128_t b) {
-  return wasm_i16x8_sub(v128_t a, v128_t b);
+// CHECK-LABEL: test_i16x8_sub:
+// CHECK: i16x8.sub{{$}}
+v128_t test_i16x8_sub(v128_t a, v128_t b) {
+  return wasm_i16x8_sub(a, b);
 }
 
-static v128_t test_i16x8_sub_sat(v128_t a, v128_t b) {
-  return wasm_i16x8_sub_sat(v128_t a, v128_t b);
+// CHECK-LABEL: test_i16x8_sub_sat:
+// CHECK: i16x8.sub_sat_s{{$}}
+v128_t test_i16x8_sub_sat(v128_t a, v128_t b) {
+  return wasm_i16x8_sub_sat(a, b);
 }
 
-static v128_t test_u16x8_sub_sat(v128_t a, v128_t b) {
-  return wasm_u16x8_sub_sat(v128_t a, v128_t b);
+// CHECK-LABEL: test_u16x8_sub_sat:
+// CHECK: i16x8.sub_sat_u{{$}}
+v128_t test_u16x8_sub_sat(v128_t a, v128_t b) {
+  return wasm_u16x8_sub_sat(a, b);
 }
 
-static v128_t test_i16x8_mul(v128_t a, v128_t b) {
-  return wasm_i16x8_mul(v128_t a, v128_t b);
+// CHECK-LABEL: test_i16x8_mul:
+// CHECK: i16x8.mul{{$}}
+v128_t test_i16x8_mul(v128_t a, v128_t b) {
+  return wasm_i16x8_mul(a, b);
 }
 
-static v128_t test_i16x8_min(v128_t a, v128_t b) {
-  return wasm_i16x8_min(v128_t a, v128_t b);
+// CHECK-LABEL: test_i16x8_min:
+// CHECK: i16x8.min_s{{$}}
+v128_t test_i16x8_min(v128_t a, v128_t b) {
+  return wasm_i16x8_min(a, b);
 }
 
-static v128_t test_u16x8_min(v128_t a, v128_t b) {
-  return wasm_u16x8_min(v128_t a, v128_t b);
+// CHECK-LABEL: test_u16x8_min:
+// CHECK: i16x8.min_u{{$}}
+v128_t test_u16x8_min(v128_t a, v128_t b) {
+  return wasm_u16x8_min(a, b);
 }
 
-static v128_t test_i16x8_max(v128_t a, v128_t b) {
-  return wasm_i16x8_max(v128_t a, v128_t b);
+// CHECK-LABEL: test_i16x8_max:
+// CHECK: i16x8.max_s{{$}}
+v128_t test_i16x8_max(v128_t a, v128_t b) {
+  return wasm_i16x8_max(a, b);
 }
 
-static v128_t test_u16x8_max(v128_t a, v128_t b) {
-  return wasm_u16x8_max(v128_t a, v128_t b);
+// CHECK-LABEL: test_u16x8_max:
+// CHECK: i16x8.max_u{{$}}
+v128_t test_u16x8_max(v128_t a, v128_t b) {
+  return wasm_u16x8_max(a, b);
 }
 
-static v128_t test_u16x8_avgr(v128_t a, v128_t b) {
-  return wasm_u16x8_avgr(v128_t a, v128_t b);
+// CHECK-LABEL: test_u16x8_avgr:
+// CHECK: i16x8.avgr_u{{$}}
+v128_t test_u16x8_avgr(v128_t a, v128_t b) {
+  return wasm_u16x8_avgr(a, b);
 }
 
-static v128_t test_i32x4_abs(v128_t a) {
-  return wasm_i32x4_abs(v128_t a);
+// CHECK-LABEL: test_i32x4_abs:
+// CHECK: i32x4.abs{{$}}
+v128_t test_i32x4_abs(v128_t a) {
+  return wasm_i32x4_abs(a);
 }
 
-static v128_t test_i32x4_neg(v128_t a) {
-  return wasm_i32x4_neg(v128_t a);
+// CHECK-LABEL: test_i32x4_neg:
+// CHECK: i32x4.neg{{$}}
+v128_t test_i32x4_neg(v128_t a) {
+  return wasm_i32x4_neg(a);
 }
 
-static bool test_i32x4_all_true(v128_t a) {
-  return wasm_i32x4_all_true(v128_t a);
+// CHECK-LABEL: test_i32x4_all_true:
+// CHECK: i32x4.all_true{{$}}
+bool test_i32x4_all_true(v128_t a) {
+  return wasm_i32x4_all_true(a);
 }
 
-static int32_t test_i32x4_bitmask(v128_t a) {
-  return wasm_i32x4_bitmask(v128_t a);
+// CHECK-LABEL: test_i32x4_bitmask:
+// CHECK: i32x4.bitmask{{$}}
+int32_t test_i32x4_bitmask(v128_t a) {
+  return wasm_i32x4_bitmask(a);
 }
 
-static v128_t test_i32x4_shl(v128_t a, int32_t b) {
-  return wasm_i32x4_shl(v128_t a, int32_t b);
+// CHECK-LABEL: test_i32x4_shl:
+// CHECK: i32x4.shl{{$}}
+v128_t test_i32x4_shl(v128_t a, int32_t b) {
+  return wasm_i32x4_shl(a, b);
 }
 
-static v128_t test_i32x4_shr(v128_t a, int32_t b) {
-  return wasm_i32x4_shr(v128_t a, int32_t b);
+// CHECK-LABEL: test_i32x4_shr:
+// CHECK: i32x4.shr_s{{$}}
+v128_t test_i32x4_shr(v128_t a, int32_t b) {
+  return wasm_i32x4_shr(a, b);
 }
 
-static v128_t test_u32x4_shr(v128_t a, int32_t b) {
-  return wasm_u32x4_shr(v128_t a, int32_t b);
+// CHECK-LABEL: test_u32x4_shr:
+// CHECK: i32x4.shr_u{{$}}
+v128_t test_u32x4_shr(v128_t a, int32_t b) {
+  return wasm_u32x4_shr(a, b);
 }
 
-static v128_t test_i32x4_add(v128_t a, v128_t b) {
-  return wasm_i32x4_add(v128_t a, v128_t b);
+// CHECK-LABEL: test_i32x4_add:
+// CHECK: i32x4.add{{$}}
+v128_t test_i32x4_add(v128_t a, v128_t b) {
+  return wasm_i32x4_add(a, b);
 }
 
-static v128_t test_i32x4_sub(v128_t a, v128_t b) {
-  return wasm_i32x4_sub(v128_t a, v128_t b);
+// CHECK-LABEL: test_i32x4_sub:
+// CHECK: i32x4.sub{{$}}
+v128_t test_i32x4_sub(v128_t a, v128_t b) {
+  return wasm_i32x4_sub(a, b);
 }
 
-static v128_t test_i32x4_mul(v128_t a, v128_t b) {
-  return wasm_i32x4_mul(v128_t a, v128_t b);
+// CHECK-LABEL: test_i32x4_mul:
+// CHECK: i32x4.mul{{$}}
+v128_t test_i32x4_mul(v128_t a, v128_t b) {
+  return wasm_i32x4_mul(a, b);
 }
 
-static v128_t test_i32x4_min(v128_t a, v128_t b) {
-  return wasm_i32x4_min(v128_t a, v128_t b);
+// CHECK-LABEL: test_i32x4_min:
+// CHECK: i32x4.min_s{{$}}
+v128_t test_i32x4_min(v128_t a, v128_t b) {
+  return wasm_i32x4_min(a, b);
 }
 
-static v128_t test_u32x4_min(v128_t a, v128_t b) {
-  return wasm_u32x4_min(v128_t a, v128_t b);
+// CHECK-LABEL: test_u32x4_min:
+// CHECK: i32x4.min_u{{$}}
+v128_t test_u32x4_min(v128_t a, v128_t b) {
+  return wasm_u32x4_min(a, b);
 }
 
-static v128_t test_i32x4_max(v128_t a, v128_t b) {
-  return wasm_i32x4_max(v128_t a, v128_t b);
+// CHECK-LABEL: test_i32x4_max:
+// CHECK: i32x4.max_s{{$}}
+v128_t test_i32x4_max(v128_t a, v128_t b) {
+  return wasm_i32x4_max(a, b);
 }
 
-static v128_t test_u32x4_max(v128_t a, v128_t b) {
-  return wasm_u32x4_max(v128_t a, v128_t b);
+// CHECK-LABEL: test_u32x4_max:
+// CHECK: i32x4.max_u{{$}}
+v128_t test_u32x4_max(v128_t a, v128_t b) {
+  return wasm_u32x4_max(a, b);
 }
 
-static v128_t test_i32x4_dot_i16x8(v128_t a, v128_t b) {
-  return wasm_i32x4_dot_i16x8(v128_t a, v128_t b);
+// CHECK-LABEL: test_i32x4_dot_i16x8:
+// CHECK: i32x4.dot_i16x8_s{{$}}
+v128_t test_i32x4_dot_i16x8(v128_t a, v128_t b) {
+  return wasm_i32x4_dot_i16x8(a, b);
 }
 
-static v128_t test_i64x2_abs(v128_t a) {
-  return wasm_i64x2_abs(v128_t a);
+// CHECK-LABEL: test_i64x2_abs:
+// CHECK:      local.get 0{{$}}
+// CHECK-NEXT: local.get 0{{$}}
+// CHECK-NEXT: i32.const 63{{$}}
+// CHECK-NEXT: i64x2.shr_s{{$}}
+// CHECK-NEXT: local.tee 1{{$}}
+// CHECK-NEXT: i64x2.add{{$}}
+// CHECK-NEXT: local.get 1{{$}}
+// CHECK-NEXT: v128.xor{{$}}
+// FIXME: i64x2.abs{{$}}
+v128_t test_i64x2_abs(v128_t a) {
+  return wasm_i64x2_abs(a);
 }
 
-static v128_t test_i64x2_neg(v128_t a) {
-  return wasm_i64x2_neg(v128_t a);
+// CHECK-LABEL: test_i64x2_neg:
+// CHECK: i64x2.neg{{$}}
+v128_t test_i64x2_neg(v128_t a) {
+  return wasm_i64x2_neg(a);
 }
 
-static bool test_i64x2_all_true(v128_t a) {
-  return wasm_i64x2_all_true(v128_t a);
+// CHECK-LABEL: test_i64x2_all_true:
+// CHECK: i64x2.all_true{{$}}
+bool test_i64x2_all_true(v128_t a) {
+  return wasm_i64x2_all_true(a);
 }
 
-static int32_t test_i64x2_bitmask(v128_t a) {
-  return wasm_i64x2_bitmask(v128_t a);
+// CHECK-LABEL: test_i64x2_bitmask:
+// CHECK: i64x2.bitmask{{$}}
+int32_t test_i64x2_bitmask(v128_t a) {
+  return wasm_i64x2_bitmask(a);
 }
 
-static v128_t test_i64x2_shl(v128_t a, int32_t b) {
-  return wasm_i64x2_shl(v128_t a, int32_t b);
+// CHECK-LABEL: test_i64x2_shl:
+// CHECK: i64x2.shl{{$}}
+v128_t test_i64x2_shl(v128_t a, int32_t b) {
+  return wasm_i64x2_shl(a, b);
 }
 
-static v128_t test_i64x2_shr(v128_t a, int32_t b) {
-  return wasm_i64x2_shr(v128_t a, int32_t b);
+// CHECK-LABEL: test_i64x2_shr:
+// CHECK: i64x2.shr_s{{$}}
+v128_t test_i64x2_shr(v128_t a, int32_t b) {
+  return wasm_i64x2_shr(a, b);
 }
 
-static v128_t test_u64x2_shr(v128_t a, int32_t b) {
-  return wasm_u64x2_shr(v128_t a, int32_t b);
+// CHECK-LABEL: test_u64x2_shr:
+// CHECK: i64x2.shr_u{{$}}
+v128_t test_u64x2_shr(v128_t a, int32_t b) {
+  return wasm_u64x2_shr(a, b);
 }
 
-static v128_t test_i64x2_add(v128_t a, v128_t b) {
-  return wasm_i64x2_add(v128_t a, v128_t b);
+// CHECK-LABEL: test_i64x2_add:
+// CHECK: i64x2.add{{$}}
+v128_t test_i64x2_add(v128_t a, v128_t b) {
+  return wasm_i64x2_add(a, b);
 }
 
-static v128_t test_i64x2_sub(v128_t a, v128_t b) {
-  return wasm_i64x2_sub(v128_t a, v128_t b);
+// CHECK-LABEL: test_i64x2_sub:
+// CHECK: i64x2.sub{{$}}
+v128_t test_i64x2_sub(v128_t a, v128_t b) {
+  return wasm_i64x2_sub(a, b);
 }
 
-static v128_t test_i64x2_mul(v128_t a, v128_t b) {
-  return wasm_i64x2_mul(v128_t a, v128_t b);
+// CHECK-LABEL: test_i64x2_mul:
+// CHECK: i64x2.mul{{$}}
+v128_t test_i64x2_mul(v128_t a, v128_t b) {
+  return wasm_i64x2_mul(a, b);
 }
 
-static v128_t test_f32x4_abs(v128_t a) {
-  return wasm_f32x4_abs(v128_t a);
+// CHECK-LABEL: test_f32x4_abs:
+// CHECK: f32x4.abs{{$}}
+v128_t test_f32x4_abs(v128_t a) {
+  return wasm_f32x4_abs(a);
 }
 
-static v128_t test_f32x4_neg(v128_t a) {
-  return wasm_f32x4_neg(v128_t a);
+// CHECK-LABEL: test_f32x4_neg:
+// CHECK: f32x4.neg{{$}}
+v128_t test_f32x4_neg(v128_t a) {
+  return wasm_f32x4_neg(a);
 }
 
-static v128_t test_f32x4_sqrt(v128_t a) {
-  return wasm_f32x4_sqrt(v128_t a);
+// CHECK-LABEL: test_f32x4_sqrt:
+// CHECK: f32x4.sqrt{{$}}
+v128_t test_f32x4_sqrt(v128_t a) {
+  return wasm_f32x4_sqrt(a);
 }
 
-static v128_t test_f32x4_ceil(v128_t a) {
-  return wasm_f32x4_ceil(v128_t a);
+// CHECK-LABEL: test_f32x4_ceil:
+// CHECK: f32x4.ceil{{$}}
+v128_t test_f32x4_ceil(v128_t a) {
+  return wasm_f32x4_ceil(a);
 }
 
-static v128_t test_f32x4_floor(v128_t a) {
-  return wasm_f32x4_floor(v128_t a);
+// CHECK-LABEL: test_f32x4_floor:
+// CHECK: f32x4.floor{{$}}
+v128_t test_f32x4_floor(v128_t a) {
+  return wasm_f32x4_floor(a);
 }
 
-static v128_t test_f32x4_trunc(v128_t a) {
-  return wasm_f32x4_trunc(v128_t a);
+// CHECK-LABEL: test_f32x4_trunc:
+// CHECK: f32x4.trunc{{$}}
+v128_t test_f32x4_trunc(v128_t a) {
+  return wasm_f32x4_trunc(a);
 }
 
-static v128_t test_f32x4_nearest(v128_t a) {
-  return wasm_f32x4_nearest(v128_t a);
+// CHECK-LABEL: test_f32x4_nearest:
+// CHECK: f32x4.nearest{{$}}
+v128_t test_f32x4_nearest(v128_t a) {
+  return wasm_f32x4_nearest(a);
 }
 
-static v128_t test_f32x4_add(v128_t a, v128_t b) {
-  return wasm_f32x4_add(v128_t a, v128_t b);
+// CHECK-LABEL: test_f32x4_add:
+// CHECK: f32x4.add{{$}}
+v128_t test_f32x4_add(v128_t a, v128_t b) {
+  return wasm_f32x4_add(a, b);
 }
 
-static v128_t test_f32x4_sub(v128_t a, v128_t b) {
-  return wasm_f32x4_sub(v128_t a, v128_t b);
+// CHECK-LABEL: test_f32x4_sub:
+// CHECK: f32x4.sub{{$}}
+v128_t test_f32x4_sub(v128_t a, v128_t b) {
+  return wasm_f32x4_sub(a, b);
 }
 
-static v128_t test_f32x4_mul(v128_t a, v128_t b) {
-  return wasm_f32x4_mul(v128_t a, v128_t b);
+// CHECK-LABEL: test_f32x4_mul:
+// CHECK: f32x4.mul{{$}}
+v128_t test_f32x4_mul(v128_t a, v128_t b) {
+  return wasm_f32x4_mul(a, b);
 }
 
-static v128_t test_f32x4_div(v128_t a, v128_t b) {
-  return wasm_f32x4_div(v128_t a, v128_t b);
+// CHECK-LABEL: test_f32x4_div:
+// CHECK: f32x4.div{{$}}
+v128_t test_f32x4_div(v128_t a, v128_t b) {
+  return wasm_f32x4_div(a, b);
 }
 
-static v128_t test_f32x4_min(v128_t a, v128_t b) {
-  return wasm_f32x4_min(v128_t a, v128_t b);
+// CHECK-LABEL: test_f32x4_min:
+// CHECK: f32x4.min{{$}}
+v128_t test_f32x4_min(v128_t a, v128_t b) {
+  return wasm_f32x4_min(a, b);
 }
 
-static v128_t test_f32x4_max(v128_t a, v128_t b) {
-  return wasm_f32x4_max(v128_t a, v128_t b);
+// CHECK-LABEL: test_f32x4_max:
+// CHECK: f32x4.max{{$}}
+v128_t test_f32x4_max(v128_t a, v128_t b) {
+  return wasm_f32x4_max(a, b);
 }
 
-static v128_t test_f32x4_pmin(v128_t a, v128_t b) {
-  return wasm_f32x4_pmin(v128_t a, v128_t b);
+// CHECK-LABEL: test_f32x4_pmin:
+// CHECK: f32x4.pmin{{$}}
+v128_t test_f32x4_pmin(v128_t a, v128_t b) {
+  return wasm_f32x4_pmin(a, b);
 }
 
-static v128_t test_f32x4_pmax(v128_t a, v128_t b) {
-  return wasm_f32x4_pmax(v128_t a, v128_t b);
+// CHECK-LABEL: test_f32x4_pmax:
+// CHECK: f32x4.pmax{{$}}
+v128_t test_f32x4_pmax(v128_t a, v128_t b) {
+  return wasm_f32x4_pmax(a, b);
 }
 
-static v128_t test_f64x2_abs(v128_t a) {
-  return wasm_f64x2_abs(v128_t a);
+// CHECK-LABEL: test_f64x2_abs:
+// CHECK: f64x2.abs{{$}}
+v128_t test_f64x2_abs(v128_t a) {
+  return wasm_f64x2_abs(a);
 }
 
-static v128_t test_f64x2_neg(v128_t a) {
-  return wasm_f64x2_neg(v128_t a);
+// CHECK-LABEL: test_f64x2_neg:
+// CHECK: f64x2.neg{{$}}
+v128_t test_f64x2_neg(v128_t a) {
+  return wasm_f64x2_neg(a);
 }
 
-static v128_t test_f64x2_sqrt(v128_t a) {
-  return wasm_f64x2_sqrt(v128_t a);
+// CHECK-LABEL: test_f64x2_sqrt:
+// CHECK: f64x2.sqrt{{$}}
+v128_t test_f64x2_sqrt(v128_t a) {
+  return wasm_f64x2_sqrt(a);
 }
 
-static v128_t test_f64x2_ceil(v128_t a) {
-  return wasm_f64x2_ceil(v128_t a);
+// CHECK-LABEL: test_f64x2_ceil:
+// CHECK: f64x2.ceil{{$}}
+v128_t test_f64x2_ceil(v128_t a) {
+  return wasm_f64x2_ceil(a);
 }
 
-static v128_t test_f64x2_floor(v128_t a) {
-  return wasm_f64x2_floor(v128_t a);
+// CHECK-LABEL: test_f64x2_floor:
+// CHECK: f64x2.floor{{$}}
+v128_t test_f64x2_floor(v128_t a) {
+  return wasm_f64x2_floor(a);
 }
 
-static v128_t test_f64x2_trunc(v128_t a) {
-  return wasm_f64x2_trunc(v128_t a);
+// CHECK-LABEL: test_f64x2_trunc:
+// CHECK: f64x2.trunc{{$}}
+v128_t test_f64x2_trunc(v128_t a) {
+  return wasm_f64x2_trunc(a);
 }
 
-static v128_t test_f64x2_nearest(v128_t a) {
-  return wasm_f64x2_nearest(v128_t a);
+// CHECK-LABEL: test_f64x2_nearest:
+// CHECK: f64x2.nearest{{$}}
+v128_t test_f64x2_nearest(v128_t a) {
+  return wasm_f64x2_nearest(a);
 }
 
-static v128_t test_f64x2_add(v128_t a, v128_t b) {
-  return wasm_f64x2_add(v128_t a, v128_t b);
+// CHECK-LABEL: test_f64x2_add:
+// CHECK: f64x2.add{{$}}
+v128_t test_f64x2_add(v128_t a, v128_t b) {
+  return wasm_f64x2_add(a, b);
 }
 
-static v128_t test_f64x2_sub(v128_t a, v128_t b) {
-  return wasm_f64x2_sub(v128_t a, v128_t b);
+// CHECK-LABEL: test_f64x2_sub:
+// CHECK: f64x2.sub{{$}}
+v128_t test_f64x2_sub(v128_t a, v128_t b) {
+  return wasm_f64x2_sub(a, b);
 }
 
-static v128_t test_f64x2_mul(v128_t a, v128_t b) {
-  return wasm_f64x2_mul(v128_t a, v128_t b);
+// CHECK-LABEL: test_f64x2_mul:
+// CHECK: f64x2.mul{{$}}
+v128_t test_f64x2_mul(v128_t a, v128_t b) {
+  return wasm_f64x2_mul(a, b);
 }
 
-static v128_t test_f64x2_div(v128_t a, v128_t b) {
-  return wasm_f64x2_div(v128_t a, v128_t b);
+// CHECK-LABEL: test_f64x2_div:
+// CHECK: f64x2.div{{$}}
+v128_t test_f64x2_div(v128_t a, v128_t b) {
+  return wasm_f64x2_div(a, b);
 }
 
-static v128_t test_f64x2_min(v128_t a, v128_t b) {
-  return wasm_f64x2_min(v128_t a, v128_t b);
+// CHECK-LABEL: test_f64x2_min:
+// CHECK: f64x2.min{{$}}
+v128_t test_f64x2_min(v128_t a, v128_t b) {
+  return wasm_f64x2_min(a, b);
 }
 
-static v128_t test_f64x2_max(v128_t a, v128_t b) {
-  return wasm_f64x2_max(v128_t a, v128_t b);
+// CHECK-LABEL: test_f64x2_max:
+// CHECK: f64x2.max{{$}}
+v128_t test_f64x2_max(v128_t a, v128_t b) {
+  return wasm_f64x2_max(a, b);
 }
 
-static v128_t test_f64x2_pmin(v128_t a, v128_t b) {
-  return wasm_f64x2_pmin(v128_t a, v128_t b);
+// CHECK-LABEL: test_f64x2_pmin:
+// CHECK: f64x2.pmin{{$}}
+v128_t test_f64x2_pmin(v128_t a, v128_t b) {
+  return wasm_f64x2_pmin(a, b);
 }
 
-static v128_t test_f64x2_pmax(v128_t a, v128_t b) {
-  return wasm_f64x2_pmax(v128_t a, v128_t b);
+// CHECK-LABEL: test_f64x2_pmax:
+// CHECK: f64x2.pmax{{$}}
+v128_t test_f64x2_pmax(v128_t a, v128_t b) {
+  return wasm_f64x2_pmax(a, b);
 }
 
-static v128_t test_i32x4_trunc_sat_f32x4(v128_t a) {
-  return wasm_i32x4_trunc_sat_f32x4(v128_t a);
+// CHECK-LABEL: test_i32x4_trunc_sat_f32x4:
+// CHECK: i32x4.trunc_sat_f32x4_s{{$}}
+v128_t test_i32x4_trunc_sat_f32x4(v128_t a) {
+  return wasm_i32x4_trunc_sat_f32x4(a);
 }
 
-static v128_t test_u32x4_trunc_sat_f32x4(v128_t a) {
-  return wasm_u32x4_trunc_sat_f32x4(v128_t a);
+// CHECK-LABEL: test_u32x4_trunc_sat_f32x4:
+// CHECK: i32x4.trunc_sat_f32x4_u{{$}}
+v128_t test_u32x4_trunc_sat_f32x4(v128_t a) {
+  return wasm_u32x4_trunc_sat_f32x4(a);
 }
 
-static v128_t test_f32x4_convert_i32x4(v128_t a) {
-  return wasm_f32x4_convert_i32x4(v128_t a);
+// CHECK-LABEL: test_f32x4_convert_i32x4:
+// CHECK: f32x4.convert_i32x4_s{{$}}
+v128_t test_f32x4_convert_i32x4(v128_t a) {
+  return wasm_f32x4_convert_i32x4(a);
 }
 
-static v128_t test_f32x4_convert_u32x4(v128_t a) {
-  return wasm_f32x4_convert_u32x4(v128_t a);
+// CHECK-LABEL: test_f32x4_convert_u32x4:
+// CHECK: f32x4.convert_i32x4_u{{$}}
+v128_t test_f32x4_convert_u32x4(v128_t a) {
+  return wasm_f32x4_convert_u32x4(a);
 }
 
-static v128_t test_f64x2_convert_low_i32x4(v128_t a) {
-  return wasm_f64x2_convert_low_i32x4(v128_t a);
+// CHECK-LABEL: test_f64x2_convert_low_i32x4:
+// CHECK: f64x2.convert_low_i32x4_s{{$}}
+v128_t test_f64x2_convert_low_i32x4(v128_t a) {
+  return wasm_f64x2_convert_low_i32x4(a);
 }
 
-static v128_t test_f64x2_convert_low_u32x4(v128_t a) {
-  return wasm_f64x2_convert_low_u32x4(v128_t a);
+// CHECK-LABEL: test_f64x2_convert_low_u32x4:
+// CHECK: f64x2.convert_low_i32x4_u{{$}}
+v128_t test_f64x2_convert_low_u32x4(v128_t a) {
+  return wasm_f64x2_convert_low_u32x4(a);
 }
 
-static v128_t test_i32x4_trunc_sat_f64x2_zero(v128_t a) {
-  return wasm_i32x4_trunc_sat_f64x2_zero(v128_t a);
+// CHECK-LABEL: test_i32x4_trunc_sat_f64x2_zero:
+// CHECK: i32x4.trunc_sat_f64x2_s_zero{{$}}
+v128_t test_i32x4_trunc_sat_f64x2_zero(v128_t a) {
+  return wasm_i32x4_trunc_sat_f64x2_zero(a);
 }
 
-static v128_t test_u32x4_trunc_sat_f64x2_zero(v128_t a) {
-  return wasm_u32x4_trunc_sat_f64x2_zero(v128_t a);
+// CHECK-LABEL: test_u32x4_trunc_sat_f64x2_zero:
+// CHECK: i32x4.trunc_sat_f64x2_u_zero{{$}}
+v128_t test_u32x4_trunc_sat_f64x2_zero(v128_t a) {
+  return wasm_u32x4_trunc_sat_f64x2_zero(a);
 }
 
-static v128_t test_f32x4_demote_f64x2_zero(v128_t a) {
-  return wasm_f32x4_demote_f64x2_zero(v128_t a);
+// CHECK-LABEL: test_f32x4_demote_f64x2_zero:
+// CHECK: f32x4.demote_f64x2_zero{{$}}
+v128_t test_f32x4_demote_f64x2_zero(v128_t a) {
+  return wasm_f32x4_demote_f64x2_zero(a);
 }
 
-static v128_t test_f64x2_promote_low_f32x4(v128_t a) {
-  return wasm_f64x2_promote_low_f32x4(v128_t a);
+// CHECK-LABEL: test_f64x2_promote_low_f32x4:
+// CHECK: f64x2.promote_low_f32x4{{$}}
+v128_t test_f64x2_promote_low_f32x4(v128_t a) {
+  return wasm_f64x2_promote_low_f32x4(a);
 }
 
-static v128_t test_i8x16_shuffle(a, b, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15) {
-  return wasm_i8x16_shuffle(a, b, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15);
+// CHECK-LABEL: test_i8x16_shuffle:
+// CHECK: i8x16.shuffle 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0{{$}}
+v128_t test_i8x16_shuffle(v128_t a, v128_t b) {
+  return wasm_i8x16_shuffle(a, b, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
 }
 
-static v128_t test_i16x8_shuffle(a, b, c0, c1, c2, c3, c4, c5, c6, c7) {
-  return wasm_i16x8_shuffle(a, b, c0, c1, c2, c3, c4, c5, c6, c7);
+// CHECK-LABEL: test_i16x8_shuffle:
+// CHECK: i8x16.shuffle 14, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 0, 1{{$}}
+v128_t test_i16x8_shuffle(v128_t a, v128_t b) {
+  return wasm_i16x8_shuffle(a, b, 7, 6, 5, 4, 3, 2, 1, 0);
 }
 
-static v128_t test_i32x4_shuffle(a, b, c0, c1, c2, c3) {
-  return wasm_i32x4_shuffle(a, b, c0, c1, c2, c3);
+// CHECK-LABEL: test_i32x4_shuffle:
+// CHECK: i8x16.shuffle 12, 13, 14, 15, 8, 9, 10, 11, 4, 5, 6, 7, 0, 1, 2, 3{{$}}
+v128_t test_i32x4_shuffle(v128_t a, v128_t b) {
+  return wasm_i32x4_shuffle(a, b, 3, 2, 1, 0);
 }
 
-static v128_t test_i64x2_shuffle(a, b, c0, c1) {
-  return wasm_i64x2_shuffle(a, b, c0, c1);
+// CHECK-LABEL: test_i64x2_shuffle:
+// CHECK: i8x16.shuffle 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7{{$}}
+v128_t test_i64x2_shuffle(v128_t a, v128_t b) {
+  return wasm_i64x2_shuffle(a, b, 1, 0);
 }
 
-static v128_t test_i8x16_swizzle(v128_t a, v128_t b) {
-  return wasm_i8x16_swizzle(v128_t a, v128_t b);
+// CHECK-LABEL: test_i8x16_swizzle:
+// CHECK: i8x16.swizzle{{$}}
+v128_t test_i8x16_swizzle(v128_t a, v128_t b) {
+  return wasm_i8x16_swizzle(a, b);
 }
 
-static v128_t test_i8x16_narrow_i16x8(v128_t a, v128_t b) {
-  return wasm_i8x16_narrow_i16x8(v128_t a, v128_t b);
+// CHECK-LABEL: test_i8x16_narrow_i16x8:
+// CHECK: i8x16.narrow_i16x8_s{{$}}
+v128_t test_i8x16_narrow_i16x8(v128_t a, v128_t b) {
+  return wasm_i8x16_narrow_i16x8(a, b);
 }
 
-static v128_t test_u8x16_narrow_i16x8(v128_t a, v128_t b) {
-  return wasm_u8x16_narrow_i16x8(v128_t a, v128_t b);
+// CHECK-LABEL: test_u8x16_narrow_i16x8:
+// CHECK: i8x16.narrow_i16x8_u{{$}}
+v128_t test_u8x16_narrow_i16x8(v128_t a, v128_t b) {
+  return wasm_u8x16_narrow_i16x8(a, b);
 }
 
-static v128_t test_i16x8_narrow_i32x4(v128_t a, v128_t b) {
-  return wasm_i16x8_narrow_i32x4(v128_t a, v128_t b);
+// CHECK-LABEL: test_i16x8_narrow_i32x4:
+// CHECK: i16x8.narrow_i32x4_s{{$}}
+v128_t test_i16x8_narrow_i32x4(v128_t a, v128_t b) {
+  return wasm_i16x8_narrow_i32x4(a, b);
 }
 
-static v128_t test_u16x8_narrow_i32x4(v128_t a, v128_t b) {
-  return wasm_u16x8_narrow_i32x4(v128_t a, v128_t b);
+// CHECK-LABEL: test_u16x8_narrow_i32x4:
+// CHECK: i16x8.narrow_i32x4_u{{$}}
+v128_t test_u16x8_narrow_i32x4(v128_t a, v128_t b) {
+  return wasm_u16x8_narrow_i32x4(a, b);
 }
 
-static v128_t test_i16x8_extend_low_i8x16(v128_t a) {
-  return wasm_i16x8_extend_low_i8x16(v128_t a);
+// CHECK-LABEL: test_i16x8_extend_low_i8x16:
+// CHECK: i16x8.extend_low_i8x16_s{{$}}
+v128_t test_i16x8_extend_low_i8x16(v128_t a) {
+  return wasm_i16x8_extend_low_i8x16(a);
 }
 
-static v128_t test_i16x8_extend_high_i8x16(v128_t a) {
-  return wasm_i16x8_extend_high_i8x16(v128_t a);
+// CHECK-LABEL: test_i16x8_extend_high_i8x16:
+// CHECK: i16x8.extend_high_i8x16_s{{$}}
+v128_t test_i16x8_extend_high_i8x16(v128_t a) {
+  return wasm_i16x8_extend_high_i8x16(a);
 }
 
-static v128_t test_u16x8_extend_low_u8x16(v128_t a) {
-  return wasm_u16x8_extend_low_u8x16(v128_t a);
+// CHECK-LABEL: test_u16x8_extend_low_u8x16:
+// CHECK: i16x8.extend_low_i8x16_u{{$}}
+v128_t test_u16x8_extend_low_u8x16(v128_t a) {
+  return wasm_u16x8_extend_low_u8x16(a);
 }
 
-static v128_t test_u16x8_extend_high_u8x16(v128_t a) {
-  return wasm_u16x8_extend_high_u8x16(v128_t a);
+// CHECK-LABEL: test_u16x8_extend_high_u8x16:
+// CHECK: i16x8.extend_high_i8x16_u{{$}}
+v128_t test_u16x8_extend_high_u8x16(v128_t a) {
+  return wasm_u16x8_extend_high_u8x16(a);
 }
 
-static v128_t test_i32x4_extend_low_i16x8(v128_t a) {
-  return wasm_i32x4_extend_low_i16x8(v128_t a);
+// CHECK-LABEL: test_i32x4_extend_low_i16x8:
+// CHECK: i32x4.extend_low_i16x8_s{{$}}
+v128_t test_i32x4_extend_low_i16x8(v128_t a) {
+  return wasm_i32x4_extend_low_i16x8(a);
 }
 
-static v128_t test_i32x4_extend_high_i16x8(v128_t a) {
-  return wasm_i32x4_extend_high_i16x8(v128_t a);
+// CHECK-LABEL: test_i32x4_extend_high_i16x8:
+// CHECK: i32x4.extend_high_i16x8_s{{$}}
+v128_t test_i32x4_extend_high_i16x8(v128_t a) {
+  return wasm_i32x4_extend_high_i16x8(a);
 }
 
-static v128_t test_u32x4_extend_low_u16x8(v128_t a) {
-  return wasm_u32x4_extend_low_u16x8(v128_t a);
+// CHECK-LABEL: test_u32x4_extend_low_u16x8:
+// CHECK: i32x4.extend_low_i16x8_u{{$}}
+v128_t test_u32x4_extend_low_u16x8(v128_t a) {
+  return wasm_u32x4_extend_low_u16x8(a);
 }
 
-static v128_t test_u32x4_extend_high_u16x8(v128_t a) {
-  return wasm_u32x4_extend_high_u16x8(v128_t a);
+// CHECK-LABEL: test_u32x4_extend_high_u16x8:
+// CHECK: i32x4.extend_high_i16x8_u{{$}}
+v128_t test_u32x4_extend_high_u16x8(v128_t a) {
+  return wasm_u32x4_extend_high_u16x8(a);
 }
 
-static v128_t test_i64x2_extend_low_i32x4(v128_t a) {
-  return wasm_i64x2_extend_low_i32x4(v128_t a);
+// CHECK-LABEL: test_i64x2_extend_low_i32x4:
+// CHECK: i64x2.extend_low_i32x4_s{{$}}
+v128_t test_i64x2_extend_low_i32x4(v128_t a) {
+  return wasm_i64x2_extend_low_i32x4(a);
 }
 
-static v128_t test_i64x2_extend_high_i32x4(v128_t a) {
-  return wasm_i64x2_extend_high_i32x4(v128_t a);
+// CHECK-LABEL: test_i64x2_extend_high_i32x4:
+// CHECK: i64x2.extend_high_i32x4_s{{$}}
+v128_t test_i64x2_extend_high_i32x4(v128_t a) {
+  return wasm_i64x2_extend_high_i32x4(a);
 }
 
-static v128_t test_u64x2_extend_low_u32x4(v128_t a) {
-  return wasm_u64x2_extend_low_u32x4(v128_t a);
+// CHECK-LABEL: test_u64x2_extend_low_u32x4:
+// CHECK: i64x2.extend_low_i32x4_u{{$}}
+v128_t test_u64x2_extend_low_u32x4(v128_t a) {
+  return wasm_u64x2_extend_low_u32x4(a);
 }
 
-static v128_t test_u64x2_extend_high_u32x4(v128_t a) {
-  return wasm_u64x2_extend_high_u32x4(v128_t a);
+// CHECK-LABEL: test_u64x2_extend_high_u32x4:
+// CHECK: i64x2.extend_high_i32x4_u{{$}}
+v128_t test_u64x2_extend_high_u32x4(v128_t a) {
+  return wasm_u64x2_extend_high_u32x4(a);
 }
 
-static v128_t test_i16x8_extadd_pairwise_i8x16(v128_t a) {
-  return wasm_i16x8_extadd_pairwise_i8x16(v128_t a);
+// CHECK-LABEL: test_i16x8_extadd_pairwise_i8x16:
+// CHECK: i16x8.extadd_pairwise_i8x16_s{{$}}
+v128_t test_i16x8_extadd_pairwise_i8x16(v128_t a) {
+  return wasm_i16x8_extadd_pairwise_i8x16(a);
 }
 
-static v128_t test_u16x8_extadd_pairwise_u8x16(v128_t a) {
-  return wasm_u16x8_extadd_pairwise_u8x16(v128_t a);
+// CHECK-LABEL: test_u16x8_extadd_pairwise_u8x16:
+// CHECK: i16x8.extadd_pairwise_i8x16_u{{$}}
+v128_t test_u16x8_extadd_pairwise_u8x16(v128_t a) {
+  return wasm_u16x8_extadd_pairwise_u8x16(a);
 }
 
-static v128_t test_i32x4_extadd_pairwise_i16x8(v128_t a) {
-  return wasm_i32x4_extadd_pairwise_i16x8(v128_t a);
+// CHECK-LABEL: test_i32x4_extadd_pairwise_i16x8:
+// CHECK: i32x4.extadd_pairwise_i16x8_s{{$}}
+v128_t test_i32x4_extadd_pairwise_i16x8(v128_t a) {
+  return wasm_i32x4_extadd_pairwise_i16x8(a);
 }
 
-static v128_t test_u32x4_extadd_pairwise_u16x8(v128_t a) {
-  return wasm_u32x4_extadd_pairwise_u16x8(v128_t a);
+// CHECK-LABEL: test_u32x4_extadd_pairwise_u16x8:
+// CHECK: i32x4.extadd_pairwise_i16x8_u{{$}}
+v128_t test_u32x4_extadd_pairwise_u16x8(v128_t a) {
+  return wasm_u32x4_extadd_pairwise_u16x8(a);
 }
 
-static v128_t test_i16x8_extmul_low_i8x16(v128_t a, v128_t b) {
-  return wasm_i16x8_extmul_low_i8x16(v128_t a, v128_t b);
+// CHECK-LABEL: test_i16x8_extmul_low_i8x16:
+// CHECK: i16x8.extmul_low_i8x16_s{{$}}
+v128_t test_i16x8_extmul_low_i8x16(v128_t a, v128_t b) {
+  return wasm_i16x8_extmul_low_i8x16(a, b);
 }
 
-static v128_t test_i16x8_extmul_high_i8x16(v128_t a, v128_t b) {
-  return wasm_i16x8_extmul_high_i8x16(v128_t a, v128_t b);
+// CHECK-LABEL: test_i16x8_extmul_high_i8x16:
+// CHECK: i16x8.extmul_high_i8x16_s{{$}}
+v128_t test_i16x8_extmul_high_i8x16(v128_t a, v128_t b) {
+  return wasm_i16x8_extmul_high_i8x16(a, b);
 }
 
-static v128_t test_u16x8_extmul_low_u8x16(v128_t a, v128_t b) {
-  return wasm_u16x8_extmul_low_u8x16(v128_t a, v128_t b);
+// CHECK-LABEL: test_u16x8_extmul_low_u8x16:
+// CHECK: i16x8.extmul_low_i8x16_u{{$}}
+v128_t test_u16x8_extmul_low_u8x16(v128_t a, v128_t b) {
+  return wasm_u16x8_extmul_low_u8x16(a, b);
 }
 
-static v128_t test_u16x8_extmul_high_u8x16(v128_t a, v128_t b) {
-  return wasm_u16x8_extmul_high_u8x16(v128_t a, v128_t b);
+// CHECK-LABEL: test_u16x8_extmul_high_u8x16:
+// CHECK: i16x8.extmul_high_i8x16_u{{$}}
+v128_t test_u16x8_extmul_high_u8x16(v128_t a, v128_t b) {
+  return wasm_u16x8_extmul_high_u8x16(a, b);
 }
 
-static v128_t test_i32x4_extmul_low_i16x8(v128_t a, v128_t b) {
-  return wasm_i32x4_extmul_low_i16x8(v128_t a, v128_t b);
+// CHECK-LABEL: test_i32x4_extmul_low_i16x8:
+// CHECK: i32x4.extmul_low_i16x8_s{{$}}
+v128_t test_i32x4_extmul_low_i16x8(v128_t a, v128_t b) {
+  return wasm_i32x4_extmul_low_i16x8(a, b);
 }
 
-static v128_t test_i32x4_extmul_high_i16x8(v128_t a, v128_t b) {
-  return wasm_i32x4_extmul_high_i16x8(v128_t a, v128_t b);
+// CHECK-LABEL: test_i32x4_extmul_high_i16x8:
+// CHECK: i32x4.extmul_high_i16x8_s{{$}}
+v128_t test_i32x4_extmul_high_i16x8(v128_t a, v128_t b) {
+  return wasm_i32x4_extmul_high_i16x8(a, b);
 }
 
-static v128_t test_u32x4_extmul_low_u16x8(v128_t a, v128_t b) {
-  return wasm_u32x4_extmul_low_u16x8(v128_t a, v128_t b);
+// CHECK-LABEL: test_u32x4_extmul_low_u16x8:
+// CHECK: i32x4.extmul_low_i16x8_u{{$}}
+v128_t test_u32x4_extmul_low_u16x8(v128_t a, v128_t b) {
+  return wasm_u32x4_extmul_low_u16x8(a, b);
 }
 
-static v128_t test_u32x4_extmul_high_u16x8(v128_t a, v128_t b) {
-  return wasm_u32x4_extmul_high_u16x8(v128_t a, v128_t b);
+// CHECK-LABEL: test_u32x4_extmul_high_u16x8:
+// CHECK: i32x4.extmul_high_i16x8_u{{$}}
+v128_t test_u32x4_extmul_high_u16x8(v128_t a, v128_t b) {
+  return wasm_u32x4_extmul_high_u16x8(a, b);
 }
 
-static v128_t test_i64x2_extmul_low_i32x4(v128_t a, v128_t b) {
-  return wasm_i64x2_extmul_low_i32x4(v128_t a, v128_t b);
+// CHECK-LABEL: test_i64x2_extmul_low_i32x4:
+// CHECK: i64x2.extmul_low_i32x4_s{{$}}
+v128_t test_i64x2_extmul_low_i32x4(v128_t a, v128_t b) {
+  return wasm_i64x2_extmul_low_i32x4(a, b);
 }
 
-static v128_t test_i64x2_extmul_high_i32x4(v128_t a, v128_t b) {
-  return wasm_i64x2_extmul_high_i32x4(v128_t a, v128_t b);
+// CHECK-LABEL: test_i64x2_extmul_high_i32x4:
+// CHECK: i64x2.extmul_high_i32x4_s{{$}}
+v128_t test_i64x2_extmul_high_i32x4(v128_t a, v128_t b) {
+  return wasm_i64x2_extmul_high_i32x4(a, b);
 }
 
-static v128_t test_u64x2_extmul_low_u32x4(v128_t a, v128_t b) {
-  return wasm_u64x2_extmul_low_u32x4(v128_t a, v128_t b);
+// CHECK-LABEL: test_u64x2_extmul_low_u32x4:
+// CHECK: i64x2.extmul_low_i32x4_u{{$}}
+v128_t test_u64x2_extmul_low_u32x4(v128_t a, v128_t b) {
+  return wasm_u64x2_extmul_low_u32x4(a, b);
 }
 
-static v128_t test_u64x2_extmul_high_u32x4(v128_t a, v128_t b) {
-  return wasm_u64x2_extmul_high_u32x4(v128_t a, v128_t b);
+// CHECK-LABEL: test_u64x2_extmul_high_u32x4:
+// CHECK: i64x2.extmul_high_i32x4_u{{$}}
+v128_t test_u64x2_extmul_high_u32x4(v128_t a, v128_t b) {
+  return wasm_u64x2_extmul_high_u32x4(a, b);
 }
 
-static v128_t test_i16x8_q15mulr_sat(v128_t a, v128_t b) {
-  return wasm_i16x8_q15mulr_sat(v128_t a, v128_t b);
+// CHECK-LABEL: test_i16x8_q15mulr_sat:
+// CHECK: i16x8.q15mulr_sat_s{{$}}
+v128_t test_i16x8_q15mulr_sat(v128_t a, v128_t b) {
+  return wasm_i16x8_q15mulr_sat(a, b);
 }
Index: clang/lib/Headers/wasm_simd128.h
===================================================================
--- clang/lib/Headers/wasm_simd128.h
+++ clang/lib/Headers/wasm_simd128.h
@@ -228,6 +228,11 @@
   return (v128_t)(__i32x4){__c0, __c1, __c2, __c3};
 }
 
+static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i64x2_make(int64_t __c0,
+                                                            int64_t __c1) {
+  return (v128_t)(__i64x2){__c0, __c1};
+}
+
 static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_f32x4_make(float __c0,
                                                             float __c1,
                                                             float __c2,
@@ -235,11 +240,6 @@
   return (v128_t)(__f32x4){__c0, __c1, __c2, __c3};
 }
 
-static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_i64x2_make(int64_t __c0,
-                                                            int64_t __c1) {
-  return (v128_t)(__i64x2){__c0, __c1};
-}
-
 static __inline__ v128_t __DEFAULT_FN_ATTRS wasm_f64x2_make(double __c0,
                                                             double __c1) {
   return (v128_t)(__f64x2){__c0, __c1};
@@ -290,20 +290,20 @@
     (v128_t)(__i32x4){__c0, __c1, __c2, __c3};                                 \
   })
 
-#define wasm_f32x4_const(__c0, __c1, __c2, __c3)                               \
+#define wasm_i64x2_const(__c0, __c1)                                           \
   __extension__({                                                              \
     __REQUIRE_CONSTANT(__c0);                                                  \
     __REQUIRE_CONSTANT(__c1);                                                  \
-    __REQUIRE_CONSTANT(__c2);                                                  \
-    __REQUIRE_CONSTANT(__c3);                                                  \
-    (v128_t)(__f32x4){__c0, __c1, __c2, __c3};                                 \
+    (v128_t)(__i64x2){__c0, __c1};                                             \
   })
 
-#define wasm_i64x2_const(__c0, __c1)                                           \
+#define wasm_f32x4_const(__c0, __c1, __c2, __c3)                               \
   __extension__({                                                              \
     __REQUIRE_CONSTANT(__c0);                                                  \
     __REQUIRE_CONSTANT(__c1);                                                  \
-    (v128_t)(__i64x2){__c0, __c1};                                             \
+    __REQUIRE_CONSTANT(__c2);                                                  \
+    __REQUIRE_CONSTANT(__c3);                                                  \
+    (v128_t)(__f32x4){__c0, __c1, __c2, __c3};                                 \
   })
 
 #define wasm_f64x2_const(__c0, __c1)                                           \
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to