// Code generated by 'go run genfiles.go'; DO NOT EDIT. //go:build goexperiment.simd // This file contains functions testing simd methods that compare two operands under a mask. // Each function in this file is specialized for a // particular simd type x. package simd_test import ( "simd" "testing" ) // testInt8x16CompareMasked 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 testInt8x16CompareMasked(t *testing.T, f func(_, _ simd.Int8x16, m simd.Mask8x16) simd.Mask8x16, want func(_, _ []int8) []int64) { n := 16 t.Helper() forSlicePairMasked(t, int8s, n, func(x, y []int8, m []bool) bool { t.Helper() a := simd.LoadInt8x16Slice(x) b := simd.LoadInt8x16Slice(y) k := simd.LoadInt8x16Slice(toVect[int8](m)).ToMask() g := make([]int8, n) f(a, b, k).AsInt8x16().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // 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 testInt16x8CompareMasked(t *testing.T, f func(_, _ simd.Int16x8, m simd.Mask16x8) simd.Mask16x8, want func(_, _ []int16) []int64) { n := 8 t.Helper() forSlicePairMasked(t, int16s, n, func(x, y []int16, m []bool) bool { t.Helper() a := simd.LoadInt16x8Slice(x) b := simd.LoadInt16x8Slice(y) k := simd.LoadInt16x8Slice(toVect[int16](m)).ToMask() g := make([]int16, n) f(a, b, k).AsInt16x8().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // 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 testInt32x4CompareMasked(t *testing.T, f func(_, _ simd.Int32x4, m simd.Mask32x4) simd.Mask32x4, want func(_, _ []int32) []int64) { n := 4 t.Helper() forSlicePairMasked(t, int32s, n, func(x, y []int32, m []bool) bool { t.Helper() a := simd.LoadInt32x4Slice(x) b := simd.LoadInt32x4Slice(y) k := simd.LoadInt32x4Slice(toVect[int32](m)).ToMask() g := make([]int32, n) f(a, b, k).AsInt32x4().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // 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 testInt64x2CompareMasked(t *testing.T, f func(_, _ simd.Int64x2, m simd.Mask64x2) simd.Mask64x2, want func(_, _ []int64) []int64) { n := 2 t.Helper() forSlicePairMasked(t, int64s, n, func(x, y []int64, m []bool) bool { t.Helper() a := simd.LoadInt64x2Slice(x) b := simd.LoadInt64x2Slice(y) k := simd.LoadInt64x2Slice(toVect[int64](m)).ToMask() g := make([]int64, n) f(a, b, k).AsInt64x2().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // 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 testUint8x16CompareMasked(t *testing.T, f func(_, _ simd.Uint8x16, m simd.Mask8x16) simd.Mask8x16, want func(_, _ []uint8) []int64) { n := 16 t.Helper() forSlicePairMasked(t, uint8s, n, func(x, y []uint8, m []bool) bool { t.Helper() a := simd.LoadUint8x16Slice(x) b := simd.LoadUint8x16Slice(y) k := simd.LoadInt8x16Slice(toVect[int8](m)).ToMask() g := make([]int8, n) f(a, b, k).AsInt8x16().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // 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 testUint16x8CompareMasked(t *testing.T, f func(_, _ simd.Uint16x8, m simd.Mask16x8) simd.Mask16x8, want func(_, _ []uint16) []int64) { n := 8 t.Helper() forSlicePairMasked(t, uint16s, n, func(x, y []uint16, m []bool) bool { t.Helper() a := simd.LoadUint16x8Slice(x) b := simd.LoadUint16x8Slice(y) k := simd.LoadInt16x8Slice(toVect[int16](m)).ToMask() g := make([]int16, n) f(a, b, k).AsInt16x8().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // 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 testUint32x4CompareMasked(t *testing.T, f func(_, _ simd.Uint32x4, m simd.Mask32x4) simd.Mask32x4, want func(_, _ []uint32) []int64) { n := 4 t.Helper() forSlicePairMasked(t, uint32s, n, func(x, y []uint32, m []bool) bool { t.Helper() a := simd.LoadUint32x4Slice(x) b := simd.LoadUint32x4Slice(y) k := simd.LoadInt32x4Slice(toVect[int32](m)).ToMask() g := make([]int32, n) f(a, b, k).AsInt32x4().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // testUint64x2CompareMasked 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 testUint64x2CompareMasked(t *testing.T, f func(_, _ simd.Uint64x2, m simd.Mask64x2) simd.Mask64x2, want func(_, _ []uint64) []int64) { n := 2 t.Helper() forSlicePairMasked(t, uint64s, n, func(x, y []uint64, m []bool) bool { t.Helper() a := simd.LoadUint64x2Slice(x) b := simd.LoadUint64x2Slice(y) k := simd.LoadInt64x2Slice(toVect[int64](m)).ToMask() g := make([]int64, n) f(a, b, k).AsInt64x2().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // testFloat32x4CompareMasked 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 testFloat32x4CompareMasked(t *testing.T, f func(_, _ simd.Float32x4, m simd.Mask32x4) simd.Mask32x4, want func(_, _ []float32) []int64) { n := 4 t.Helper() forSlicePairMasked(t, float32s, n, func(x, y []float32, m []bool) bool { t.Helper() a := simd.LoadFloat32x4Slice(x) b := simd.LoadFloat32x4Slice(y) k := simd.LoadInt32x4Slice(toVect[int32](m)).ToMask() g := make([]int32, n) f(a, b, k).AsInt32x4().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // testFloat64x2CompareMasked 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 testFloat64x2CompareMasked(t *testing.T, f func(_, _ simd.Float64x2, m simd.Mask64x2) simd.Mask64x2, want func(_, _ []float64) []int64) { n := 2 t.Helper() forSlicePairMasked(t, float64s, n, func(x, y []float64, m []bool) bool { t.Helper() a := simd.LoadFloat64x2Slice(x) b := simd.LoadFloat64x2Slice(y) k := simd.LoadInt64x2Slice(toVect[int64](m)).ToMask() g := make([]int64, n) f(a, b, k).AsInt64x2().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // testInt8x32CompareMasked 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 testInt8x32CompareMasked(t *testing.T, f func(_, _ simd.Int8x32, m simd.Mask8x32) simd.Mask8x32, want func(_, _ []int8) []int64) { n := 32 t.Helper() forSlicePairMasked(t, int8s, n, func(x, y []int8, m []bool) bool { t.Helper() a := simd.LoadInt8x32Slice(x) b := simd.LoadInt8x32Slice(y) k := simd.LoadInt8x32Slice(toVect[int8](m)).ToMask() g := make([]int8, n) f(a, b, k).AsInt8x32().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // 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 testInt16x16CompareMasked(t *testing.T, f func(_, _ simd.Int16x16, m simd.Mask16x16) simd.Mask16x16, want func(_, _ []int16) []int64) { n := 16 t.Helper() forSlicePairMasked(t, int16s, n, func(x, y []int16, m []bool) bool { t.Helper() a := simd.LoadInt16x16Slice(x) b := simd.LoadInt16x16Slice(y) k := simd.LoadInt16x16Slice(toVect[int16](m)).ToMask() g := make([]int16, n) f(a, b, k).AsInt16x16().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // 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 testInt32x8CompareMasked(t *testing.T, f func(_, _ simd.Int32x8, m simd.Mask32x8) simd.Mask32x8, want func(_, _ []int32) []int64) { n := 8 t.Helper() forSlicePairMasked(t, int32s, n, func(x, y []int32, m []bool) bool { t.Helper() a := simd.LoadInt32x8Slice(x) b := simd.LoadInt32x8Slice(y) k := simd.LoadInt32x8Slice(toVect[int32](m)).ToMask() g := make([]int32, n) f(a, b, k).AsInt32x8().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // 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 testInt64x4CompareMasked(t *testing.T, f func(_, _ simd.Int64x4, m simd.Mask64x4) simd.Mask64x4, want func(_, _ []int64) []int64) { n := 4 t.Helper() forSlicePairMasked(t, int64s, n, func(x, y []int64, m []bool) bool { t.Helper() a := simd.LoadInt64x4Slice(x) b := simd.LoadInt64x4Slice(y) k := simd.LoadInt64x4Slice(toVect[int64](m)).ToMask() g := make([]int64, n) f(a, b, k).AsInt64x4().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // 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 testUint8x32CompareMasked(t *testing.T, f func(_, _ simd.Uint8x32, m simd.Mask8x32) simd.Mask8x32, want func(_, _ []uint8) []int64) { n := 32 t.Helper() forSlicePairMasked(t, uint8s, n, func(x, y []uint8, m []bool) bool { t.Helper() a := simd.LoadUint8x32Slice(x) b := simd.LoadUint8x32Slice(y) k := simd.LoadInt8x32Slice(toVect[int8](m)).ToMask() g := make([]int8, n) f(a, b, k).AsInt8x32().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // 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 testUint16x16CompareMasked(t *testing.T, f func(_, _ simd.Uint16x16, m simd.Mask16x16) simd.Mask16x16, want func(_, _ []uint16) []int64) { n := 16 t.Helper() forSlicePairMasked(t, uint16s, n, func(x, y []uint16, m []bool) bool { t.Helper() a := simd.LoadUint16x16Slice(x) b := simd.LoadUint16x16Slice(y) k := simd.LoadInt16x16Slice(toVect[int16](m)).ToMask() g := make([]int16, n) f(a, b, k).AsInt16x16().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // 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 testUint32x8CompareMasked(t *testing.T, f func(_, _ simd.Uint32x8, m simd.Mask32x8) simd.Mask32x8, want func(_, _ []uint32) []int64) { n := 8 t.Helper() forSlicePairMasked(t, uint32s, n, func(x, y []uint32, m []bool) bool { t.Helper() a := simd.LoadUint32x8Slice(x) b := simd.LoadUint32x8Slice(y) k := simd.LoadInt32x8Slice(toVect[int32](m)).ToMask() g := make([]int32, n) f(a, b, k).AsInt32x8().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // testUint64x4CompareMasked 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 testUint64x4CompareMasked(t *testing.T, f func(_, _ simd.Uint64x4, m simd.Mask64x4) simd.Mask64x4, want func(_, _ []uint64) []int64) { n := 4 t.Helper() forSlicePairMasked(t, uint64s, n, func(x, y []uint64, m []bool) bool { t.Helper() a := simd.LoadUint64x4Slice(x) b := simd.LoadUint64x4Slice(y) k := simd.LoadInt64x4Slice(toVect[int64](m)).ToMask() g := make([]int64, n) f(a, b, k).AsInt64x4().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // testFloat32x8CompareMasked 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 testFloat32x8CompareMasked(t *testing.T, f func(_, _ simd.Float32x8, m simd.Mask32x8) simd.Mask32x8, want func(_, _ []float32) []int64) { n := 8 t.Helper() forSlicePairMasked(t, float32s, n, func(x, y []float32, m []bool) bool { t.Helper() a := simd.LoadFloat32x8Slice(x) b := simd.LoadFloat32x8Slice(y) k := simd.LoadInt32x8Slice(toVect[int32](m)).ToMask() g := make([]int32, n) f(a, b, k).AsInt32x8().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // testFloat64x4CompareMasked 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 testFloat64x4CompareMasked(t *testing.T, f func(_, _ simd.Float64x4, m simd.Mask64x4) simd.Mask64x4, want func(_, _ []float64) []int64) { n := 4 t.Helper() forSlicePairMasked(t, float64s, n, func(x, y []float64, m []bool) bool { t.Helper() a := simd.LoadFloat64x4Slice(x) b := simd.LoadFloat64x4Slice(y) k := simd.LoadInt64x4Slice(toVect[int64](m)).ToMask() g := make([]int64, n) f(a, b, k).AsInt64x4().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // testInt8x64CompareMasked 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 testInt8x64CompareMasked(t *testing.T, f func(_, _ simd.Int8x64, m simd.Mask8x64) simd.Mask8x64, want func(_, _ []int8) []int64) { n := 64 t.Helper() forSlicePairMasked(t, int8s, n, func(x, y []int8, m []bool) bool { t.Helper() a := simd.LoadInt8x64Slice(x) b := simd.LoadInt8x64Slice(y) k := simd.LoadInt8x64Slice(toVect[int8](m)).ToMask() g := make([]int8, n) f(a, b, k).AsInt8x64().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // 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 testInt16x32CompareMasked(t *testing.T, f func(_, _ simd.Int16x32, m simd.Mask16x32) simd.Mask16x32, want func(_, _ []int16) []int64) { n := 32 t.Helper() forSlicePairMasked(t, int16s, n, func(x, y []int16, m []bool) bool { t.Helper() a := simd.LoadInt16x32Slice(x) b := simd.LoadInt16x32Slice(y) k := simd.LoadInt16x32Slice(toVect[int16](m)).ToMask() g := make([]int16, n) f(a, b, k).AsInt16x32().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // 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 testInt32x16CompareMasked(t *testing.T, f func(_, _ simd.Int32x16, m simd.Mask32x16) simd.Mask32x16, want func(_, _ []int32) []int64) { n := 16 t.Helper() forSlicePairMasked(t, int32s, n, func(x, y []int32, m []bool) bool { t.Helper() a := simd.LoadInt32x16Slice(x) b := simd.LoadInt32x16Slice(y) k := simd.LoadInt32x16Slice(toVect[int32](m)).ToMask() g := make([]int32, n) f(a, b, k).AsInt32x16().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // 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 testInt64x8CompareMasked(t *testing.T, f func(_, _ simd.Int64x8, m simd.Mask64x8) simd.Mask64x8, want func(_, _ []int64) []int64) { n := 8 t.Helper() forSlicePairMasked(t, int64s, n, func(x, y []int64, m []bool) bool { t.Helper() a := simd.LoadInt64x8Slice(x) b := simd.LoadInt64x8Slice(y) k := simd.LoadInt64x8Slice(toVect[int64](m)).ToMask() g := make([]int64, n) f(a, b, k).AsInt64x8().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // 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 testUint8x64CompareMasked(t *testing.T, f func(_, _ simd.Uint8x64, m simd.Mask8x64) simd.Mask8x64, want func(_, _ []uint8) []int64) { n := 64 t.Helper() forSlicePairMasked(t, uint8s, n, func(x, y []uint8, m []bool) bool { t.Helper() a := simd.LoadUint8x64Slice(x) b := simd.LoadUint8x64Slice(y) k := simd.LoadInt8x64Slice(toVect[int8](m)).ToMask() g := make([]int8, n) f(a, b, k).AsInt8x64().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // 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 testUint16x32CompareMasked(t *testing.T, f func(_, _ simd.Uint16x32, m simd.Mask16x32) simd.Mask16x32, want func(_, _ []uint16) []int64) { n := 32 t.Helper() forSlicePairMasked(t, uint16s, n, func(x, y []uint16, m []bool) bool { t.Helper() a := simd.LoadUint16x32Slice(x) b := simd.LoadUint16x32Slice(y) k := simd.LoadInt16x32Slice(toVect[int16](m)).ToMask() g := make([]int16, n) f(a, b, k).AsInt16x32().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // 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 testUint32x16CompareMasked(t *testing.T, f func(_, _ simd.Uint32x16, m simd.Mask32x16) simd.Mask32x16, want func(_, _ []uint32) []int64) { n := 16 t.Helper() forSlicePairMasked(t, uint32s, n, func(x, y []uint32, m []bool) bool { t.Helper() a := simd.LoadUint32x16Slice(x) b := simd.LoadUint32x16Slice(y) k := simd.LoadInt32x16Slice(toVect[int32](m)).ToMask() g := make([]int32, n) f(a, b, k).AsInt32x16().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // testUint64x8CompareMasked 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 testUint64x8CompareMasked(t *testing.T, f func(_, _ simd.Uint64x8, m simd.Mask64x8) simd.Mask64x8, want func(_, _ []uint64) []int64) { n := 8 t.Helper() forSlicePairMasked(t, uint64s, n, func(x, y []uint64, m []bool) bool { t.Helper() a := simd.LoadUint64x8Slice(x) b := simd.LoadUint64x8Slice(y) k := simd.LoadInt64x8Slice(toVect[int64](m)).ToMask() g := make([]int64, n) f(a, b, k).AsInt64x8().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // testFloat32x16CompareMasked 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 testFloat32x16CompareMasked(t *testing.T, f func(_, _ simd.Float32x16, m simd.Mask32x16) simd.Mask32x16, want func(_, _ []float32) []int64) { n := 16 t.Helper() forSlicePairMasked(t, float32s, n, func(x, y []float32, m []bool) bool { t.Helper() a := simd.LoadFloat32x16Slice(x) b := simd.LoadFloat32x16Slice(y) k := simd.LoadInt32x16Slice(toVect[int32](m)).ToMask() g := make([]int32, n) f(a, b, k).AsInt32x16().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) } // testFloat64x8CompareMasked 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 testFloat64x8CompareMasked(t *testing.T, f func(_, _ simd.Float64x8, m simd.Mask64x8) simd.Mask64x8, want func(_, _ []float64) []int64) { n := 8 t.Helper() forSlicePairMasked(t, float64s, n, func(x, y []float64, m []bool) bool { t.Helper() a := simd.LoadFloat64x8Slice(x) b := simd.LoadFloat64x8Slice(y) k := simd.LoadInt64x8Slice(toVect[int64](m)).ToMask() g := make([]int64, n) f(a, b, k).AsInt64x8().StoreSlice(g) w := want(x, y) for i := range m { if !m[i] { w[i] = 0 } } return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y); t.Logf("m=%v", m) }) }) }