1 ;; v128.store operater with normal argument (e.g. (i8x16, i16x8, i32x4, f32x4))
5 (func (export "v128.store_i8x16") (result v128)
6 (v128.store (i32.const 0) (v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15))
7 (v128.load (i32.const 0))
9 (func (export "v128.store_i16x8") (result v128)
10 (v128.store (i32.const 0) (v128.const i16x8 0 1 2 3 4 5 6 7))
11 (v128.load (i32.const 0))
13 (func (export "v128.store_i16x8_2") (result v128)
14 (v128.store (i32.const 0) (v128.const i16x8 012_345 012_345 012_345 012_345 012_345 012_345 012_345 012_345))
15 (v128.load (i32.const 0))
17 (func (export "v128.store_i16x8_3") (result v128)
18 (v128.store (i32.const 0) (v128.const i16x8 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234 0x0_1234))
19 (v128.load (i32.const 0))
21 (func (export "v128.store_i32x4") (result v128)
22 (v128.store (i32.const 0) (v128.const i32x4 0 1 2 3))
23 (v128.load (i32.const 0))
25 (func (export "v128.store_i32x4_2") (result v128)
26 (v128.store (i32.const 0) (v128.const i32x4 0_123_456_789 0_123_456_789 0_123_456_789 0_123_456_789))
27 (v128.load (i32.const 0))
29 (func (export "v128.store_i32x4_3") (result v128)
30 (v128.store (i32.const 0) (v128.const i32x4 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678 0x0_1234_5678))
31 (v128.load (i32.const 0))
34 (func (export "v128.store_f32x4") (result v128)
35 (v128.store (i32.const 0) (v128.const f32x4 0 1 2 3))
36 (v128.load (i32.const 0))
40 (assert_return (invoke "v128.store_i8x16") (v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15))
41 (assert_return (invoke "v128.store_i16x8") (v128.const i16x8 0 1 2 3 4 5 6 7))
42 (assert_return (invoke "v128.store_i16x8_2") (v128.const i16x8 12345 12345 12345 12345 12345 12345 12345 12345))
43 (assert_return (invoke "v128.store_i16x8_3") (v128.const i16x8 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234 0x1234))
44 (assert_return (invoke "v128.store_i32x4") (v128.const i32x4 0 1 2 3))
45 (assert_return (invoke "v128.store_i32x4_2") (v128.const i32x4 123456789 123456789 123456789 123456789))
46 (assert_return (invoke "v128.store_i32x4_3") (v128.const i32x4 0x12345678 0x12345678 0x12345678 0x12345678))
47 (assert_return (invoke "v128.store_f32x4") (v128.const f32x4 0 1 2 3))
50 ;; v128.store operator as the argument of control constructs and instructions
54 (func (export "as-block-value")
55 (block (v128.store (i32.const 0) (v128.const i32x4 0 0 0 0)))
57 (func (export "as-loop-value")
58 (loop (v128.store (i32.const 0) (v128.const i32x4 0 0 0 0)))
60 (func (export "as-br-value")
61 (block (br 0 (v128.store (i32.const 0) (v128.const i32x4 0 0 0 0))))
63 (func (export "as-br_if-value")
65 (br_if 0 (v128.store (i32.const 0) (v128.const i32x4 0 0 0 0)) (i32.const 1))
68 (func (export "as-br_if-value-cond")
70 (br_if 0 (i32.const 6) (v128.store (i32.const 0) (v128.const i32x4 0 0 0 0)))
73 (func (export "as-br_table-value")
75 (br_table 0 (v128.store (i32.const 0) (v128.const i32x4 0 0 0 0)) (i32.const 1))
78 (func (export "as-return-value")
79 (return (v128.store (i32.const 0) (v128.const i32x4 0 0 0 0)))
81 (func (export "as-if-then")
82 (if (i32.const 1) (then (v128.store (i32.const 0) (v128.const i32x4 0 0 0 0))))
84 (func (export "as-if-else")
85 (if (i32.const 0) (then) (else (v128.store (i32.const 0) (v128.const i32x4 0 0 0 0))))
89 (assert_return (invoke "as-block-value"))
90 (assert_return (invoke "as-loop-value"))
91 (assert_return (invoke "as-br-value"))
92 (assert_return (invoke "as-br_if-value"))
93 (assert_return (invoke "as-br_if-value-cond"))
94 (assert_return (invoke "as-br_table-value"))
95 (assert_return (invoke "as-return-value"))
96 (assert_return (invoke "as-if-then"))
97 (assert_return (invoke "as-if-else"))
100 ;; Unknown operator(e.g. v128.store8, v128.store16, v128.store32)
105 "(func (v128.store8 (i32.const 0) (v128.const i32x4 0 0 0 0)))"
112 "(func (v128.store16 (i32.const 0) (v128.const i32x4 0 0 0 0)))"
119 "(func (v128.store32 (i32.const 0) (v128.const i32x4 0 0 0 0)))"
125 ;; Type mismatched (e.g. v128.load(f32.const 0), type address empty)
128 (module (memory 1) (func (v128.store (f32.const 0) (v128.const i32x4 0 0 0 0))))
132 (module (memory 1) (func (local v128) (block (br_if 0 (v128.store)))))
136 (module (memory 1) (func (result v128) (v128.store (i32.const 0) (v128.const i32x4 0 0 0 0))))
141 ;; Test operation with empty argument
145 (func $v128.store-1st-arg-empty
146 (v128.store (v128.const i32x4 0 0 0 0))
153 (func $v128.store-2nd-arg-empty
154 (v128.store (i32.const 0))
161 (func $v128.store-arg-empty