-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathsimd_load64_lane.wast
97 lines (91 loc) · 5.22 KB
/
simd_load64_lane.wast
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
;; Tests for load lane operations.
(module
(memory 1)
(data (i32.const 0) "\00\01\02\03\04\05\06\07\08\09\0A\0B\0C\0D\0E\0F")
(func (export "v128.load64_lane_0")
(param $address i32) (param $x v128) (result v128)
(v128.load64_lane 0 (local.get $address) (local.get $x)))
(func (export "v128.load64_lane_1")
(param $address i32) (param $x v128) (result v128)
(v128.load64_lane 1 (local.get $address) (local.get $x)))
(func (export "v128.load64_lane_0_offset_0")
(param $x v128) (result v128)
(v128.load64_lane offset=0 0 (i32.const 0) (local.get $x)))
(func (export "v128.load64_lane_1_offset_1")
(param $x v128) (result v128)
(v128.load64_lane offset=1 1 (i32.const 0) (local.get $x)))
(func (export "v128.load64_lane_0_align_1")
(param $address i32) (param $x v128) (result v128)
(v128.load64_lane align=1 0 (local.get $address) (local.get $x)))
(func (export "v128.load64_lane_0_align_2")
(param $address i32) (param $x v128) (result v128)
(v128.load64_lane align=2 0 (local.get $address) (local.get $x)))
(func (export "v128.load64_lane_0_align_4")
(param $address i32) (param $x v128) (result v128)
(v128.load64_lane align=4 0 (local.get $address) (local.get $x)))
(func (export "v128.load64_lane_0_align_8")
(param $address i32) (param $x v128) (result v128)
(v128.load64_lane align=8 0 (local.get $address) (local.get $x)))
(func (export "v128.load64_lane_1_align_1")
(param $address i32) (param $x v128) (result v128)
(v128.load64_lane align=1 1 (local.get $address) (local.get $x)))
(func (export "v128.load64_lane_1_align_2")
(param $address i32) (param $x v128) (result v128)
(v128.load64_lane align=2 1 (local.get $address) (local.get $x)))
(func (export "v128.load64_lane_1_align_4")
(param $address i32) (param $x v128) (result v128)
(v128.load64_lane align=4 1 (local.get $address) (local.get $x)))
(func (export "v128.load64_lane_1_align_8")
(param $address i32) (param $x v128) (result v128)
(v128.load64_lane align=8 1 (local.get $address) (local.get $x)))
)
(assert_return (invoke "v128.load64_lane_0" (i32.const 0)
(v128.const i64x2 0 0))
(v128.const i64x2 506097522914230528 0))
(assert_return (invoke "v128.load64_lane_1" (i32.const 1)
(v128.const i64x2 0 0))
(v128.const i64x2 0 578437695752307201))
(assert_return (invoke "v128.load64_lane_0_offset_0" (v128.const i64x2 0 0))
(v128.const i64x2 506097522914230528 0))
(assert_return (invoke "v128.load64_lane_1_offset_1" (v128.const i64x2 0 0))
(v128.const i64x2 0 578437695752307201))
(assert_return (invoke "v128.load64_lane_0_align_1" (i32.const 0)
(v128.const i64x2 0 0))
(v128.const i64x2 506097522914230528 0))
(assert_return (invoke "v128.load64_lane_0_align_2" (i32.const 0)
(v128.const i64x2 0 0))
(v128.const i64x2 506097522914230528 0))
(assert_return (invoke "v128.load64_lane_0_align_4" (i32.const 0)
(v128.const i64x2 0 0))
(v128.const i64x2 506097522914230528 0))
(assert_return (invoke "v128.load64_lane_0_align_8" (i32.const 0)
(v128.const i64x2 0 0))
(v128.const i64x2 506097522914230528 0))
(assert_return (invoke "v128.load64_lane_1_align_1" (i32.const 1)
(v128.const i64x2 0 0))
(v128.const i64x2 0 578437695752307201))
(assert_return (invoke "v128.load64_lane_1_align_2" (i32.const 1)
(v128.const i64x2 0 0))
(v128.const i64x2 0 578437695752307201))
(assert_return (invoke "v128.load64_lane_1_align_4" (i32.const 1)
(v128.const i64x2 0 0))
(v128.const i64x2 0 578437695752307201))
(assert_return (invoke "v128.load64_lane_1_align_8" (i32.const 1)
(v128.const i64x2 0 0))
(v128.const i64x2 0 578437695752307201))
;; type check
(assert_invalid (module (memory 1)
(func (param $x v128) (result v128)
(v128.load64_lane 0 (local.get $x) (i32.const 0))))
"type mismatch")
;; invalid lane index
(assert_invalid (module (memory 1)
(func (param $x v128) (result v128)
(v128.load64_lane 2 (i32.const 0) (local.get $x))))
"invalid lane index")
;; invalid memarg alignment
(assert_invalid
(module (memory 1)
(func (param $x v128) (result v128)
(v128.load64_lane align=16 0 (i32.const 0) (local.get $x))))
"alignment must not be larger than natural")