1
2
3
4
5
6
7 package simd_test
8
9 import (
10 "simd/archsimd"
11 "testing"
12 )
13
14
15
16
17
18 func TestCeil(t *testing.T) {
19 testFloat32x4Unary(t, archsimd.Float32x4.Ceil, ceilSlice[float32])
20 testFloat64x2Unary(t, archsimd.Float64x2.Ceil, ceilSlice[float64])
21 }
22
23 func TestFloor(t *testing.T) {
24 testFloat32x4Unary(t, archsimd.Float32x4.Floor, floorSlice[float32])
25 testFloat64x2Unary(t, archsimd.Float64x2.Floor, floorSlice[float64])
26 }
27
28 func TestTrunc(t *testing.T) {
29 testFloat32x4Unary(t, archsimd.Float32x4.Trunc, truncSlice[float32])
30 testFloat64x2Unary(t, archsimd.Float64x2.Trunc, truncSlice[float64])
31 }
32
33 func TestRound(t *testing.T) {
34 testFloat32x4Unary(t, archsimd.Float32x4.Round, roundSlice[float32])
35 testFloat64x2Unary(t, archsimd.Float64x2.Round, roundSlice[float64])
36 }
37
38 func TestSqrt(t *testing.T) {
39 testFloat32x4Unary(t, archsimd.Float32x4.Sqrt, sqrtSlice[float32])
40 testFloat64x2Unary(t, archsimd.Float64x2.Sqrt, sqrtSlice[float64])
41 }
42
43 func TestNot(t *testing.T) {
44 testInt8x16Unary(t, archsimd.Int8x16.Not, map1[int8](not))
45 testInt32x4Unary(t, archsimd.Int32x4.Not, map1[int32](not))
46 testInt64x2Unary(t, archsimd.Int64x2.Not, map1[int64](not))
47 }
48
49 func TestAbsolute(t *testing.T) {
50 testInt8x16Unary(t, archsimd.Int8x16.Abs, map1[int8](abs))
51 testInt16x8Unary(t, archsimd.Int16x8.Abs, map1[int16](abs))
52 testInt32x4Unary(t, archsimd.Int32x4.Abs, map1[int32](abs))
53 }
54
55 func TestOnesCount(t *testing.T) {
56 testInt8x16Unary(t, archsimd.Int8x16.OnesCount, map1[int8](onesCount))
57 testInt16x8Unary(t, archsimd.Int16x8.OnesCount, map1[int16](onesCount))
58 testInt32x4Unary(t, archsimd.Int32x4.OnesCount, map1[int32](onesCount))
59 }
60
61
62
63
64
65
66
67
68
69
70
71
View as plain text