Source file
src/simd/equal_gen_test.go
1
2
3
4
5
6
7 package simd_test
8
9 import (
10 "simd"
11 "simd/internal/test_helpers"
12 "testing"
13 )
14
15 func TestEqualInt8s(t *testing.T) {
16 test_helpers.CheckVectorEqual(t, simd.LoadInt8s,
17 func(x, y simd.Int8s) bool { return x == y },
18 func(x, y simd.Int8s) bool { return x != y },
19 test_helpers.Int8s())
20 }
21
22 func TestEqualMask8s(t *testing.T) {
23 test_helpers.CheckMaskEqual(t, simd.LoadInt8s,
24 func(x, y simd.Mask8s) bool { return x == y },
25 func(x, y simd.Mask8s) bool { return x != y })
26 }
27
28 func TestEqualInt16s(t *testing.T) {
29 test_helpers.CheckVectorEqual(t, simd.LoadInt16s,
30 func(x, y simd.Int16s) bool { return x == y },
31 func(x, y simd.Int16s) bool { return x != y },
32 test_helpers.Int16s())
33 }
34
35 func TestEqualMask16s(t *testing.T) {
36 test_helpers.CheckMaskEqual(t, simd.LoadInt16s,
37 func(x, y simd.Mask16s) bool { return x == y },
38 func(x, y simd.Mask16s) bool { return x != y })
39 }
40
41 func TestEqualInt32s(t *testing.T) {
42 test_helpers.CheckVectorEqual(t, simd.LoadInt32s,
43 func(x, y simd.Int32s) bool { return x == y },
44 func(x, y simd.Int32s) bool { return x != y },
45 test_helpers.Int32s())
46 }
47
48 func TestEqualMask32s(t *testing.T) {
49 test_helpers.CheckMaskEqual(t, simd.LoadInt32s,
50 func(x, y simd.Mask32s) bool { return x == y },
51 func(x, y simd.Mask32s) bool { return x != y })
52 }
53
54 func TestEqualInt64s(t *testing.T) {
55 test_helpers.CheckVectorEqual(t, simd.LoadInt64s,
56 func(x, y simd.Int64s) bool { return x == y },
57 func(x, y simd.Int64s) bool { return x != y },
58 test_helpers.Int64s())
59 }
60
61 func TestEqualMask64s(t *testing.T) {
62 test_helpers.CheckMaskEqual(t, simd.LoadInt64s,
63 func(x, y simd.Mask64s) bool { return x == y },
64 func(x, y simd.Mask64s) bool { return x != y })
65 }
66
67 func TestEqualUint8s(t *testing.T) {
68 test_helpers.CheckVectorEqual(t, simd.LoadUint8s,
69 func(x, y simd.Uint8s) bool { return x == y },
70 func(x, y simd.Uint8s) bool { return x != y },
71 test_helpers.Uint8s())
72 }
73
74 func TestEqualUint16s(t *testing.T) {
75 test_helpers.CheckVectorEqual(t, simd.LoadUint16s,
76 func(x, y simd.Uint16s) bool { return x == y },
77 func(x, y simd.Uint16s) bool { return x != y },
78 test_helpers.Uint16s())
79 }
80
81 func TestEqualUint32s(t *testing.T) {
82 test_helpers.CheckVectorEqual(t, simd.LoadUint32s,
83 func(x, y simd.Uint32s) bool { return x == y },
84 func(x, y simd.Uint32s) bool { return x != y },
85 test_helpers.Uint32s())
86 }
87
88 func TestEqualUint64s(t *testing.T) {
89 test_helpers.CheckVectorEqual(t, simd.LoadUint64s,
90 func(x, y simd.Uint64s) bool { return x == y },
91 func(x, y simd.Uint64s) bool { return x != y },
92 test_helpers.Uint64s())
93 }
94
95 func TestEqualFloat32s(t *testing.T) {
96 test_helpers.CheckVectorEqual(t, simd.LoadFloat32s,
97 func(x, y simd.Float32s) bool { return x == y },
98 func(x, y simd.Float32s) bool { return x != y },
99 test_helpers.Float32s())
100 }
101
102 func TestEqualFloat64s(t *testing.T) {
103 test_helpers.CheckVectorEqual(t, simd.LoadFloat64s,
104 func(x, y simd.Float64s) bool { return x == y },
105 func(x, y simd.Float64s) bool { return x != y },
106 test_helpers.Float64s())
107 }
108
View as plain text