This is to support conversions, which are not T -> T.
Change-Id: I323887b116eee8133770a899ed82363bba38a9c4
Reviewed-on: https://go-review.googlesource.com/c/go/+/689717
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
})
}
-// testUint8x16Binary tests the simd binary method f against the expected behavior generated by want
-func testUint8x16Binary(t *testing.T, f func(_, _ simd.Uint8x16) simd.Uint8x16, want func(_, _ []uint8) []uint8) {
- n := 16
+// testInt16x8Binary tests the simd binary method f against the expected behavior generated by want
+func testInt16x8Binary(t *testing.T, f func(_, _ simd.Int16x8) simd.Int16x8, want func(_, _ []int16) []int16) {
+ n := 8
t.Helper()
- forSlicePair(t, uint8s, n, func(x, y []uint8) bool {
+ forSlicePair(t, int16s, n, func(x, y []int16) bool {
t.Helper()
- a := simd.LoadUint8x16Slice(x)
- b := simd.LoadUint8x16Slice(y)
- g := make([]uint8, n)
+ a := simd.LoadInt16x8Slice(x)
+ b := simd.LoadInt16x8Slice(y)
+ g := make([]int16, n)
f(a, b).StoreSlice(g)
w := want(x, y)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
})
}
-// testInt16x8Binary tests the simd binary method f against the expected behavior generated by want
-func testInt16x8Binary(t *testing.T, f func(_, _ simd.Int16x8) simd.Int16x8, want func(_, _ []int16) []int16) {
- n := 8
+// testInt32x4Binary tests the simd binary method f against the expected behavior generated by want
+func testInt32x4Binary(t *testing.T, f func(_, _ simd.Int32x4) simd.Int32x4, want func(_, _ []int32) []int32) {
+ n := 4
t.Helper()
- forSlicePair(t, int16s, n, func(x, y []int16) bool {
+ forSlicePair(t, int32s, n, func(x, y []int32) bool {
t.Helper()
- a := simd.LoadInt16x8Slice(x)
- b := simd.LoadInt16x8Slice(y)
- g := make([]int16, n)
+ a := simd.LoadInt32x4Slice(x)
+ b := simd.LoadInt32x4Slice(y)
+ g := make([]int32, n)
f(a, b).StoreSlice(g)
w := want(x, y)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
})
}
-// testUint16x8Binary tests the simd binary method f against the expected behavior generated by want
-func testUint16x8Binary(t *testing.T, f func(_, _ simd.Uint16x8) simd.Uint16x8, want func(_, _ []uint16) []uint16) {
- n := 8
+// testInt64x2Binary tests the simd binary method f against the expected behavior generated by want
+func testInt64x2Binary(t *testing.T, f func(_, _ simd.Int64x2) simd.Int64x2, want func(_, _ []int64) []int64) {
+ n := 2
t.Helper()
- forSlicePair(t, uint16s, n, func(x, y []uint16) bool {
+ forSlicePair(t, int64s, n, func(x, y []int64) bool {
t.Helper()
- a := simd.LoadUint16x8Slice(x)
- b := simd.LoadUint16x8Slice(y)
- g := make([]uint16, n)
+ a := simd.LoadInt64x2Slice(x)
+ b := simd.LoadInt64x2Slice(y)
+ g := make([]int64, n)
f(a, b).StoreSlice(g)
w := want(x, y)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
})
}
-// testInt32x4Binary tests the simd binary method f against the expected behavior generated by want
-func testInt32x4Binary(t *testing.T, f func(_, _ simd.Int32x4) simd.Int32x4, want func(_, _ []int32) []int32) {
- n := 4
+// testUint8x16Binary tests the simd binary method f against the expected behavior generated by want
+func testUint8x16Binary(t *testing.T, f func(_, _ simd.Uint8x16) simd.Uint8x16, want func(_, _ []uint8) []uint8) {
+ n := 16
t.Helper()
- forSlicePair(t, int32s, n, func(x, y []int32) bool {
+ forSlicePair(t, uint8s, n, func(x, y []uint8) bool {
t.Helper()
- a := simd.LoadInt32x4Slice(x)
- b := simd.LoadInt32x4Slice(y)
- g := make([]int32, n)
+ a := simd.LoadUint8x16Slice(x)
+ b := simd.LoadUint8x16Slice(y)
+ g := make([]uint8, n)
f(a, b).StoreSlice(g)
w := want(x, y)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
})
}
-// testUint32x4Binary tests the simd binary method f against the expected behavior generated by want
-func testUint32x4Binary(t *testing.T, f func(_, _ simd.Uint32x4) simd.Uint32x4, want func(_, _ []uint32) []uint32) {
- n := 4
+// testUint16x8Binary tests the simd binary method f against the expected behavior generated by want
+func testUint16x8Binary(t *testing.T, f func(_, _ simd.Uint16x8) simd.Uint16x8, want func(_, _ []uint16) []uint16) {
+ n := 8
t.Helper()
- forSlicePair(t, uint32s, n, func(x, y []uint32) bool {
+ forSlicePair(t, uint16s, n, func(x, y []uint16) bool {
t.Helper()
- a := simd.LoadUint32x4Slice(x)
- b := simd.LoadUint32x4Slice(y)
- g := make([]uint32, n)
+ a := simd.LoadUint16x8Slice(x)
+ b := simd.LoadUint16x8Slice(y)
+ g := make([]uint16, n)
f(a, b).StoreSlice(g)
w := want(x, y)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
})
}
-// testInt64x2Binary tests the simd binary method f against the expected behavior generated by want
-func testInt64x2Binary(t *testing.T, f func(_, _ simd.Int64x2) simd.Int64x2, want func(_, _ []int64) []int64) {
- n := 2
+// testUint32x4Binary tests the simd binary method f against the expected behavior generated by want
+func testUint32x4Binary(t *testing.T, f func(_, _ simd.Uint32x4) simd.Uint32x4, want func(_, _ []uint32) []uint32) {
+ n := 4
t.Helper()
- forSlicePair(t, int64s, n, func(x, y []int64) bool {
+ forSlicePair(t, uint32s, n, func(x, y []uint32) bool {
t.Helper()
- a := simd.LoadInt64x2Slice(x)
- b := simd.LoadInt64x2Slice(y)
- g := make([]int64, n)
+ a := simd.LoadUint32x4Slice(x)
+ b := simd.LoadUint32x4Slice(y)
+ g := make([]uint32, n)
f(a, b).StoreSlice(g)
w := want(x, y)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
})
}
-// testUint8x32Binary tests the simd binary method f against the expected behavior generated by want
-func testUint8x32Binary(t *testing.T, f func(_, _ simd.Uint8x32) simd.Uint8x32, want func(_, _ []uint8) []uint8) {
- n := 32
+// testInt16x16Binary tests the simd binary method f against the expected behavior generated by want
+func testInt16x16Binary(t *testing.T, f func(_, _ simd.Int16x16) simd.Int16x16, want func(_, _ []int16) []int16) {
+ n := 16
t.Helper()
- forSlicePair(t, uint8s, n, func(x, y []uint8) bool {
+ forSlicePair(t, int16s, n, func(x, y []int16) bool {
t.Helper()
- a := simd.LoadUint8x32Slice(x)
- b := simd.LoadUint8x32Slice(y)
- g := make([]uint8, n)
+ a := simd.LoadInt16x16Slice(x)
+ b := simd.LoadInt16x16Slice(y)
+ g := make([]int16, n)
f(a, b).StoreSlice(g)
w := want(x, y)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
})
}
-// testInt16x16Binary tests the simd binary method f against the expected behavior generated by want
-func testInt16x16Binary(t *testing.T, f func(_, _ simd.Int16x16) simd.Int16x16, want func(_, _ []int16) []int16) {
- n := 16
+// testInt32x8Binary tests the simd binary method f against the expected behavior generated by want
+func testInt32x8Binary(t *testing.T, f func(_, _ simd.Int32x8) simd.Int32x8, want func(_, _ []int32) []int32) {
+ n := 8
t.Helper()
- forSlicePair(t, int16s, n, func(x, y []int16) bool {
+ forSlicePair(t, int32s, n, func(x, y []int32) bool {
t.Helper()
- a := simd.LoadInt16x16Slice(x)
- b := simd.LoadInt16x16Slice(y)
- g := make([]int16, n)
+ a := simd.LoadInt32x8Slice(x)
+ b := simd.LoadInt32x8Slice(y)
+ g := make([]int32, n)
f(a, b).StoreSlice(g)
w := want(x, y)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
})
}
-// testUint16x16Binary tests the simd binary method f against the expected behavior generated by want
-func testUint16x16Binary(t *testing.T, f func(_, _ simd.Uint16x16) simd.Uint16x16, want func(_, _ []uint16) []uint16) {
- n := 16
+// testInt64x4Binary tests the simd binary method f against the expected behavior generated by want
+func testInt64x4Binary(t *testing.T, f func(_, _ simd.Int64x4) simd.Int64x4, want func(_, _ []int64) []int64) {
+ n := 4
t.Helper()
- forSlicePair(t, uint16s, n, func(x, y []uint16) bool {
+ forSlicePair(t, int64s, n, func(x, y []int64) bool {
t.Helper()
- a := simd.LoadUint16x16Slice(x)
- b := simd.LoadUint16x16Slice(y)
- g := make([]uint16, n)
+ a := simd.LoadInt64x4Slice(x)
+ b := simd.LoadInt64x4Slice(y)
+ g := make([]int64, n)
f(a, b).StoreSlice(g)
w := want(x, y)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
})
}
-// testInt32x8Binary tests the simd binary method f against the expected behavior generated by want
-func testInt32x8Binary(t *testing.T, f func(_, _ simd.Int32x8) simd.Int32x8, want func(_, _ []int32) []int32) {
- n := 8
+// testUint8x32Binary tests the simd binary method f against the expected behavior generated by want
+func testUint8x32Binary(t *testing.T, f func(_, _ simd.Uint8x32) simd.Uint8x32, want func(_, _ []uint8) []uint8) {
+ n := 32
t.Helper()
- forSlicePair(t, int32s, n, func(x, y []int32) bool {
+ forSlicePair(t, uint8s, n, func(x, y []uint8) bool {
t.Helper()
- a := simd.LoadInt32x8Slice(x)
- b := simd.LoadInt32x8Slice(y)
- g := make([]int32, n)
+ a := simd.LoadUint8x32Slice(x)
+ b := simd.LoadUint8x32Slice(y)
+ g := make([]uint8, n)
f(a, b).StoreSlice(g)
w := want(x, y)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
})
}
-// testUint32x8Binary tests the simd binary method f against the expected behavior generated by want
-func testUint32x8Binary(t *testing.T, f func(_, _ simd.Uint32x8) simd.Uint32x8, want func(_, _ []uint32) []uint32) {
- n := 8
+// testUint16x16Binary tests the simd binary method f against the expected behavior generated by want
+func testUint16x16Binary(t *testing.T, f func(_, _ simd.Uint16x16) simd.Uint16x16, want func(_, _ []uint16) []uint16) {
+ n := 16
t.Helper()
- forSlicePair(t, uint32s, n, func(x, y []uint32) bool {
+ forSlicePair(t, uint16s, n, func(x, y []uint16) bool {
t.Helper()
- a := simd.LoadUint32x8Slice(x)
- b := simd.LoadUint32x8Slice(y)
- g := make([]uint32, n)
+ a := simd.LoadUint16x16Slice(x)
+ b := simd.LoadUint16x16Slice(y)
+ g := make([]uint16, n)
f(a, b).StoreSlice(g)
w := want(x, y)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
})
}
-// testInt64x4Binary tests the simd binary method f against the expected behavior generated by want
-func testInt64x4Binary(t *testing.T, f func(_, _ simd.Int64x4) simd.Int64x4, want func(_, _ []int64) []int64) {
- n := 4
+// testUint32x8Binary tests the simd binary method f against the expected behavior generated by want
+func testUint32x8Binary(t *testing.T, f func(_, _ simd.Uint32x8) simd.Uint32x8, want func(_, _ []uint32) []uint32) {
+ n := 8
t.Helper()
- forSlicePair(t, int64s, n, func(x, y []int64) bool {
+ forSlicePair(t, uint32s, n, func(x, y []uint32) bool {
t.Helper()
- a := simd.LoadInt64x4Slice(x)
- b := simd.LoadInt64x4Slice(y)
- g := make([]int64, n)
+ a := simd.LoadUint32x8Slice(x)
+ b := simd.LoadUint32x8Slice(y)
+ g := make([]uint32, n)
f(a, b).StoreSlice(g)
w := want(x, y)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
})
}
-// testUint8x64Binary tests the simd binary method f against the expected behavior generated by want
-func testUint8x64Binary(t *testing.T, f func(_, _ simd.Uint8x64) simd.Uint8x64, want func(_, _ []uint8) []uint8) {
- n := 64
+// testInt16x32Binary tests the simd binary method f against the expected behavior generated by want
+func testInt16x32Binary(t *testing.T, f func(_, _ simd.Int16x32) simd.Int16x32, want func(_, _ []int16) []int16) {
+ n := 32
t.Helper()
- forSlicePair(t, uint8s, n, func(x, y []uint8) bool {
+ forSlicePair(t, int16s, n, func(x, y []int16) bool {
t.Helper()
- a := simd.LoadUint8x64Slice(x)
- b := simd.LoadUint8x64Slice(y)
- g := make([]uint8, n)
+ a := simd.LoadInt16x32Slice(x)
+ b := simd.LoadInt16x32Slice(y)
+ g := make([]int16, n)
f(a, b).StoreSlice(g)
w := want(x, y)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
})
}
-// testInt16x32Binary tests the simd binary method f against the expected behavior generated by want
-func testInt16x32Binary(t *testing.T, f func(_, _ simd.Int16x32) simd.Int16x32, want func(_, _ []int16) []int16) {
- n := 32
+// testInt32x16Binary tests the simd binary method f against the expected behavior generated by want
+func testInt32x16Binary(t *testing.T, f func(_, _ simd.Int32x16) simd.Int32x16, want func(_, _ []int32) []int32) {
+ n := 16
t.Helper()
- forSlicePair(t, int16s, n, func(x, y []int16) bool {
+ forSlicePair(t, int32s, n, func(x, y []int32) bool {
t.Helper()
- a := simd.LoadInt16x32Slice(x)
- b := simd.LoadInt16x32Slice(y)
- g := make([]int16, n)
+ a := simd.LoadInt32x16Slice(x)
+ b := simd.LoadInt32x16Slice(y)
+ g := make([]int32, n)
f(a, b).StoreSlice(g)
w := want(x, y)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
})
}
-// testUint16x32Binary tests the simd binary method f against the expected behavior generated by want
-func testUint16x32Binary(t *testing.T, f func(_, _ simd.Uint16x32) simd.Uint16x32, want func(_, _ []uint16) []uint16) {
- n := 32
+// testInt64x8Binary tests the simd binary method f against the expected behavior generated by want
+func testInt64x8Binary(t *testing.T, f func(_, _ simd.Int64x8) simd.Int64x8, want func(_, _ []int64) []int64) {
+ n := 8
t.Helper()
- forSlicePair(t, uint16s, n, func(x, y []uint16) bool {
+ forSlicePair(t, int64s, n, func(x, y []int64) bool {
t.Helper()
- a := simd.LoadUint16x32Slice(x)
- b := simd.LoadUint16x32Slice(y)
- g := make([]uint16, n)
+ a := simd.LoadInt64x8Slice(x)
+ b := simd.LoadInt64x8Slice(y)
+ g := make([]int64, n)
f(a, b).StoreSlice(g)
w := want(x, y)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
})
}
-// testInt32x16Binary tests the simd binary method f against the expected behavior generated by want
-func testInt32x16Binary(t *testing.T, f func(_, _ simd.Int32x16) simd.Int32x16, want func(_, _ []int32) []int32) {
- n := 16
+// testUint8x64Binary tests the simd binary method f against the expected behavior generated by want
+func testUint8x64Binary(t *testing.T, f func(_, _ simd.Uint8x64) simd.Uint8x64, want func(_, _ []uint8) []uint8) {
+ n := 64
t.Helper()
- forSlicePair(t, int32s, n, func(x, y []int32) bool {
+ forSlicePair(t, uint8s, n, func(x, y []uint8) bool {
t.Helper()
- a := simd.LoadInt32x16Slice(x)
- b := simd.LoadInt32x16Slice(y)
- g := make([]int32, n)
+ a := simd.LoadUint8x64Slice(x)
+ b := simd.LoadUint8x64Slice(y)
+ g := make([]uint8, n)
f(a, b).StoreSlice(g)
w := want(x, y)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
})
}
-// testUint32x16Binary tests the simd binary method f against the expected behavior generated by want
-func testUint32x16Binary(t *testing.T, f func(_, _ simd.Uint32x16) simd.Uint32x16, want func(_, _ []uint32) []uint32) {
- n := 16
+// testUint16x32Binary tests the simd binary method f against the expected behavior generated by want
+func testUint16x32Binary(t *testing.T, f func(_, _ simd.Uint16x32) simd.Uint16x32, want func(_, _ []uint16) []uint16) {
+ n := 32
t.Helper()
- forSlicePair(t, uint32s, n, func(x, y []uint32) bool {
+ forSlicePair(t, uint16s, n, func(x, y []uint16) bool {
t.Helper()
- a := simd.LoadUint32x16Slice(x)
- b := simd.LoadUint32x16Slice(y)
- g := make([]uint32, n)
+ a := simd.LoadUint16x32Slice(x)
+ b := simd.LoadUint16x32Slice(y)
+ g := make([]uint16, n)
f(a, b).StoreSlice(g)
w := want(x, y)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
})
}
-// testInt64x8Binary tests the simd binary method f against the expected behavior generated by want
-func testInt64x8Binary(t *testing.T, f func(_, _ simd.Int64x8) simd.Int64x8, want func(_, _ []int64) []int64) {
- n := 8
+// testUint32x16Binary tests the simd binary method f against the expected behavior generated by want
+func testUint32x16Binary(t *testing.T, f func(_, _ simd.Uint32x16) simd.Uint32x16, want func(_, _ []uint32) []uint32) {
+ n := 16
t.Helper()
- forSlicePair(t, int64s, n, func(x, y []int64) bool {
+ forSlicePair(t, uint32s, n, func(x, y []uint32) bool {
t.Helper()
- a := simd.LoadInt64x8Slice(x)
- b := simd.LoadInt64x8Slice(y)
- g := make([]int64, n)
+ a := simd.LoadUint32x16Slice(x)
+ b := simd.LoadUint32x16Slice(y)
+ g := make([]uint32, n)
f(a, b).StoreSlice(g)
w := want(x, y)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
})
}
-// testUint8x16Compare tests the simd comparison method f against the expected behavior generated by want
-func testUint8x16Compare(t *testing.T, f func(_, _ simd.Uint8x16) simd.Mask8x16, want func(_, _ []uint8) []int64) {
- n := 16
- t.Helper()
- forSlicePair(t, uint8s, n, func(x, y []uint8) bool {
- t.Helper()
- a := simd.LoadUint8x16Slice(x)
- b := simd.LoadUint8x16Slice(y)
- g := make([]int8, n)
- f(a, b).AsInt8x16().StoreSlice(g)
- w := want(x, y)
- return checkSlicesLogInput(t, s64(g), w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
- })
-}
-
// testInt16x8Compare tests the simd comparison method f against the expected behavior generated by want
func testInt16x8Compare(t *testing.T, f func(_, _ simd.Int16x8) simd.Mask16x8, want func(_, _ []int16) []int64) {
n := 8
})
}
-// testUint16x8Compare tests the simd comparison method f against the expected behavior generated by want
-func testUint16x8Compare(t *testing.T, f func(_, _ simd.Uint16x8) simd.Mask16x8, want func(_, _ []uint16) []int64) {
- n := 8
- t.Helper()
- forSlicePair(t, uint16s, n, func(x, y []uint16) bool {
- t.Helper()
- a := simd.LoadUint16x8Slice(x)
- b := simd.LoadUint16x8Slice(y)
- g := make([]int16, n)
- f(a, b).AsInt16x8().StoreSlice(g)
- w := want(x, y)
- return checkSlicesLogInput(t, s64(g), w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
- })
-}
-
// testInt32x4Compare tests the simd comparison method f against the expected behavior generated by want
func testInt32x4Compare(t *testing.T, f func(_, _ simd.Int32x4) simd.Mask32x4, want func(_, _ []int32) []int64) {
n := 4
})
}
-// testUint32x4Compare tests the simd comparison method f against the expected behavior generated by want
-func testUint32x4Compare(t *testing.T, f func(_, _ simd.Uint32x4) simd.Mask32x4, want func(_, _ []uint32) []int64) {
- n := 4
- t.Helper()
- forSlicePair(t, uint32s, n, func(x, y []uint32) bool {
- t.Helper()
- a := simd.LoadUint32x4Slice(x)
- b := simd.LoadUint32x4Slice(y)
- g := make([]int32, n)
- f(a, b).AsInt32x4().StoreSlice(g)
- w := want(x, y)
- return checkSlicesLogInput(t, s64(g), w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
- })
-}
-
// testInt64x2Compare tests the simd comparison method f against the expected behavior generated by want
func testInt64x2Compare(t *testing.T, f func(_, _ simd.Int64x2) simd.Mask64x2, want func(_, _ []int64) []int64) {
n := 2
})
}
+// testUint8x16Compare tests the simd comparison method f against the expected behavior generated by want
+func testUint8x16Compare(t *testing.T, f func(_, _ simd.Uint8x16) simd.Mask8x16, want func(_, _ []uint8) []int64) {
+ n := 16
+ t.Helper()
+ forSlicePair(t, uint8s, n, func(x, y []uint8) bool {
+ t.Helper()
+ a := simd.LoadUint8x16Slice(x)
+ b := simd.LoadUint8x16Slice(y)
+ g := make([]int8, n)
+ f(a, b).AsInt8x16().StoreSlice(g)
+ w := want(x, y)
+ return checkSlicesLogInput(t, s64(g), w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
+ })
+}
+
+// testUint16x8Compare tests the simd comparison method f against the expected behavior generated by want
+func testUint16x8Compare(t *testing.T, f func(_, _ simd.Uint16x8) simd.Mask16x8, want func(_, _ []uint16) []int64) {
+ n := 8
+ t.Helper()
+ forSlicePair(t, uint16s, n, func(x, y []uint16) bool {
+ t.Helper()
+ a := simd.LoadUint16x8Slice(x)
+ b := simd.LoadUint16x8Slice(y)
+ g := make([]int16, n)
+ f(a, b).AsInt16x8().StoreSlice(g)
+ w := want(x, y)
+ return checkSlicesLogInput(t, s64(g), w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
+ })
+}
+
+// testUint32x4Compare tests the simd comparison method f against the expected behavior generated by want
+func testUint32x4Compare(t *testing.T, f func(_, _ simd.Uint32x4) simd.Mask32x4, want func(_, _ []uint32) []int64) {
+ n := 4
+ t.Helper()
+ forSlicePair(t, uint32s, n, func(x, y []uint32) bool {
+ t.Helper()
+ a := simd.LoadUint32x4Slice(x)
+ b := simd.LoadUint32x4Slice(y)
+ g := make([]int32, n)
+ f(a, b).AsInt32x4().StoreSlice(g)
+ w := want(x, y)
+ return checkSlicesLogInput(t, s64(g), w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
+ })
+}
+
// testUint64x2Compare tests the simd comparison method f against the expected behavior generated by want
func testUint64x2Compare(t *testing.T, f func(_, _ simd.Uint64x2) simd.Mask64x2, want func(_, _ []uint64) []int64) {
n := 2
})
}
-// testUint8x32Compare tests the simd comparison method f against the expected behavior generated by want
-func testUint8x32Compare(t *testing.T, f func(_, _ simd.Uint8x32) simd.Mask8x32, want func(_, _ []uint8) []int64) {
- n := 32
- t.Helper()
- forSlicePair(t, uint8s, n, func(x, y []uint8) bool {
- t.Helper()
- a := simd.LoadUint8x32Slice(x)
- b := simd.LoadUint8x32Slice(y)
- g := make([]int8, n)
- f(a, b).AsInt8x32().StoreSlice(g)
- w := want(x, y)
- return checkSlicesLogInput(t, s64(g), w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
- })
-}
-
// testInt16x16Compare tests the simd comparison method f against the expected behavior generated by want
func testInt16x16Compare(t *testing.T, f func(_, _ simd.Int16x16) simd.Mask16x16, want func(_, _ []int16) []int64) {
n := 16
})
}
-// testUint16x16Compare tests the simd comparison method f against the expected behavior generated by want
-func testUint16x16Compare(t *testing.T, f func(_, _ simd.Uint16x16) simd.Mask16x16, want func(_, _ []uint16) []int64) {
- n := 16
- t.Helper()
- forSlicePair(t, uint16s, n, func(x, y []uint16) bool {
- t.Helper()
- a := simd.LoadUint16x16Slice(x)
- b := simd.LoadUint16x16Slice(y)
- g := make([]int16, n)
- f(a, b).AsInt16x16().StoreSlice(g)
- w := want(x, y)
- return checkSlicesLogInput(t, s64(g), w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
- })
-}
-
// testInt32x8Compare tests the simd comparison method f against the expected behavior generated by want
func testInt32x8Compare(t *testing.T, f func(_, _ simd.Int32x8) simd.Mask32x8, want func(_, _ []int32) []int64) {
n := 8
})
}
-// testUint32x8Compare tests the simd comparison method f against the expected behavior generated by want
-func testUint32x8Compare(t *testing.T, f func(_, _ simd.Uint32x8) simd.Mask32x8, want func(_, _ []uint32) []int64) {
- n := 8
- t.Helper()
- forSlicePair(t, uint32s, n, func(x, y []uint32) bool {
- t.Helper()
- a := simd.LoadUint32x8Slice(x)
- b := simd.LoadUint32x8Slice(y)
- g := make([]int32, n)
- f(a, b).AsInt32x8().StoreSlice(g)
- w := want(x, y)
- return checkSlicesLogInput(t, s64(g), w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
- })
-}
-
// testInt64x4Compare tests the simd comparison method f against the expected behavior generated by want
func testInt64x4Compare(t *testing.T, f func(_, _ simd.Int64x4) simd.Mask64x4, want func(_, _ []int64) []int64) {
n := 4
})
}
+// testUint8x32Compare tests the simd comparison method f against the expected behavior generated by want
+func testUint8x32Compare(t *testing.T, f func(_, _ simd.Uint8x32) simd.Mask8x32, want func(_, _ []uint8) []int64) {
+ n := 32
+ t.Helper()
+ forSlicePair(t, uint8s, n, func(x, y []uint8) bool {
+ t.Helper()
+ a := simd.LoadUint8x32Slice(x)
+ b := simd.LoadUint8x32Slice(y)
+ g := make([]int8, n)
+ f(a, b).AsInt8x32().StoreSlice(g)
+ w := want(x, y)
+ return checkSlicesLogInput(t, s64(g), w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
+ })
+}
+
+// testUint16x16Compare tests the simd comparison method f against the expected behavior generated by want
+func testUint16x16Compare(t *testing.T, f func(_, _ simd.Uint16x16) simd.Mask16x16, want func(_, _ []uint16) []int64) {
+ n := 16
+ t.Helper()
+ forSlicePair(t, uint16s, n, func(x, y []uint16) bool {
+ t.Helper()
+ a := simd.LoadUint16x16Slice(x)
+ b := simd.LoadUint16x16Slice(y)
+ g := make([]int16, n)
+ f(a, b).AsInt16x16().StoreSlice(g)
+ w := want(x, y)
+ return checkSlicesLogInput(t, s64(g), w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
+ })
+}
+
+// testUint32x8Compare tests the simd comparison method f against the expected behavior generated by want
+func testUint32x8Compare(t *testing.T, f func(_, _ simd.Uint32x8) simd.Mask32x8, want func(_, _ []uint32) []int64) {
+ n := 8
+ t.Helper()
+ forSlicePair(t, uint32s, n, func(x, y []uint32) bool {
+ t.Helper()
+ a := simd.LoadUint32x8Slice(x)
+ b := simd.LoadUint32x8Slice(y)
+ g := make([]int32, n)
+ f(a, b).AsInt32x8().StoreSlice(g)
+ w := want(x, y)
+ return checkSlicesLogInput(t, s64(g), w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
+ })
+}
+
// testUint64x4Compare tests the simd comparison method f against the expected behavior generated by want
func testUint64x4Compare(t *testing.T, f func(_, _ simd.Uint64x4) simd.Mask64x4, want func(_, _ []uint64) []int64) {
n := 4
})
}
-// testUint8x64Compare tests the simd comparison method f against the expected behavior generated by want
-func testUint8x64Compare(t *testing.T, f func(_, _ simd.Uint8x64) simd.Mask8x64, want func(_, _ []uint8) []int64) {
- n := 64
- t.Helper()
- forSlicePair(t, uint8s, n, func(x, y []uint8) bool {
- t.Helper()
- a := simd.LoadUint8x64Slice(x)
- b := simd.LoadUint8x64Slice(y)
- g := make([]int8, n)
- f(a, b).AsInt8x64().StoreSlice(g)
- w := want(x, y)
- return checkSlicesLogInput(t, s64(g), w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
- })
-}
-
// testInt16x32Compare tests the simd comparison method f against the expected behavior generated by want
func testInt16x32Compare(t *testing.T, f func(_, _ simd.Int16x32) simd.Mask16x32, want func(_, _ []int16) []int64) {
n := 32
})
}
-// testUint16x32Compare tests the simd comparison method f against the expected behavior generated by want
-func testUint16x32Compare(t *testing.T, f func(_, _ simd.Uint16x32) simd.Mask16x32, want func(_, _ []uint16) []int64) {
- n := 32
- t.Helper()
- forSlicePair(t, uint16s, n, func(x, y []uint16) bool {
- t.Helper()
- a := simd.LoadUint16x32Slice(x)
- b := simd.LoadUint16x32Slice(y)
- g := make([]int16, n)
- f(a, b).AsInt16x32().StoreSlice(g)
- w := want(x, y)
- return checkSlicesLogInput(t, s64(g), w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
- })
-}
-
// testInt32x16Compare tests the simd comparison method f against the expected behavior generated by want
func testInt32x16Compare(t *testing.T, f func(_, _ simd.Int32x16) simd.Mask32x16, want func(_, _ []int32) []int64) {
n := 16
})
}
-// testUint32x16Compare tests the simd comparison method f against the expected behavior generated by want
-func testUint32x16Compare(t *testing.T, f func(_, _ simd.Uint32x16) simd.Mask32x16, want func(_, _ []uint32) []int64) {
- n := 16
- t.Helper()
- forSlicePair(t, uint32s, n, func(x, y []uint32) bool {
- t.Helper()
- a := simd.LoadUint32x16Slice(x)
- b := simd.LoadUint32x16Slice(y)
- g := make([]int32, n)
- f(a, b).AsInt32x16().StoreSlice(g)
- w := want(x, y)
- return checkSlicesLogInput(t, s64(g), w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
- })
-}
-
// testInt64x8Compare tests the simd comparison method f against the expected behavior generated by want
func testInt64x8Compare(t *testing.T, f func(_, _ simd.Int64x8) simd.Mask64x8, want func(_, _ []int64) []int64) {
n := 8
})
}
+// testUint8x64Compare tests the simd comparison method f against the expected behavior generated by want
+func testUint8x64Compare(t *testing.T, f func(_, _ simd.Uint8x64) simd.Mask8x64, want func(_, _ []uint8) []int64) {
+ n := 64
+ t.Helper()
+ forSlicePair(t, uint8s, n, func(x, y []uint8) bool {
+ t.Helper()
+ a := simd.LoadUint8x64Slice(x)
+ b := simd.LoadUint8x64Slice(y)
+ g := make([]int8, n)
+ f(a, b).AsInt8x64().StoreSlice(g)
+ w := want(x, y)
+ return checkSlicesLogInput(t, s64(g), w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
+ })
+}
+
+// testUint16x32Compare tests the simd comparison method f against the expected behavior generated by want
+func testUint16x32Compare(t *testing.T, f func(_, _ simd.Uint16x32) simd.Mask16x32, want func(_, _ []uint16) []int64) {
+ n := 32
+ t.Helper()
+ forSlicePair(t, uint16s, n, func(x, y []uint16) bool {
+ t.Helper()
+ a := simd.LoadUint16x32Slice(x)
+ b := simd.LoadUint16x32Slice(y)
+ g := make([]int16, n)
+ f(a, b).AsInt16x32().StoreSlice(g)
+ w := want(x, y)
+ return checkSlicesLogInput(t, s64(g), w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
+ })
+}
+
+// testUint32x16Compare tests the simd comparison method f against the expected behavior generated by want
+func testUint32x16Compare(t *testing.T, f func(_, _ simd.Uint32x16) simd.Mask32x16, want func(_, _ []uint32) []int64) {
+ n := 16
+ t.Helper()
+ forSlicePair(t, uint32s, n, func(x, y []uint32) bool {
+ t.Helper()
+ a := simd.LoadUint32x16Slice(x)
+ b := simd.LoadUint32x16Slice(y)
+ g := make([]int32, n)
+ f(a, b).AsInt32x16().StoreSlice(g)
+ w := want(x, y)
+ return checkSlicesLogInput(t, s64(g), w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
+ })
+}
+
// testUint64x8Compare tests the simd comparison method f against the expected behavior generated by want
func testUint64x8Compare(t *testing.T, f func(_, _ simd.Uint64x8) simd.Mask64x8, want func(_, _ []uint64) []int64) {
n := 8
})
}
-// testUint8x16CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
+// testInt16x8CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
// The mask is applied to the output of want; anything not in the mask, is zeroed.
-func testUint8x16CompareMasked(t *testing.T,
- f func(_, _ simd.Uint8x16, m simd.Mask8x16) simd.Mask8x16,
- want func(_, _ []uint8) []int64) {
- n := 16
+func testInt16x8CompareMasked(t *testing.T,
+ f func(_, _ simd.Int16x8, m simd.Mask16x8) simd.Mask16x8,
+ want func(_, _ []int16) []int64) {
+ n := 8
t.Helper()
- forSlicePairMasked(t, uint8s, n, func(x, y []uint8, m []bool) bool {
+ forSlicePairMasked(t, int16s, n, func(x, y []int16, m []bool) bool {
t.Helper()
- a := simd.LoadUint8x16Slice(x)
- b := simd.LoadUint8x16Slice(y)
- k := simd.LoadInt8x16Slice(toVect[int8](m)).AsMask8x16()
- g := make([]int8, n)
- f(a, b, k).AsInt8x16().StoreSlice(g)
+ a := simd.LoadInt16x8Slice(x)
+ b := simd.LoadInt16x8Slice(y)
+ k := simd.LoadInt16x8Slice(toVect[int16](m)).AsMask16x8()
+ g := make([]int16, n)
+ f(a, b, k).AsInt16x8().StoreSlice(g)
w := want(x, y)
for i := range m {
if !m[i] {
})
}
-// testInt16x8CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
+// testInt32x4CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
// The mask is applied to the output of want; anything not in the mask, is zeroed.
-func testInt16x8CompareMasked(t *testing.T,
- f func(_, _ simd.Int16x8, m simd.Mask16x8) simd.Mask16x8,
- want func(_, _ []int16) []int64) {
- n := 8
+func testInt32x4CompareMasked(t *testing.T,
+ f func(_, _ simd.Int32x4, m simd.Mask32x4) simd.Mask32x4,
+ want func(_, _ []int32) []int64) {
+ n := 4
t.Helper()
- forSlicePairMasked(t, int16s, n, func(x, y []int16, m []bool) bool {
+ forSlicePairMasked(t, int32s, n, func(x, y []int32, m []bool) bool {
t.Helper()
- a := simd.LoadInt16x8Slice(x)
- b := simd.LoadInt16x8Slice(y)
- k := simd.LoadInt16x8Slice(toVect[int16](m)).AsMask16x8()
- g := make([]int16, n)
- f(a, b, k).AsInt16x8().StoreSlice(g)
+ a := simd.LoadInt32x4Slice(x)
+ b := simd.LoadInt32x4Slice(y)
+ k := simd.LoadInt32x4Slice(toVect[int32](m)).AsMask32x4()
+ g := make([]int32, n)
+ f(a, b, k).AsInt32x4().StoreSlice(g)
w := want(x, y)
for i := range m {
if !m[i] {
})
}
-// testUint16x8CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
+// testInt64x2CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
// The mask is applied to the output of want; anything not in the mask, is zeroed.
-func testUint16x8CompareMasked(t *testing.T,
- f func(_, _ simd.Uint16x8, m simd.Mask16x8) simd.Mask16x8,
- want func(_, _ []uint16) []int64) {
- n := 8
+func testInt64x2CompareMasked(t *testing.T,
+ f func(_, _ simd.Int64x2, m simd.Mask64x2) simd.Mask64x2,
+ want func(_, _ []int64) []int64) {
+ n := 2
t.Helper()
- forSlicePairMasked(t, uint16s, n, func(x, y []uint16, m []bool) bool {
+ forSlicePairMasked(t, int64s, n, func(x, y []int64, m []bool) bool {
t.Helper()
- a := simd.LoadUint16x8Slice(x)
- b := simd.LoadUint16x8Slice(y)
- k := simd.LoadInt16x8Slice(toVect[int16](m)).AsMask16x8()
- g := make([]int16, n)
- f(a, b, k).AsInt16x8().StoreSlice(g)
+ a := simd.LoadInt64x2Slice(x)
+ b := simd.LoadInt64x2Slice(y)
+ k := simd.LoadInt64x2Slice(toVect[int64](m)).AsMask64x2()
+ g := make([]int64, n)
+ f(a, b, k).AsInt64x2().StoreSlice(g)
w := want(x, y)
for i := range m {
if !m[i] {
})
}
-// testInt32x4CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
+// testUint8x16CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
// The mask is applied to the output of want; anything not in the mask, is zeroed.
-func testInt32x4CompareMasked(t *testing.T,
- f func(_, _ simd.Int32x4, m simd.Mask32x4) simd.Mask32x4,
- want func(_, _ []int32) []int64) {
- n := 4
+func testUint8x16CompareMasked(t *testing.T,
+ f func(_, _ simd.Uint8x16, m simd.Mask8x16) simd.Mask8x16,
+ want func(_, _ []uint8) []int64) {
+ n := 16
t.Helper()
- forSlicePairMasked(t, int32s, n, func(x, y []int32, m []bool) bool {
+ forSlicePairMasked(t, uint8s, n, func(x, y []uint8, m []bool) bool {
t.Helper()
- a := simd.LoadInt32x4Slice(x)
- b := simd.LoadInt32x4Slice(y)
- k := simd.LoadInt32x4Slice(toVect[int32](m)).AsMask32x4()
- g := make([]int32, n)
- f(a, b, k).AsInt32x4().StoreSlice(g)
+ a := simd.LoadUint8x16Slice(x)
+ b := simd.LoadUint8x16Slice(y)
+ k := simd.LoadInt8x16Slice(toVect[int8](m)).AsMask8x16()
+ g := make([]int8, n)
+ f(a, b, k).AsInt8x16().StoreSlice(g)
w := want(x, y)
for i := range m {
if !m[i] {
})
}
-// testUint32x4CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
+// testUint16x8CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
// The mask is applied to the output of want; anything not in the mask, is zeroed.
-func testUint32x4CompareMasked(t *testing.T,
- f func(_, _ simd.Uint32x4, m simd.Mask32x4) simd.Mask32x4,
- want func(_, _ []uint32) []int64) {
- n := 4
+func testUint16x8CompareMasked(t *testing.T,
+ f func(_, _ simd.Uint16x8, m simd.Mask16x8) simd.Mask16x8,
+ want func(_, _ []uint16) []int64) {
+ n := 8
t.Helper()
- forSlicePairMasked(t, uint32s, n, func(x, y []uint32, m []bool) bool {
+ forSlicePairMasked(t, uint16s, n, func(x, y []uint16, m []bool) bool {
t.Helper()
- a := simd.LoadUint32x4Slice(x)
- b := simd.LoadUint32x4Slice(y)
- k := simd.LoadInt32x4Slice(toVect[int32](m)).AsMask32x4()
- g := make([]int32, n)
- f(a, b, k).AsInt32x4().StoreSlice(g)
+ a := simd.LoadUint16x8Slice(x)
+ b := simd.LoadUint16x8Slice(y)
+ k := simd.LoadInt16x8Slice(toVect[int16](m)).AsMask16x8()
+ g := make([]int16, n)
+ f(a, b, k).AsInt16x8().StoreSlice(g)
w := want(x, y)
for i := range m {
if !m[i] {
})
}
-// testInt64x2CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
+// testUint32x4CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
// The mask is applied to the output of want; anything not in the mask, is zeroed.
-func testInt64x2CompareMasked(t *testing.T,
- f func(_, _ simd.Int64x2, m simd.Mask64x2) simd.Mask64x2,
- want func(_, _ []int64) []int64) {
- n := 2
+func testUint32x4CompareMasked(t *testing.T,
+ f func(_, _ simd.Uint32x4, m simd.Mask32x4) simd.Mask32x4,
+ want func(_, _ []uint32) []int64) {
+ n := 4
t.Helper()
- forSlicePairMasked(t, int64s, n, func(x, y []int64, m []bool) bool {
+ forSlicePairMasked(t, uint32s, n, func(x, y []uint32, m []bool) bool {
t.Helper()
- a := simd.LoadInt64x2Slice(x)
- b := simd.LoadInt64x2Slice(y)
- k := simd.LoadInt64x2Slice(toVect[int64](m)).AsMask64x2()
- g := make([]int64, n)
- f(a, b, k).AsInt64x2().StoreSlice(g)
+ a := simd.LoadUint32x4Slice(x)
+ b := simd.LoadUint32x4Slice(y)
+ k := simd.LoadInt32x4Slice(toVect[int32](m)).AsMask32x4()
+ g := make([]int32, n)
+ f(a, b, k).AsInt32x4().StoreSlice(g)
w := want(x, y)
for i := range m {
if !m[i] {
})
}
-// testUint8x32CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
+// testInt16x16CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
// The mask is applied to the output of want; anything not in the mask, is zeroed.
-func testUint8x32CompareMasked(t *testing.T,
- f func(_, _ simd.Uint8x32, m simd.Mask8x32) simd.Mask8x32,
- want func(_, _ []uint8) []int64) {
- n := 32
+func testInt16x16CompareMasked(t *testing.T,
+ f func(_, _ simd.Int16x16, m simd.Mask16x16) simd.Mask16x16,
+ want func(_, _ []int16) []int64) {
+ n := 16
t.Helper()
- forSlicePairMasked(t, uint8s, n, func(x, y []uint8, m []bool) bool {
+ forSlicePairMasked(t, int16s, n, func(x, y []int16, m []bool) bool {
t.Helper()
- a := simd.LoadUint8x32Slice(x)
- b := simd.LoadUint8x32Slice(y)
- k := simd.LoadInt8x32Slice(toVect[int8](m)).AsMask8x32()
- g := make([]int8, n)
- f(a, b, k).AsInt8x32().StoreSlice(g)
+ a := simd.LoadInt16x16Slice(x)
+ b := simd.LoadInt16x16Slice(y)
+ k := simd.LoadInt16x16Slice(toVect[int16](m)).AsMask16x16()
+ g := make([]int16, n)
+ f(a, b, k).AsInt16x16().StoreSlice(g)
w := want(x, y)
for i := range m {
if !m[i] {
})
}
-// testInt16x16CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
+// testInt32x8CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
// The mask is applied to the output of want; anything not in the mask, is zeroed.
-func testInt16x16CompareMasked(t *testing.T,
- f func(_, _ simd.Int16x16, m simd.Mask16x16) simd.Mask16x16,
- want func(_, _ []int16) []int64) {
- n := 16
+func testInt32x8CompareMasked(t *testing.T,
+ f func(_, _ simd.Int32x8, m simd.Mask32x8) simd.Mask32x8,
+ want func(_, _ []int32) []int64) {
+ n := 8
t.Helper()
- forSlicePairMasked(t, int16s, n, func(x, y []int16, m []bool) bool {
+ forSlicePairMasked(t, int32s, n, func(x, y []int32, m []bool) bool {
t.Helper()
- a := simd.LoadInt16x16Slice(x)
- b := simd.LoadInt16x16Slice(y)
- k := simd.LoadInt16x16Slice(toVect[int16](m)).AsMask16x16()
- g := make([]int16, n)
- f(a, b, k).AsInt16x16().StoreSlice(g)
+ a := simd.LoadInt32x8Slice(x)
+ b := simd.LoadInt32x8Slice(y)
+ k := simd.LoadInt32x8Slice(toVect[int32](m)).AsMask32x8()
+ g := make([]int32, n)
+ f(a, b, k).AsInt32x8().StoreSlice(g)
w := want(x, y)
for i := range m {
if !m[i] {
})
}
-// testUint16x16CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
+// testInt64x4CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
// The mask is applied to the output of want; anything not in the mask, is zeroed.
-func testUint16x16CompareMasked(t *testing.T,
- f func(_, _ simd.Uint16x16, m simd.Mask16x16) simd.Mask16x16,
- want func(_, _ []uint16) []int64) {
- n := 16
+func testInt64x4CompareMasked(t *testing.T,
+ f func(_, _ simd.Int64x4, m simd.Mask64x4) simd.Mask64x4,
+ want func(_, _ []int64) []int64) {
+ n := 4
t.Helper()
- forSlicePairMasked(t, uint16s, n, func(x, y []uint16, m []bool) bool {
+ forSlicePairMasked(t, int64s, n, func(x, y []int64, m []bool) bool {
t.Helper()
- a := simd.LoadUint16x16Slice(x)
- b := simd.LoadUint16x16Slice(y)
- k := simd.LoadInt16x16Slice(toVect[int16](m)).AsMask16x16()
- g := make([]int16, n)
- f(a, b, k).AsInt16x16().StoreSlice(g)
+ a := simd.LoadInt64x4Slice(x)
+ b := simd.LoadInt64x4Slice(y)
+ k := simd.LoadInt64x4Slice(toVect[int64](m)).AsMask64x4()
+ g := make([]int64, n)
+ f(a, b, k).AsInt64x4().StoreSlice(g)
w := want(x, y)
for i := range m {
if !m[i] {
})
}
-// testInt32x8CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
+// testUint8x32CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
// The mask is applied to the output of want; anything not in the mask, is zeroed.
-func testInt32x8CompareMasked(t *testing.T,
- f func(_, _ simd.Int32x8, m simd.Mask32x8) simd.Mask32x8,
- want func(_, _ []int32) []int64) {
- n := 8
+func testUint8x32CompareMasked(t *testing.T,
+ f func(_, _ simd.Uint8x32, m simd.Mask8x32) simd.Mask8x32,
+ want func(_, _ []uint8) []int64) {
+ n := 32
t.Helper()
- forSlicePairMasked(t, int32s, n, func(x, y []int32, m []bool) bool {
+ forSlicePairMasked(t, uint8s, n, func(x, y []uint8, m []bool) bool {
t.Helper()
- a := simd.LoadInt32x8Slice(x)
- b := simd.LoadInt32x8Slice(y)
- k := simd.LoadInt32x8Slice(toVect[int32](m)).AsMask32x8()
- g := make([]int32, n)
- f(a, b, k).AsInt32x8().StoreSlice(g)
+ a := simd.LoadUint8x32Slice(x)
+ b := simd.LoadUint8x32Slice(y)
+ k := simd.LoadInt8x32Slice(toVect[int8](m)).AsMask8x32()
+ g := make([]int8, n)
+ f(a, b, k).AsInt8x32().StoreSlice(g)
w := want(x, y)
for i := range m {
if !m[i] {
})
}
-// testUint32x8CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
+// testUint16x16CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
// The mask is applied to the output of want; anything not in the mask, is zeroed.
-func testUint32x8CompareMasked(t *testing.T,
- f func(_, _ simd.Uint32x8, m simd.Mask32x8) simd.Mask32x8,
- want func(_, _ []uint32) []int64) {
- n := 8
+func testUint16x16CompareMasked(t *testing.T,
+ f func(_, _ simd.Uint16x16, m simd.Mask16x16) simd.Mask16x16,
+ want func(_, _ []uint16) []int64) {
+ n := 16
t.Helper()
- forSlicePairMasked(t, uint32s, n, func(x, y []uint32, m []bool) bool {
+ forSlicePairMasked(t, uint16s, n, func(x, y []uint16, m []bool) bool {
t.Helper()
- a := simd.LoadUint32x8Slice(x)
- b := simd.LoadUint32x8Slice(y)
- k := simd.LoadInt32x8Slice(toVect[int32](m)).AsMask32x8()
- g := make([]int32, n)
- f(a, b, k).AsInt32x8().StoreSlice(g)
+ a := simd.LoadUint16x16Slice(x)
+ b := simd.LoadUint16x16Slice(y)
+ k := simd.LoadInt16x16Slice(toVect[int16](m)).AsMask16x16()
+ g := make([]int16, n)
+ f(a, b, k).AsInt16x16().StoreSlice(g)
w := want(x, y)
for i := range m {
if !m[i] {
})
}
-// testInt64x4CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
+// testUint32x8CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
// The mask is applied to the output of want; anything not in the mask, is zeroed.
-func testInt64x4CompareMasked(t *testing.T,
- f func(_, _ simd.Int64x4, m simd.Mask64x4) simd.Mask64x4,
- want func(_, _ []int64) []int64) {
- n := 4
+func testUint32x8CompareMasked(t *testing.T,
+ f func(_, _ simd.Uint32x8, m simd.Mask32x8) simd.Mask32x8,
+ want func(_, _ []uint32) []int64) {
+ n := 8
t.Helper()
- forSlicePairMasked(t, int64s, n, func(x, y []int64, m []bool) bool {
+ forSlicePairMasked(t, uint32s, n, func(x, y []uint32, m []bool) bool {
t.Helper()
- a := simd.LoadInt64x4Slice(x)
- b := simd.LoadInt64x4Slice(y)
- k := simd.LoadInt64x4Slice(toVect[int64](m)).AsMask64x4()
- g := make([]int64, n)
- f(a, b, k).AsInt64x4().StoreSlice(g)
+ a := simd.LoadUint32x8Slice(x)
+ b := simd.LoadUint32x8Slice(y)
+ k := simd.LoadInt32x8Slice(toVect[int32](m)).AsMask32x8()
+ g := make([]int32, n)
+ f(a, b, k).AsInt32x8().StoreSlice(g)
w := want(x, y)
for i := range m {
if !m[i] {
})
}
-// testUint8x64CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
+// testInt16x32CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
// The mask is applied to the output of want; anything not in the mask, is zeroed.
-func testUint8x64CompareMasked(t *testing.T,
- f func(_, _ simd.Uint8x64, m simd.Mask8x64) simd.Mask8x64,
- want func(_, _ []uint8) []int64) {
- n := 64
+func testInt16x32CompareMasked(t *testing.T,
+ f func(_, _ simd.Int16x32, m simd.Mask16x32) simd.Mask16x32,
+ want func(_, _ []int16) []int64) {
+ n := 32
t.Helper()
- forSlicePairMasked(t, uint8s, n, func(x, y []uint8, m []bool) bool {
+ forSlicePairMasked(t, int16s, n, func(x, y []int16, m []bool) bool {
t.Helper()
- a := simd.LoadUint8x64Slice(x)
- b := simd.LoadUint8x64Slice(y)
- k := simd.LoadInt8x64Slice(toVect[int8](m)).AsMask8x64()
- g := make([]int8, n)
- f(a, b, k).AsInt8x64().StoreSlice(g)
+ a := simd.LoadInt16x32Slice(x)
+ b := simd.LoadInt16x32Slice(y)
+ k := simd.LoadInt16x32Slice(toVect[int16](m)).AsMask16x32()
+ g := make([]int16, n)
+ f(a, b, k).AsInt16x32().StoreSlice(g)
w := want(x, y)
for i := range m {
if !m[i] {
})
}
-// testInt16x32CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
+// testInt32x16CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
// The mask is applied to the output of want; anything not in the mask, is zeroed.
-func testInt16x32CompareMasked(t *testing.T,
- f func(_, _ simd.Int16x32, m simd.Mask16x32) simd.Mask16x32,
- want func(_, _ []int16) []int64) {
- n := 32
+func testInt32x16CompareMasked(t *testing.T,
+ f func(_, _ simd.Int32x16, m simd.Mask32x16) simd.Mask32x16,
+ want func(_, _ []int32) []int64) {
+ n := 16
t.Helper()
- forSlicePairMasked(t, int16s, n, func(x, y []int16, m []bool) bool {
+ forSlicePairMasked(t, int32s, n, func(x, y []int32, m []bool) bool {
t.Helper()
- a := simd.LoadInt16x32Slice(x)
- b := simd.LoadInt16x32Slice(y)
- k := simd.LoadInt16x32Slice(toVect[int16](m)).AsMask16x32()
- g := make([]int16, n)
- f(a, b, k).AsInt16x32().StoreSlice(g)
+ a := simd.LoadInt32x16Slice(x)
+ b := simd.LoadInt32x16Slice(y)
+ k := simd.LoadInt32x16Slice(toVect[int32](m)).AsMask32x16()
+ g := make([]int32, n)
+ f(a, b, k).AsInt32x16().StoreSlice(g)
w := want(x, y)
for i := range m {
if !m[i] {
})
}
-// testUint16x32CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
+// testInt64x8CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
// The mask is applied to the output of want; anything not in the mask, is zeroed.
-func testUint16x32CompareMasked(t *testing.T,
- f func(_, _ simd.Uint16x32, m simd.Mask16x32) simd.Mask16x32,
- want func(_, _ []uint16) []int64) {
- n := 32
+func testInt64x8CompareMasked(t *testing.T,
+ f func(_, _ simd.Int64x8, m simd.Mask64x8) simd.Mask64x8,
+ want func(_, _ []int64) []int64) {
+ n := 8
t.Helper()
- forSlicePairMasked(t, uint16s, n, func(x, y []uint16, m []bool) bool {
+ forSlicePairMasked(t, int64s, n, func(x, y []int64, m []bool) bool {
t.Helper()
- a := simd.LoadUint16x32Slice(x)
- b := simd.LoadUint16x32Slice(y)
- k := simd.LoadInt16x32Slice(toVect[int16](m)).AsMask16x32()
- g := make([]int16, n)
- f(a, b, k).AsInt16x32().StoreSlice(g)
+ a := simd.LoadInt64x8Slice(x)
+ b := simd.LoadInt64x8Slice(y)
+ k := simd.LoadInt64x8Slice(toVect[int64](m)).AsMask64x8()
+ g := make([]int64, n)
+ f(a, b, k).AsInt64x8().StoreSlice(g)
w := want(x, y)
for i := range m {
if !m[i] {
})
}
-// testInt32x16CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
+// testUint8x64CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
// The mask is applied to the output of want; anything not in the mask, is zeroed.
-func testInt32x16CompareMasked(t *testing.T,
- f func(_, _ simd.Int32x16, m simd.Mask32x16) simd.Mask32x16,
- want func(_, _ []int32) []int64) {
- n := 16
+func testUint8x64CompareMasked(t *testing.T,
+ f func(_, _ simd.Uint8x64, m simd.Mask8x64) simd.Mask8x64,
+ want func(_, _ []uint8) []int64) {
+ n := 64
t.Helper()
- forSlicePairMasked(t, int32s, n, func(x, y []int32, m []bool) bool {
+ forSlicePairMasked(t, uint8s, n, func(x, y []uint8, m []bool) bool {
t.Helper()
- a := simd.LoadInt32x16Slice(x)
- b := simd.LoadInt32x16Slice(y)
- k := simd.LoadInt32x16Slice(toVect[int32](m)).AsMask32x16()
- g := make([]int32, n)
- f(a, b, k).AsInt32x16().StoreSlice(g)
+ a := simd.LoadUint8x64Slice(x)
+ b := simd.LoadUint8x64Slice(y)
+ k := simd.LoadInt8x64Slice(toVect[int8](m)).AsMask8x64()
+ g := make([]int8, n)
+ f(a, b, k).AsInt8x64().StoreSlice(g)
w := want(x, y)
for i := range m {
if !m[i] {
})
}
-// testUint32x16CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
+// testUint16x32CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
// The mask is applied to the output of want; anything not in the mask, is zeroed.
-func testUint32x16CompareMasked(t *testing.T,
- f func(_, _ simd.Uint32x16, m simd.Mask32x16) simd.Mask32x16,
- want func(_, _ []uint32) []int64) {
- n := 16
+func testUint16x32CompareMasked(t *testing.T,
+ f func(_, _ simd.Uint16x32, m simd.Mask16x32) simd.Mask16x32,
+ want func(_, _ []uint16) []int64) {
+ n := 32
t.Helper()
- forSlicePairMasked(t, uint32s, n, func(x, y []uint32, m []bool) bool {
+ forSlicePairMasked(t, uint16s, n, func(x, y []uint16, m []bool) bool {
t.Helper()
- a := simd.LoadUint32x16Slice(x)
- b := simd.LoadUint32x16Slice(y)
- k := simd.LoadInt32x16Slice(toVect[int32](m)).AsMask32x16()
- g := make([]int32, n)
- f(a, b, k).AsInt32x16().StoreSlice(g)
+ a := simd.LoadUint16x32Slice(x)
+ b := simd.LoadUint16x32Slice(y)
+ k := simd.LoadInt16x32Slice(toVect[int16](m)).AsMask16x32()
+ g := make([]int16, n)
+ f(a, b, k).AsInt16x32().StoreSlice(g)
w := want(x, y)
for i := range m {
if !m[i] {
})
}
-// testInt64x8CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
+// testUint32x16CompareMasked tests the simd masked comparison method f against the expected behavior generated by want
// The mask is applied to the output of want; anything not in the mask, is zeroed.
-func testInt64x8CompareMasked(t *testing.T,
- f func(_, _ simd.Int64x8, m simd.Mask64x8) simd.Mask64x8,
- want func(_, _ []int64) []int64) {
- n := 8
+func testUint32x16CompareMasked(t *testing.T,
+ f func(_, _ simd.Uint32x16, m simd.Mask32x16) simd.Mask32x16,
+ want func(_, _ []uint32) []int64) {
+ n := 16
t.Helper()
- forSlicePairMasked(t, int64s, n, func(x, y []int64, m []bool) bool {
+ forSlicePairMasked(t, uint32s, n, func(x, y []uint32, m []bool) bool {
t.Helper()
- a := simd.LoadInt64x8Slice(x)
- b := simd.LoadInt64x8Slice(y)
- k := simd.LoadInt64x8Slice(toVect[int64](m)).AsMask64x8()
- g := make([]int64, n)
- f(a, b, k).AsInt64x8().StoreSlice(g)
+ a := simd.LoadUint32x16Slice(x)
+ b := simd.LoadUint32x16Slice(y)
+ k := simd.LoadInt32x16Slice(toVect[int32](m)).AsMask32x16()
+ g := make([]int32, n)
+ f(a, b, k).AsInt32x16().StoreSlice(g)
w := want(x, y)
for i := range m {
if !m[i] {
"text/template"
)
+// shapes describes a combination of vector widths and various element types
+type shapes struct {
+ vecs []int // Vector bit width for this shape.
+ ints []int // Int element bit width(s) for this shape
+ uints []int // Unsigned int element bit width(s) for this shape
+ floats []int // Float element bit width(s) for this shape
+}
+
+// shapeAndTemplate is a template and the set of shapes on which it will be expanded
+type shapeAndTemplate struct {
+ s *shapes
+ t *template.Template
+}
+
+var allShapes = &shapes{
+ vecs: []int{128, 256, 512},
+ ints: []int{8, 16, 32, 64},
+ uints: []int{8, 16, 32, 64},
+ floats: []int{32, 64},
+}
+
+// these are the shapes that are currently converted to int32
+// (not all conversions are available, yet)
+var toInt32Shapes = &shapes{
+ vecs: []int{128, 256, 512},
+ floats: []int{32},
+}
+
func oneTemplate(t *template.Template, baseType string, width, count int, out io.Writer) {
b := width * count
if b < 128 || b > 512 {
aOrAn = "an"
}
t.Execute(out, struct {
- Vec string
- AOrAn string
- Width int
- Count int
- WxC string
- Type string
+ Vec string // the type of the vector, e.g. Float32x4
+ AOrAn string // for documentation, the article "a" or "an"
+ Width int // the bit width of the element type, e.g. 32
+ Count int // the number of elements, e.g. 4
+ WxC string // the width-by-type string, e.g., "32x4"
+ Type string // the element type, e.g. "float32"
}{
Vec: vType,
AOrAn: aOrAn,
})
}
-func forTemplates(t *template.Template, out io.Writer) {
- vecs := []int{128, 256, 512}
- ints := []int{8, 16, 32, 64}
- floats := []int{32, 64}
+// forTemplates expands the template sat.t for each shape
+// in sat.s, writing to out.
+func (sat shapeAndTemplate) forTemplates(out io.Writer) {
+ t, s := sat.t, sat.s
+ vecs := s.vecs
+ ints := s.ints
+ uints := s.uints
+ floats := s.floats
for _, v := range vecs {
for _, w := range ints {
c := v / w
oneTemplate(t, "int", w, c, out)
+ }
+ for _, w := range uints {
+ c := v / w
oneTemplate(t, "uint", w, c, out)
}
for _, w := range floats {
// x.Store((*[16]uint8)(s[:16]))
// }
-func templateOf(name, temp string) *template.Template {
- return template.Must(template.New(name).Parse(temp))
+func templateOf(name, temp string) shapeAndTemplate {
+ return shapeAndTemplate{s: allShapes,
+ t: template.Must(template.New(name).Parse(temp))}
+}
+
+func shapedTemplateOf(s *shapes, name, temp string) shapeAndTemplate {
+ return shapeAndTemplate{s: s,
+ t: template.Must(template.New(name).Parse(temp))}
}
var sliceTemplate = templateOf("slice", `
}
`)
+var unaryTemplateToInt32 = shapedTemplateOf(toInt32Shapes, "unary_int32_helpers", `
+// test{{.Vec}}Unary tests the simd unary method f against the expected behavior generated by want
+func test{{.Vec}}UnaryToInt32(t *testing.T, f func(x simd.{{.Vec}}) simd.Int32x{{.Count}}, want func(x []{{.Type}}) []int32) {
+ n := {{.Count}}
+ t.Helper()
+ forSlice(t, {{.Type}}s, n, func(x []{{.Type}}) bool {
+ t.Helper()
+ a := simd.Load{{.Vec}}Slice(x)
+ g := make([]int32, n)
+ f(a).StoreSlice(g)
+ w := want(x)
+ return checkSlicesLogInput(t, g, w, func() {t.Helper(); t.Logf("x=%v", x)})
+ })
+}
+`)
+
var binaryTemplate = templateOf("binary_helpers", `
// test{{.Vec}}Binary tests the simd binary method f against the expected behavior generated by want
func test{{.Vec}}Binary(t *testing.T, f func(_, _ simd.{{.Vec}}) simd.{{.Vec}}, want func(_, _ []{{.Type}}) []{{.Type}}) {
}
}
-func one(filename string, prologue func(s string, out io.Writer), t *template.Template) {
+func one(filename string, prologue func(s string, out io.Writer), sats ...shapeAndTemplate) {
if filename == "" {
return
}
out := new(bytes.Buffer)
prologue("go run genfiles.go", out)
- forTemplates(t, out)
+ for _, sat := range sats {
+ sat.forTemplates(out)
+ }
b, err := format.Source(out.Bytes())
if err != nil {
x.Store((*[16]int8)(s))
}
-// LoadUint8x16Slice loads an Uint8x16 from a slice of at least 16 uint8s
-func LoadUint8x16Slice(s []uint8) Uint8x16 {
- return LoadUint8x16((*[16]uint8)(s))
-}
-
-// StoreSlice stores x into a slice of at least 16 uint8s
-func (x Uint8x16) StoreSlice(s []uint8) {
- x.Store((*[16]uint8)(s))
-}
-
// LoadInt16x8Slice loads an Int16x8 from a slice of at least 8 int16s
func LoadInt16x8Slice(s []int16) Int16x8 {
return LoadInt16x8((*[8]int16)(s))
x.Store((*[8]int16)(s))
}
-// LoadUint16x8Slice loads an Uint16x8 from a slice of at least 8 uint16s
-func LoadUint16x8Slice(s []uint16) Uint16x8 {
- return LoadUint16x8((*[8]uint16)(s))
-}
-
-// StoreSlice stores x into a slice of at least 8 uint16s
-func (x Uint16x8) StoreSlice(s []uint16) {
- x.Store((*[8]uint16)(s))
-}
-
// LoadInt32x4Slice loads an Int32x4 from a slice of at least 4 int32s
func LoadInt32x4Slice(s []int32) Int32x4 {
return LoadInt32x4((*[4]int32)(s))
x.Store((*[4]int32)(s))
}
-// LoadUint32x4Slice loads an Uint32x4 from a slice of at least 4 uint32s
-func LoadUint32x4Slice(s []uint32) Uint32x4 {
- return LoadUint32x4((*[4]uint32)(s))
-}
-
-// StoreSlice stores x into a slice of at least 4 uint32s
-func (x Uint32x4) StoreSlice(s []uint32) {
- x.Store((*[4]uint32)(s))
-}
-
// LoadInt64x2Slice loads an Int64x2 from a slice of at least 2 int64s
func LoadInt64x2Slice(s []int64) Int64x2 {
return LoadInt64x2((*[2]int64)(s))
x.Store((*[2]int64)(s))
}
+// LoadUint8x16Slice loads an Uint8x16 from a slice of at least 16 uint8s
+func LoadUint8x16Slice(s []uint8) Uint8x16 {
+ return LoadUint8x16((*[16]uint8)(s))
+}
+
+// StoreSlice stores x into a slice of at least 16 uint8s
+func (x Uint8x16) StoreSlice(s []uint8) {
+ x.Store((*[16]uint8)(s))
+}
+
+// LoadUint16x8Slice loads an Uint16x8 from a slice of at least 8 uint16s
+func LoadUint16x8Slice(s []uint16) Uint16x8 {
+ return LoadUint16x8((*[8]uint16)(s))
+}
+
+// StoreSlice stores x into a slice of at least 8 uint16s
+func (x Uint16x8) StoreSlice(s []uint16) {
+ x.Store((*[8]uint16)(s))
+}
+
+// LoadUint32x4Slice loads an Uint32x4 from a slice of at least 4 uint32s
+func LoadUint32x4Slice(s []uint32) Uint32x4 {
+ return LoadUint32x4((*[4]uint32)(s))
+}
+
+// StoreSlice stores x into a slice of at least 4 uint32s
+func (x Uint32x4) StoreSlice(s []uint32) {
+ x.Store((*[4]uint32)(s))
+}
+
// LoadUint64x2Slice loads an Uint64x2 from a slice of at least 2 uint64s
func LoadUint64x2Slice(s []uint64) Uint64x2 {
return LoadUint64x2((*[2]uint64)(s))
x.Store((*[32]int8)(s))
}
-// LoadUint8x32Slice loads an Uint8x32 from a slice of at least 32 uint8s
-func LoadUint8x32Slice(s []uint8) Uint8x32 {
- return LoadUint8x32((*[32]uint8)(s))
-}
-
-// StoreSlice stores x into a slice of at least 32 uint8s
-func (x Uint8x32) StoreSlice(s []uint8) {
- x.Store((*[32]uint8)(s))
-}
-
// LoadInt16x16Slice loads an Int16x16 from a slice of at least 16 int16s
func LoadInt16x16Slice(s []int16) Int16x16 {
return LoadInt16x16((*[16]int16)(s))
x.Store((*[16]int16)(s))
}
-// LoadUint16x16Slice loads an Uint16x16 from a slice of at least 16 uint16s
-func LoadUint16x16Slice(s []uint16) Uint16x16 {
- return LoadUint16x16((*[16]uint16)(s))
-}
-
-// StoreSlice stores x into a slice of at least 16 uint16s
-func (x Uint16x16) StoreSlice(s []uint16) {
- x.Store((*[16]uint16)(s))
-}
-
// LoadInt32x8Slice loads an Int32x8 from a slice of at least 8 int32s
func LoadInt32x8Slice(s []int32) Int32x8 {
return LoadInt32x8((*[8]int32)(s))
x.Store((*[8]int32)(s))
}
-// LoadUint32x8Slice loads an Uint32x8 from a slice of at least 8 uint32s
-func LoadUint32x8Slice(s []uint32) Uint32x8 {
- return LoadUint32x8((*[8]uint32)(s))
-}
-
-// StoreSlice stores x into a slice of at least 8 uint32s
-func (x Uint32x8) StoreSlice(s []uint32) {
- x.Store((*[8]uint32)(s))
-}
-
// LoadInt64x4Slice loads an Int64x4 from a slice of at least 4 int64s
func LoadInt64x4Slice(s []int64) Int64x4 {
return LoadInt64x4((*[4]int64)(s))
x.Store((*[4]int64)(s))
}
+// LoadUint8x32Slice loads an Uint8x32 from a slice of at least 32 uint8s
+func LoadUint8x32Slice(s []uint8) Uint8x32 {
+ return LoadUint8x32((*[32]uint8)(s))
+}
+
+// StoreSlice stores x into a slice of at least 32 uint8s
+func (x Uint8x32) StoreSlice(s []uint8) {
+ x.Store((*[32]uint8)(s))
+}
+
+// LoadUint16x16Slice loads an Uint16x16 from a slice of at least 16 uint16s
+func LoadUint16x16Slice(s []uint16) Uint16x16 {
+ return LoadUint16x16((*[16]uint16)(s))
+}
+
+// StoreSlice stores x into a slice of at least 16 uint16s
+func (x Uint16x16) StoreSlice(s []uint16) {
+ x.Store((*[16]uint16)(s))
+}
+
+// LoadUint32x8Slice loads an Uint32x8 from a slice of at least 8 uint32s
+func LoadUint32x8Slice(s []uint32) Uint32x8 {
+ return LoadUint32x8((*[8]uint32)(s))
+}
+
+// StoreSlice stores x into a slice of at least 8 uint32s
+func (x Uint32x8) StoreSlice(s []uint32) {
+ x.Store((*[8]uint32)(s))
+}
+
// LoadUint64x4Slice loads an Uint64x4 from a slice of at least 4 uint64s
func LoadUint64x4Slice(s []uint64) Uint64x4 {
return LoadUint64x4((*[4]uint64)(s))
x.Store((*[64]int8)(s))
}
-// LoadUint8x64Slice loads an Uint8x64 from a slice of at least 64 uint8s
-func LoadUint8x64Slice(s []uint8) Uint8x64 {
- return LoadUint8x64((*[64]uint8)(s))
-}
-
-// StoreSlice stores x into a slice of at least 64 uint8s
-func (x Uint8x64) StoreSlice(s []uint8) {
- x.Store((*[64]uint8)(s))
-}
-
// LoadInt16x32Slice loads an Int16x32 from a slice of at least 32 int16s
func LoadInt16x32Slice(s []int16) Int16x32 {
return LoadInt16x32((*[32]int16)(s))
x.Store((*[32]int16)(s))
}
-// LoadUint16x32Slice loads an Uint16x32 from a slice of at least 32 uint16s
-func LoadUint16x32Slice(s []uint16) Uint16x32 {
- return LoadUint16x32((*[32]uint16)(s))
-}
-
-// StoreSlice stores x into a slice of at least 32 uint16s
-func (x Uint16x32) StoreSlice(s []uint16) {
- x.Store((*[32]uint16)(s))
-}
-
// LoadInt32x16Slice loads an Int32x16 from a slice of at least 16 int32s
func LoadInt32x16Slice(s []int32) Int32x16 {
return LoadInt32x16((*[16]int32)(s))
x.Store((*[16]int32)(s))
}
-// LoadUint32x16Slice loads an Uint32x16 from a slice of at least 16 uint32s
-func LoadUint32x16Slice(s []uint32) Uint32x16 {
- return LoadUint32x16((*[16]uint32)(s))
-}
-
-// StoreSlice stores x into a slice of at least 16 uint32s
-func (x Uint32x16) StoreSlice(s []uint32) {
- x.Store((*[16]uint32)(s))
-}
-
// LoadInt64x8Slice loads an Int64x8 from a slice of at least 8 int64s
func LoadInt64x8Slice(s []int64) Int64x8 {
return LoadInt64x8((*[8]int64)(s))
x.Store((*[8]int64)(s))
}
+// LoadUint8x64Slice loads an Uint8x64 from a slice of at least 64 uint8s
+func LoadUint8x64Slice(s []uint8) Uint8x64 {
+ return LoadUint8x64((*[64]uint8)(s))
+}
+
+// StoreSlice stores x into a slice of at least 64 uint8s
+func (x Uint8x64) StoreSlice(s []uint8) {
+ x.Store((*[64]uint8)(s))
+}
+
+// LoadUint16x32Slice loads an Uint16x32 from a slice of at least 32 uint16s
+func LoadUint16x32Slice(s []uint16) Uint16x32 {
+ return LoadUint16x32((*[32]uint16)(s))
+}
+
+// StoreSlice stores x into a slice of at least 32 uint16s
+func (x Uint16x32) StoreSlice(s []uint16) {
+ x.Store((*[32]uint16)(s))
+}
+
+// LoadUint32x16Slice loads an Uint32x16 from a slice of at least 16 uint32s
+func LoadUint32x16Slice(s []uint32) Uint32x16 {
+ return LoadUint32x16((*[16]uint32)(s))
+}
+
+// StoreSlice stores x into a slice of at least 16 uint32s
+func (x Uint32x16) StoreSlice(s []uint32) {
+ x.Store((*[16]uint32)(s))
+}
+
// LoadUint64x8Slice loads an Uint64x8 from a slice of at least 8 uint64s
func LoadUint64x8Slice(s []uint64) Uint64x8 {
return LoadUint64x8((*[8]uint64)(s))
})
}
-// testUint8x16Ternary tests the simd ternary method f against the expected behavior generated by want
-func testUint8x16Ternary(t *testing.T, f func(_, _, _ simd.Uint8x16) simd.Uint8x16, want func(_, _, _ []uint8) []uint8) {
- n := 16
- t.Helper()
- forSliceTriple(t, uint8s, n, func(x, y, z []uint8) bool {
- t.Helper()
- a := simd.LoadUint8x16Slice(x)
- b := simd.LoadUint8x16Slice(y)
- c := simd.LoadUint8x16Slice(z)
- g := make([]uint8, n)
- f(a, b, c).StoreSlice(g)
- w := want(x, y, z)
- return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("z=%v", z) })
- })
-}
-
// testInt16x8Ternary tests the simd ternary method f against the expected behavior generated by want
func testInt16x8Ternary(t *testing.T, f func(_, _, _ simd.Int16x8) simd.Int16x8, want func(_, _, _ []int16) []int16) {
n := 8
})
}
-// testUint16x8Ternary tests the simd ternary method f against the expected behavior generated by want
-func testUint16x8Ternary(t *testing.T, f func(_, _, _ simd.Uint16x8) simd.Uint16x8, want func(_, _, _ []uint16) []uint16) {
- n := 8
- t.Helper()
- forSliceTriple(t, uint16s, n, func(x, y, z []uint16) bool {
- t.Helper()
- a := simd.LoadUint16x8Slice(x)
- b := simd.LoadUint16x8Slice(y)
- c := simd.LoadUint16x8Slice(z)
- g := make([]uint16, n)
- f(a, b, c).StoreSlice(g)
- w := want(x, y, z)
- return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("z=%v", z) })
- })
-}
-
// testInt32x4Ternary tests the simd ternary method f against the expected behavior generated by want
func testInt32x4Ternary(t *testing.T, f func(_, _, _ simd.Int32x4) simd.Int32x4, want func(_, _, _ []int32) []int32) {
n := 4
})
}
-// testUint32x4Ternary tests the simd ternary method f against the expected behavior generated by want
-func testUint32x4Ternary(t *testing.T, f func(_, _, _ simd.Uint32x4) simd.Uint32x4, want func(_, _, _ []uint32) []uint32) {
- n := 4
- t.Helper()
- forSliceTriple(t, uint32s, n, func(x, y, z []uint32) bool {
- t.Helper()
- a := simd.LoadUint32x4Slice(x)
- b := simd.LoadUint32x4Slice(y)
- c := simd.LoadUint32x4Slice(z)
- g := make([]uint32, n)
- f(a, b, c).StoreSlice(g)
- w := want(x, y, z)
- return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("z=%v", z) })
- })
-}
-
// testInt64x2Ternary tests the simd ternary method f against the expected behavior generated by want
func testInt64x2Ternary(t *testing.T, f func(_, _, _ simd.Int64x2) simd.Int64x2, want func(_, _, _ []int64) []int64) {
n := 2
})
}
+// testUint8x16Ternary tests the simd ternary method f against the expected behavior generated by want
+func testUint8x16Ternary(t *testing.T, f func(_, _, _ simd.Uint8x16) simd.Uint8x16, want func(_, _, _ []uint8) []uint8) {
+ n := 16
+ t.Helper()
+ forSliceTriple(t, uint8s, n, func(x, y, z []uint8) bool {
+ t.Helper()
+ a := simd.LoadUint8x16Slice(x)
+ b := simd.LoadUint8x16Slice(y)
+ c := simd.LoadUint8x16Slice(z)
+ g := make([]uint8, n)
+ f(a, b, c).StoreSlice(g)
+ w := want(x, y, z)
+ return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("z=%v", z) })
+ })
+}
+
+// testUint16x8Ternary tests the simd ternary method f against the expected behavior generated by want
+func testUint16x8Ternary(t *testing.T, f func(_, _, _ simd.Uint16x8) simd.Uint16x8, want func(_, _, _ []uint16) []uint16) {
+ n := 8
+ t.Helper()
+ forSliceTriple(t, uint16s, n, func(x, y, z []uint16) bool {
+ t.Helper()
+ a := simd.LoadUint16x8Slice(x)
+ b := simd.LoadUint16x8Slice(y)
+ c := simd.LoadUint16x8Slice(z)
+ g := make([]uint16, n)
+ f(a, b, c).StoreSlice(g)
+ w := want(x, y, z)
+ return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("z=%v", z) })
+ })
+}
+
+// testUint32x4Ternary tests the simd ternary method f against the expected behavior generated by want
+func testUint32x4Ternary(t *testing.T, f func(_, _, _ simd.Uint32x4) simd.Uint32x4, want func(_, _, _ []uint32) []uint32) {
+ n := 4
+ t.Helper()
+ forSliceTriple(t, uint32s, n, func(x, y, z []uint32) bool {
+ t.Helper()
+ a := simd.LoadUint32x4Slice(x)
+ b := simd.LoadUint32x4Slice(y)
+ c := simd.LoadUint32x4Slice(z)
+ g := make([]uint32, n)
+ f(a, b, c).StoreSlice(g)
+ w := want(x, y, z)
+ return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("z=%v", z) })
+ })
+}
+
// testUint64x2Ternary tests the simd ternary method f against the expected behavior generated by want
func testUint64x2Ternary(t *testing.T, f func(_, _, _ simd.Uint64x2) simd.Uint64x2, want func(_, _, _ []uint64) []uint64) {
n := 2
})
}
-// testUint8x32Ternary tests the simd ternary method f against the expected behavior generated by want
-func testUint8x32Ternary(t *testing.T, f func(_, _, _ simd.Uint8x32) simd.Uint8x32, want func(_, _, _ []uint8) []uint8) {
- n := 32
- t.Helper()
- forSliceTriple(t, uint8s, n, func(x, y, z []uint8) bool {
- t.Helper()
- a := simd.LoadUint8x32Slice(x)
- b := simd.LoadUint8x32Slice(y)
- c := simd.LoadUint8x32Slice(z)
- g := make([]uint8, n)
- f(a, b, c).StoreSlice(g)
- w := want(x, y, z)
- return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("z=%v", z) })
- })
-}
-
// testInt16x16Ternary tests the simd ternary method f against the expected behavior generated by want
func testInt16x16Ternary(t *testing.T, f func(_, _, _ simd.Int16x16) simd.Int16x16, want func(_, _, _ []int16) []int16) {
n := 16
})
}
-// testUint16x16Ternary tests the simd ternary method f against the expected behavior generated by want
-func testUint16x16Ternary(t *testing.T, f func(_, _, _ simd.Uint16x16) simd.Uint16x16, want func(_, _, _ []uint16) []uint16) {
- n := 16
- t.Helper()
- forSliceTriple(t, uint16s, n, func(x, y, z []uint16) bool {
- t.Helper()
- a := simd.LoadUint16x16Slice(x)
- b := simd.LoadUint16x16Slice(y)
- c := simd.LoadUint16x16Slice(z)
- g := make([]uint16, n)
- f(a, b, c).StoreSlice(g)
- w := want(x, y, z)
- return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("z=%v", z) })
- })
-}
-
// testInt32x8Ternary tests the simd ternary method f against the expected behavior generated by want
func testInt32x8Ternary(t *testing.T, f func(_, _, _ simd.Int32x8) simd.Int32x8, want func(_, _, _ []int32) []int32) {
n := 8
})
}
-// testUint32x8Ternary tests the simd ternary method f against the expected behavior generated by want
-func testUint32x8Ternary(t *testing.T, f func(_, _, _ simd.Uint32x8) simd.Uint32x8, want func(_, _, _ []uint32) []uint32) {
- n := 8
- t.Helper()
- forSliceTriple(t, uint32s, n, func(x, y, z []uint32) bool {
- t.Helper()
- a := simd.LoadUint32x8Slice(x)
- b := simd.LoadUint32x8Slice(y)
- c := simd.LoadUint32x8Slice(z)
- g := make([]uint32, n)
- f(a, b, c).StoreSlice(g)
- w := want(x, y, z)
- return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("z=%v", z) })
- })
-}
-
// testInt64x4Ternary tests the simd ternary method f against the expected behavior generated by want
func testInt64x4Ternary(t *testing.T, f func(_, _, _ simd.Int64x4) simd.Int64x4, want func(_, _, _ []int64) []int64) {
n := 4
})
}
+// testUint8x32Ternary tests the simd ternary method f against the expected behavior generated by want
+func testUint8x32Ternary(t *testing.T, f func(_, _, _ simd.Uint8x32) simd.Uint8x32, want func(_, _, _ []uint8) []uint8) {
+ n := 32
+ t.Helper()
+ forSliceTriple(t, uint8s, n, func(x, y, z []uint8) bool {
+ t.Helper()
+ a := simd.LoadUint8x32Slice(x)
+ b := simd.LoadUint8x32Slice(y)
+ c := simd.LoadUint8x32Slice(z)
+ g := make([]uint8, n)
+ f(a, b, c).StoreSlice(g)
+ w := want(x, y, z)
+ return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("z=%v", z) })
+ })
+}
+
+// testUint16x16Ternary tests the simd ternary method f against the expected behavior generated by want
+func testUint16x16Ternary(t *testing.T, f func(_, _, _ simd.Uint16x16) simd.Uint16x16, want func(_, _, _ []uint16) []uint16) {
+ n := 16
+ t.Helper()
+ forSliceTriple(t, uint16s, n, func(x, y, z []uint16) bool {
+ t.Helper()
+ a := simd.LoadUint16x16Slice(x)
+ b := simd.LoadUint16x16Slice(y)
+ c := simd.LoadUint16x16Slice(z)
+ g := make([]uint16, n)
+ f(a, b, c).StoreSlice(g)
+ w := want(x, y, z)
+ return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("z=%v", z) })
+ })
+}
+
+// testUint32x8Ternary tests the simd ternary method f against the expected behavior generated by want
+func testUint32x8Ternary(t *testing.T, f func(_, _, _ simd.Uint32x8) simd.Uint32x8, want func(_, _, _ []uint32) []uint32) {
+ n := 8
+ t.Helper()
+ forSliceTriple(t, uint32s, n, func(x, y, z []uint32) bool {
+ t.Helper()
+ a := simd.LoadUint32x8Slice(x)
+ b := simd.LoadUint32x8Slice(y)
+ c := simd.LoadUint32x8Slice(z)
+ g := make([]uint32, n)
+ f(a, b, c).StoreSlice(g)
+ w := want(x, y, z)
+ return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("z=%v", z) })
+ })
+}
+
// testUint64x4Ternary tests the simd ternary method f against the expected behavior generated by want
func testUint64x4Ternary(t *testing.T, f func(_, _, _ simd.Uint64x4) simd.Uint64x4, want func(_, _, _ []uint64) []uint64) {
n := 4
})
}
-// testUint8x64Ternary tests the simd ternary method f against the expected behavior generated by want
-func testUint8x64Ternary(t *testing.T, f func(_, _, _ simd.Uint8x64) simd.Uint8x64, want func(_, _, _ []uint8) []uint8) {
- n := 64
- t.Helper()
- forSliceTriple(t, uint8s, n, func(x, y, z []uint8) bool {
- t.Helper()
- a := simd.LoadUint8x64Slice(x)
- b := simd.LoadUint8x64Slice(y)
- c := simd.LoadUint8x64Slice(z)
- g := make([]uint8, n)
- f(a, b, c).StoreSlice(g)
- w := want(x, y, z)
- return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("z=%v", z) })
- })
-}
-
// testInt16x32Ternary tests the simd ternary method f against the expected behavior generated by want
func testInt16x32Ternary(t *testing.T, f func(_, _, _ simd.Int16x32) simd.Int16x32, want func(_, _, _ []int16) []int16) {
n := 32
})
}
-// testUint16x32Ternary tests the simd ternary method f against the expected behavior generated by want
-func testUint16x32Ternary(t *testing.T, f func(_, _, _ simd.Uint16x32) simd.Uint16x32, want func(_, _, _ []uint16) []uint16) {
- n := 32
- t.Helper()
- forSliceTriple(t, uint16s, n, func(x, y, z []uint16) bool {
- t.Helper()
- a := simd.LoadUint16x32Slice(x)
- b := simd.LoadUint16x32Slice(y)
- c := simd.LoadUint16x32Slice(z)
- g := make([]uint16, n)
- f(a, b, c).StoreSlice(g)
- w := want(x, y, z)
- return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("z=%v", z) })
- })
-}
-
// testInt32x16Ternary tests the simd ternary method f against the expected behavior generated by want
func testInt32x16Ternary(t *testing.T, f func(_, _, _ simd.Int32x16) simd.Int32x16, want func(_, _, _ []int32) []int32) {
n := 16
})
}
-// testUint32x16Ternary tests the simd ternary method f against the expected behavior generated by want
-func testUint32x16Ternary(t *testing.T, f func(_, _, _ simd.Uint32x16) simd.Uint32x16, want func(_, _, _ []uint32) []uint32) {
- n := 16
- t.Helper()
- forSliceTriple(t, uint32s, n, func(x, y, z []uint32) bool {
- t.Helper()
- a := simd.LoadUint32x16Slice(x)
- b := simd.LoadUint32x16Slice(y)
- c := simd.LoadUint32x16Slice(z)
- g := make([]uint32, n)
- f(a, b, c).StoreSlice(g)
- w := want(x, y, z)
- return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("z=%v", z) })
- })
-}
-
// testInt64x8Ternary tests the simd ternary method f against the expected behavior generated by want
func testInt64x8Ternary(t *testing.T, f func(_, _, _ simd.Int64x8) simd.Int64x8, want func(_, _, _ []int64) []int64) {
n := 8
})
}
+// testUint8x64Ternary tests the simd ternary method f against the expected behavior generated by want
+func testUint8x64Ternary(t *testing.T, f func(_, _, _ simd.Uint8x64) simd.Uint8x64, want func(_, _, _ []uint8) []uint8) {
+ n := 64
+ t.Helper()
+ forSliceTriple(t, uint8s, n, func(x, y, z []uint8) bool {
+ t.Helper()
+ a := simd.LoadUint8x64Slice(x)
+ b := simd.LoadUint8x64Slice(y)
+ c := simd.LoadUint8x64Slice(z)
+ g := make([]uint8, n)
+ f(a, b, c).StoreSlice(g)
+ w := want(x, y, z)
+ return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("z=%v", z) })
+ })
+}
+
+// testUint16x32Ternary tests the simd ternary method f against the expected behavior generated by want
+func testUint16x32Ternary(t *testing.T, f func(_, _, _ simd.Uint16x32) simd.Uint16x32, want func(_, _, _ []uint16) []uint16) {
+ n := 32
+ t.Helper()
+ forSliceTriple(t, uint16s, n, func(x, y, z []uint16) bool {
+ t.Helper()
+ a := simd.LoadUint16x32Slice(x)
+ b := simd.LoadUint16x32Slice(y)
+ c := simd.LoadUint16x32Slice(z)
+ g := make([]uint16, n)
+ f(a, b, c).StoreSlice(g)
+ w := want(x, y, z)
+ return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("z=%v", z) })
+ })
+}
+
+// testUint32x16Ternary tests the simd ternary method f against the expected behavior generated by want
+func testUint32x16Ternary(t *testing.T, f func(_, _, _ simd.Uint32x16) simd.Uint32x16, want func(_, _, _ []uint32) []uint32) {
+ n := 16
+ t.Helper()
+ forSliceTriple(t, uint32s, n, func(x, y, z []uint32) bool {
+ t.Helper()
+ a := simd.LoadUint32x16Slice(x)
+ b := simd.LoadUint32x16Slice(y)
+ c := simd.LoadUint32x16Slice(z)
+ g := make([]uint32, n)
+ f(a, b, c).StoreSlice(g)
+ w := want(x, y, z)
+ return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("z=%v", z) })
+ })
+}
+
// testUint64x8Ternary tests the simd ternary method f against the expected behavior generated by want
func testUint64x8Ternary(t *testing.T, f func(_, _, _ simd.Uint64x8) simd.Uint64x8, want func(_, _, _ []uint64) []uint64) {
n := 8
})
}
-// testUint8x16Unary tests the simd unary method f against the expected behavior generated by want
-func testUint8x16Unary(t *testing.T, f func(_ simd.Uint8x16) simd.Uint8x16, want func(_ []uint8) []uint8) {
- n := 16
+// testInt16x8Unary tests the simd unary method f against the expected behavior generated by want
+func testInt16x8Unary(t *testing.T, f func(_ simd.Int16x8) simd.Int16x8, want func(_ []int16) []int16) {
+ n := 8
t.Helper()
- forSlice(t, uint8s, n, func(x []uint8) bool {
+ forSlice(t, int16s, n, func(x []int16) bool {
t.Helper()
- a := simd.LoadUint8x16Slice(x)
- g := make([]uint8, n)
+ a := simd.LoadInt16x8Slice(x)
+ g := make([]int16, n)
f(a).StoreSlice(g)
w := want(x)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
})
}
-// testInt16x8Unary tests the simd unary method f against the expected behavior generated by want
-func testInt16x8Unary(t *testing.T, f func(_ simd.Int16x8) simd.Int16x8, want func(_ []int16) []int16) {
- n := 8
+// testInt32x4Unary tests the simd unary method f against the expected behavior generated by want
+func testInt32x4Unary(t *testing.T, f func(_ simd.Int32x4) simd.Int32x4, want func(_ []int32) []int32) {
+ n := 4
t.Helper()
- forSlice(t, int16s, n, func(x []int16) bool {
+ forSlice(t, int32s, n, func(x []int32) bool {
t.Helper()
- a := simd.LoadInt16x8Slice(x)
- g := make([]int16, n)
+ a := simd.LoadInt32x4Slice(x)
+ g := make([]int32, n)
f(a).StoreSlice(g)
w := want(x)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
})
}
-// testUint16x8Unary tests the simd unary method f against the expected behavior generated by want
-func testUint16x8Unary(t *testing.T, f func(_ simd.Uint16x8) simd.Uint16x8, want func(_ []uint16) []uint16) {
- n := 8
+// testInt64x2Unary tests the simd unary method f against the expected behavior generated by want
+func testInt64x2Unary(t *testing.T, f func(_ simd.Int64x2) simd.Int64x2, want func(_ []int64) []int64) {
+ n := 2
t.Helper()
- forSlice(t, uint16s, n, func(x []uint16) bool {
+ forSlice(t, int64s, n, func(x []int64) bool {
t.Helper()
- a := simd.LoadUint16x8Slice(x)
- g := make([]uint16, n)
+ a := simd.LoadInt64x2Slice(x)
+ g := make([]int64, n)
f(a).StoreSlice(g)
w := want(x)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
})
}
-// testInt32x4Unary tests the simd unary method f against the expected behavior generated by want
-func testInt32x4Unary(t *testing.T, f func(_ simd.Int32x4) simd.Int32x4, want func(_ []int32) []int32) {
- n := 4
+// testUint8x16Unary tests the simd unary method f against the expected behavior generated by want
+func testUint8x16Unary(t *testing.T, f func(_ simd.Uint8x16) simd.Uint8x16, want func(_ []uint8) []uint8) {
+ n := 16
t.Helper()
- forSlice(t, int32s, n, func(x []int32) bool {
+ forSlice(t, uint8s, n, func(x []uint8) bool {
t.Helper()
- a := simd.LoadInt32x4Slice(x)
- g := make([]int32, n)
+ a := simd.LoadUint8x16Slice(x)
+ g := make([]uint8, n)
f(a).StoreSlice(g)
w := want(x)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
})
}
-// testUint32x4Unary tests the simd unary method f against the expected behavior generated by want
-func testUint32x4Unary(t *testing.T, f func(_ simd.Uint32x4) simd.Uint32x4, want func(_ []uint32) []uint32) {
- n := 4
+// testUint16x8Unary tests the simd unary method f against the expected behavior generated by want
+func testUint16x8Unary(t *testing.T, f func(_ simd.Uint16x8) simd.Uint16x8, want func(_ []uint16) []uint16) {
+ n := 8
t.Helper()
- forSlice(t, uint32s, n, func(x []uint32) bool {
+ forSlice(t, uint16s, n, func(x []uint16) bool {
t.Helper()
- a := simd.LoadUint32x4Slice(x)
- g := make([]uint32, n)
+ a := simd.LoadUint16x8Slice(x)
+ g := make([]uint16, n)
f(a).StoreSlice(g)
w := want(x)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
})
}
-// testInt64x2Unary tests the simd unary method f against the expected behavior generated by want
-func testInt64x2Unary(t *testing.T, f func(_ simd.Int64x2) simd.Int64x2, want func(_ []int64) []int64) {
- n := 2
+// testUint32x4Unary tests the simd unary method f against the expected behavior generated by want
+func testUint32x4Unary(t *testing.T, f func(_ simd.Uint32x4) simd.Uint32x4, want func(_ []uint32) []uint32) {
+ n := 4
t.Helper()
- forSlice(t, int64s, n, func(x []int64) bool {
+ forSlice(t, uint32s, n, func(x []uint32) bool {
t.Helper()
- a := simd.LoadInt64x2Slice(x)
- g := make([]int64, n)
+ a := simd.LoadUint32x4Slice(x)
+ g := make([]uint32, n)
f(a).StoreSlice(g)
w := want(x)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
})
}
-// testUint8x32Unary tests the simd unary method f against the expected behavior generated by want
-func testUint8x32Unary(t *testing.T, f func(_ simd.Uint8x32) simd.Uint8x32, want func(_ []uint8) []uint8) {
- n := 32
+// testInt16x16Unary tests the simd unary method f against the expected behavior generated by want
+func testInt16x16Unary(t *testing.T, f func(_ simd.Int16x16) simd.Int16x16, want func(_ []int16) []int16) {
+ n := 16
t.Helper()
- forSlice(t, uint8s, n, func(x []uint8) bool {
+ forSlice(t, int16s, n, func(x []int16) bool {
t.Helper()
- a := simd.LoadUint8x32Slice(x)
- g := make([]uint8, n)
+ a := simd.LoadInt16x16Slice(x)
+ g := make([]int16, n)
f(a).StoreSlice(g)
w := want(x)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
})
}
-// testInt16x16Unary tests the simd unary method f against the expected behavior generated by want
-func testInt16x16Unary(t *testing.T, f func(_ simd.Int16x16) simd.Int16x16, want func(_ []int16) []int16) {
- n := 16
+// testInt32x8Unary tests the simd unary method f against the expected behavior generated by want
+func testInt32x8Unary(t *testing.T, f func(_ simd.Int32x8) simd.Int32x8, want func(_ []int32) []int32) {
+ n := 8
t.Helper()
- forSlice(t, int16s, n, func(x []int16) bool {
+ forSlice(t, int32s, n, func(x []int32) bool {
t.Helper()
- a := simd.LoadInt16x16Slice(x)
- g := make([]int16, n)
+ a := simd.LoadInt32x8Slice(x)
+ g := make([]int32, n)
f(a).StoreSlice(g)
w := want(x)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
})
}
-// testUint16x16Unary tests the simd unary method f against the expected behavior generated by want
-func testUint16x16Unary(t *testing.T, f func(_ simd.Uint16x16) simd.Uint16x16, want func(_ []uint16) []uint16) {
- n := 16
+// testInt64x4Unary tests the simd unary method f against the expected behavior generated by want
+func testInt64x4Unary(t *testing.T, f func(_ simd.Int64x4) simd.Int64x4, want func(_ []int64) []int64) {
+ n := 4
t.Helper()
- forSlice(t, uint16s, n, func(x []uint16) bool {
+ forSlice(t, int64s, n, func(x []int64) bool {
t.Helper()
- a := simd.LoadUint16x16Slice(x)
- g := make([]uint16, n)
+ a := simd.LoadInt64x4Slice(x)
+ g := make([]int64, n)
f(a).StoreSlice(g)
w := want(x)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
})
}
-// testInt32x8Unary tests the simd unary method f against the expected behavior generated by want
-func testInt32x8Unary(t *testing.T, f func(_ simd.Int32x8) simd.Int32x8, want func(_ []int32) []int32) {
- n := 8
+// testUint8x32Unary tests the simd unary method f against the expected behavior generated by want
+func testUint8x32Unary(t *testing.T, f func(_ simd.Uint8x32) simd.Uint8x32, want func(_ []uint8) []uint8) {
+ n := 32
t.Helper()
- forSlice(t, int32s, n, func(x []int32) bool {
+ forSlice(t, uint8s, n, func(x []uint8) bool {
t.Helper()
- a := simd.LoadInt32x8Slice(x)
- g := make([]int32, n)
+ a := simd.LoadUint8x32Slice(x)
+ g := make([]uint8, n)
f(a).StoreSlice(g)
w := want(x)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
})
}
-// testUint32x8Unary tests the simd unary method f against the expected behavior generated by want
-func testUint32x8Unary(t *testing.T, f func(_ simd.Uint32x8) simd.Uint32x8, want func(_ []uint32) []uint32) {
- n := 8
+// testUint16x16Unary tests the simd unary method f against the expected behavior generated by want
+func testUint16x16Unary(t *testing.T, f func(_ simd.Uint16x16) simd.Uint16x16, want func(_ []uint16) []uint16) {
+ n := 16
t.Helper()
- forSlice(t, uint32s, n, func(x []uint32) bool {
+ forSlice(t, uint16s, n, func(x []uint16) bool {
t.Helper()
- a := simd.LoadUint32x8Slice(x)
- g := make([]uint32, n)
+ a := simd.LoadUint16x16Slice(x)
+ g := make([]uint16, n)
f(a).StoreSlice(g)
w := want(x)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
})
}
-// testInt64x4Unary tests the simd unary method f against the expected behavior generated by want
-func testInt64x4Unary(t *testing.T, f func(_ simd.Int64x4) simd.Int64x4, want func(_ []int64) []int64) {
- n := 4
+// testUint32x8Unary tests the simd unary method f against the expected behavior generated by want
+func testUint32x8Unary(t *testing.T, f func(_ simd.Uint32x8) simd.Uint32x8, want func(_ []uint32) []uint32) {
+ n := 8
t.Helper()
- forSlice(t, int64s, n, func(x []int64) bool {
+ forSlice(t, uint32s, n, func(x []uint32) bool {
t.Helper()
- a := simd.LoadInt64x4Slice(x)
- g := make([]int64, n)
+ a := simd.LoadUint32x8Slice(x)
+ g := make([]uint32, n)
f(a).StoreSlice(g)
w := want(x)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
})
}
-// testUint8x64Unary tests the simd unary method f against the expected behavior generated by want
-func testUint8x64Unary(t *testing.T, f func(_ simd.Uint8x64) simd.Uint8x64, want func(_ []uint8) []uint8) {
- n := 64
+// testInt16x32Unary tests the simd unary method f against the expected behavior generated by want
+func testInt16x32Unary(t *testing.T, f func(_ simd.Int16x32) simd.Int16x32, want func(_ []int16) []int16) {
+ n := 32
t.Helper()
- forSlice(t, uint8s, n, func(x []uint8) bool {
+ forSlice(t, int16s, n, func(x []int16) bool {
t.Helper()
- a := simd.LoadUint8x64Slice(x)
- g := make([]uint8, n)
+ a := simd.LoadInt16x32Slice(x)
+ g := make([]int16, n)
f(a).StoreSlice(g)
w := want(x)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
})
}
-// testInt16x32Unary tests the simd unary method f against the expected behavior generated by want
-func testInt16x32Unary(t *testing.T, f func(_ simd.Int16x32) simd.Int16x32, want func(_ []int16) []int16) {
- n := 32
+// testInt32x16Unary tests the simd unary method f against the expected behavior generated by want
+func testInt32x16Unary(t *testing.T, f func(_ simd.Int32x16) simd.Int32x16, want func(_ []int32) []int32) {
+ n := 16
t.Helper()
- forSlice(t, int16s, n, func(x []int16) bool {
+ forSlice(t, int32s, n, func(x []int32) bool {
t.Helper()
- a := simd.LoadInt16x32Slice(x)
- g := make([]int16, n)
+ a := simd.LoadInt32x16Slice(x)
+ g := make([]int32, n)
f(a).StoreSlice(g)
w := want(x)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
})
}
-// testUint16x32Unary tests the simd unary method f against the expected behavior generated by want
-func testUint16x32Unary(t *testing.T, f func(_ simd.Uint16x32) simd.Uint16x32, want func(_ []uint16) []uint16) {
- n := 32
+// testInt64x8Unary tests the simd unary method f against the expected behavior generated by want
+func testInt64x8Unary(t *testing.T, f func(_ simd.Int64x8) simd.Int64x8, want func(_ []int64) []int64) {
+ n := 8
t.Helper()
- forSlice(t, uint16s, n, func(x []uint16) bool {
+ forSlice(t, int64s, n, func(x []int64) bool {
t.Helper()
- a := simd.LoadUint16x32Slice(x)
- g := make([]uint16, n)
+ a := simd.LoadInt64x8Slice(x)
+ g := make([]int64, n)
f(a).StoreSlice(g)
w := want(x)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
})
}
-// testInt32x16Unary tests the simd unary method f against the expected behavior generated by want
-func testInt32x16Unary(t *testing.T, f func(_ simd.Int32x16) simd.Int32x16, want func(_ []int32) []int32) {
- n := 16
+// testUint8x64Unary tests the simd unary method f against the expected behavior generated by want
+func testUint8x64Unary(t *testing.T, f func(_ simd.Uint8x64) simd.Uint8x64, want func(_ []uint8) []uint8) {
+ n := 64
t.Helper()
- forSlice(t, int32s, n, func(x []int32) bool {
+ forSlice(t, uint8s, n, func(x []uint8) bool {
t.Helper()
- a := simd.LoadInt32x16Slice(x)
- g := make([]int32, n)
+ a := simd.LoadUint8x64Slice(x)
+ g := make([]uint8, n)
f(a).StoreSlice(g)
w := want(x)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
})
}
-// testUint32x16Unary tests the simd unary method f against the expected behavior generated by want
-func testUint32x16Unary(t *testing.T, f func(_ simd.Uint32x16) simd.Uint32x16, want func(_ []uint32) []uint32) {
- n := 16
+// testUint16x32Unary tests the simd unary method f against the expected behavior generated by want
+func testUint16x32Unary(t *testing.T, f func(_ simd.Uint16x32) simd.Uint16x32, want func(_ []uint16) []uint16) {
+ n := 32
t.Helper()
- forSlice(t, uint32s, n, func(x []uint32) bool {
+ forSlice(t, uint16s, n, func(x []uint16) bool {
t.Helper()
- a := simd.LoadUint32x16Slice(x)
- g := make([]uint32, n)
+ a := simd.LoadUint16x32Slice(x)
+ g := make([]uint16, n)
f(a).StoreSlice(g)
w := want(x)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
})
}
-// testInt64x8Unary tests the simd unary method f against the expected behavior generated by want
-func testInt64x8Unary(t *testing.T, f func(_ simd.Int64x8) simd.Int64x8, want func(_ []int64) []int64) {
- n := 8
+// testUint32x16Unary tests the simd unary method f against the expected behavior generated by want
+func testUint32x16Unary(t *testing.T, f func(_ simd.Uint32x16) simd.Uint32x16, want func(_ []uint32) []uint32) {
+ n := 16
t.Helper()
- forSlice(t, int64s, n, func(x []int64) bool {
+ forSlice(t, uint32s, n, func(x []uint32) bool {
t.Helper()
- a := simd.LoadInt64x8Slice(x)
- g := make([]int64, n)
+ a := simd.LoadUint32x16Slice(x)
+ g := make([]uint32, n)
f(a).StoreSlice(g)
w := want(x)
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })