-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathi8x16_relaxed_swizzle.wast
More file actions
44 lines (36 loc) · 2.38 KB
/
i8x16_relaxed_swizzle.wast
File metadata and controls
44 lines (36 loc) · 2.38 KB
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
;; Tests for relaxed i8x16 swizzle.
(module
(func (export "i8x16.relaxed_swizzle") (param v128 v128) (result v128) (i8x16.relaxed_swizzle (local.get 0) (local.get 1)))
(func (export "i8x16.relaxed_swizzle_cmp") (param v128 v128) (result v128)
(i8x16.eq
(i8x16.relaxed_swizzle (local.get 0) (local.get 1))
(i8x16.relaxed_swizzle (local.get 0) (local.get 1))))
)
(assert_return (invoke "i8x16.relaxed_swizzle"
(v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)
(v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15))
(either (v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)
(v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)))
;; out of range, returns 0 or modulo 16 if < 128
(assert_return (invoke "i8x16.relaxed_swizzle"
(v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)
(v128.const i8x16 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31))
(either (v128.const i8x16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
(v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)))
;; out of range, returns 0 if >= 128
(assert_return (invoke "i8x16.relaxed_swizzle"
(v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)
(v128.const i8x16 128 129 130 131 132 133 134 135 248 249 250 251 252 253 254 255))
(either (v128.const i8x16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
(v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)))
;; Check that multiple calls to the relaxed instruction with same inputs returns same results.
;; out of range, returns 0 or modulo 16 if < 128
(assert_return (invoke "i8x16.relaxed_swizzle_cmp"
(v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)
(v128.const i8x16 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31))
(v128.const i8x16 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1))
;; out of range, returns 0 if >= 128
(assert_return (invoke "i8x16.relaxed_swizzle_cmp"
(v128.const i8x16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)
(v128.const i8x16 128 129 130 131 132 133 134 135 248 249 250 251 252 253 254 255))
(v128.const i8x16 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1))