mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
435 lines
14 KiB
Go
435 lines
14 KiB
Go
|
|
// Code generated by 'go run genfiles.go'; DO NOT EDIT.
|
||
|
|
|
||
|
|
//go:build goexperiment.simd
|
||
|
|
|
||
|
|
// This file contains functions testing unary simd methods.
|
||
|
|
// Each function in this file is specialized for a
|
||
|
|
// particular simd type <BaseType><Width>x<Count>.
|
||
|
|
|
||
|
|
package simd_test
|
||
|
|
|
||
|
|
import (
|
||
|
|
"simd"
|
||
|
|
"testing"
|
||
|
|
)
|
||
|
|
|
||
|
|
// testInt8x16Unary tests the simd unary method f against the expected behavior generated by want
|
||
|
|
func testInt8x16Unary(t *testing.T, f func(_ simd.Int8x16) simd.Int8x16, want func(_ []int8) []int8) {
|
||
|
|
n := 16
|
||
|
|
t.Helper()
|
||
|
|
forSlice(t, int8s, n, func(x []int8) bool {
|
||
|
|
t.Helper()
|
||
|
|
a := simd.LoadInt8x16Slice(x)
|
||
|
|
g := make([]int8, n)
|
||
|
|
f(a).StoreSlice(g)
|
||
|
|
w := want(x)
|
||
|
|
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// 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, uint8s, n, func(x []uint8) bool {
|
||
|
|
t.Helper()
|
||
|
|
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) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// 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, int16s, n, func(x []int16) bool {
|
||
|
|
t.Helper()
|
||
|
|
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) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// 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, uint16s, n, func(x []uint16) bool {
|
||
|
|
t.Helper()
|
||
|
|
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) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// 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, int32s, n, func(x []int32) bool {
|
||
|
|
t.Helper()
|
||
|
|
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) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// 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, uint32s, n, func(x []uint32) bool {
|
||
|
|
t.Helper()
|
||
|
|
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) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// 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, int64s, n, func(x []int64) bool {
|
||
|
|
t.Helper()
|
||
|
|
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) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// testUint64x2Unary tests the simd unary method f against the expected behavior generated by want
|
||
|
|
func testUint64x2Unary(t *testing.T, f func(_ simd.Uint64x2) simd.Uint64x2, want func(_ []uint64) []uint64) {
|
||
|
|
n := 2
|
||
|
|
t.Helper()
|
||
|
|
forSlice(t, uint64s, n, func(x []uint64) bool {
|
||
|
|
t.Helper()
|
||
|
|
a := simd.LoadUint64x2Slice(x)
|
||
|
|
g := make([]uint64, n)
|
||
|
|
f(a).StoreSlice(g)
|
||
|
|
w := want(x)
|
||
|
|
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// testFloat32x4Unary tests the simd unary method f against the expected behavior generated by want
|
||
|
|
func testFloat32x4Unary(t *testing.T, f func(_ simd.Float32x4) simd.Float32x4, want func(_ []float32) []float32) {
|
||
|
|
n := 4
|
||
|
|
t.Helper()
|
||
|
|
forSlice(t, float32s, n, func(x []float32) bool {
|
||
|
|
t.Helper()
|
||
|
|
a := simd.LoadFloat32x4Slice(x)
|
||
|
|
g := make([]float32, n)
|
||
|
|
f(a).StoreSlice(g)
|
||
|
|
w := want(x)
|
||
|
|
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// testFloat64x2Unary tests the simd unary method f against the expected behavior generated by want
|
||
|
|
func testFloat64x2Unary(t *testing.T, f func(_ simd.Float64x2) simd.Float64x2, want func(_ []float64) []float64) {
|
||
|
|
n := 2
|
||
|
|
t.Helper()
|
||
|
|
forSlice(t, float64s, n, func(x []float64) bool {
|
||
|
|
t.Helper()
|
||
|
|
a := simd.LoadFloat64x2Slice(x)
|
||
|
|
g := make([]float64, n)
|
||
|
|
f(a).StoreSlice(g)
|
||
|
|
w := want(x)
|
||
|
|
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// testInt8x32Unary tests the simd unary method f against the expected behavior generated by want
|
||
|
|
func testInt8x32Unary(t *testing.T, f func(_ simd.Int8x32) simd.Int8x32, want func(_ []int8) []int8) {
|
||
|
|
n := 32
|
||
|
|
t.Helper()
|
||
|
|
forSlice(t, int8s, n, func(x []int8) bool {
|
||
|
|
t.Helper()
|
||
|
|
a := simd.LoadInt8x32Slice(x)
|
||
|
|
g := make([]int8, 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
|
||
|
|
t.Helper()
|
||
|
|
forSlice(t, uint8s, n, func(x []uint8) bool {
|
||
|
|
t.Helper()
|
||
|
|
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) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// 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, int16s, n, func(x []int16) bool {
|
||
|
|
t.Helper()
|
||
|
|
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) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// 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, uint16s, n, func(x []uint16) bool {
|
||
|
|
t.Helper()
|
||
|
|
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) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// 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, int32s, n, func(x []int32) bool {
|
||
|
|
t.Helper()
|
||
|
|
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) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// 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, uint32s, n, func(x []uint32) bool {
|
||
|
|
t.Helper()
|
||
|
|
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) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// 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, int64s, n, func(x []int64) bool {
|
||
|
|
t.Helper()
|
||
|
|
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) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// testUint64x4Unary tests the simd unary method f against the expected behavior generated by want
|
||
|
|
func testUint64x4Unary(t *testing.T, f func(_ simd.Uint64x4) simd.Uint64x4, want func(_ []uint64) []uint64) {
|
||
|
|
n := 4
|
||
|
|
t.Helper()
|
||
|
|
forSlice(t, uint64s, n, func(x []uint64) bool {
|
||
|
|
t.Helper()
|
||
|
|
a := simd.LoadUint64x4Slice(x)
|
||
|
|
g := make([]uint64, n)
|
||
|
|
f(a).StoreSlice(g)
|
||
|
|
w := want(x)
|
||
|
|
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// testFloat32x8Unary tests the simd unary method f against the expected behavior generated by want
|
||
|
|
func testFloat32x8Unary(t *testing.T, f func(_ simd.Float32x8) simd.Float32x8, want func(_ []float32) []float32) {
|
||
|
|
n := 8
|
||
|
|
t.Helper()
|
||
|
|
forSlice(t, float32s, n, func(x []float32) bool {
|
||
|
|
t.Helper()
|
||
|
|
a := simd.LoadFloat32x8Slice(x)
|
||
|
|
g := make([]float32, n)
|
||
|
|
f(a).StoreSlice(g)
|
||
|
|
w := want(x)
|
||
|
|
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// testFloat64x4Unary tests the simd unary method f against the expected behavior generated by want
|
||
|
|
func testFloat64x4Unary(t *testing.T, f func(_ simd.Float64x4) simd.Float64x4, want func(_ []float64) []float64) {
|
||
|
|
n := 4
|
||
|
|
t.Helper()
|
||
|
|
forSlice(t, float64s, n, func(x []float64) bool {
|
||
|
|
t.Helper()
|
||
|
|
a := simd.LoadFloat64x4Slice(x)
|
||
|
|
g := make([]float64, n)
|
||
|
|
f(a).StoreSlice(g)
|
||
|
|
w := want(x)
|
||
|
|
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// testInt8x64Unary tests the simd unary method f against the expected behavior generated by want
|
||
|
|
func testInt8x64Unary(t *testing.T, f func(_ simd.Int8x64) simd.Int8x64, want func(_ []int8) []int8) {
|
||
|
|
n := 64
|
||
|
|
t.Helper()
|
||
|
|
forSlice(t, int8s, n, func(x []int8) bool {
|
||
|
|
t.Helper()
|
||
|
|
a := simd.LoadInt8x64Slice(x)
|
||
|
|
g := make([]int8, 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
|
||
|
|
t.Helper()
|
||
|
|
forSlice(t, uint8s, n, func(x []uint8) bool {
|
||
|
|
t.Helper()
|
||
|
|
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) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// 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, int16s, n, func(x []int16) bool {
|
||
|
|
t.Helper()
|
||
|
|
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) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// 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, uint16s, n, func(x []uint16) bool {
|
||
|
|
t.Helper()
|
||
|
|
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) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// 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, int32s, n, func(x []int32) bool {
|
||
|
|
t.Helper()
|
||
|
|
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) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// 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, uint32s, n, func(x []uint32) bool {
|
||
|
|
t.Helper()
|
||
|
|
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) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// 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, int64s, n, func(x []int64) bool {
|
||
|
|
t.Helper()
|
||
|
|
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) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// testUint64x8Unary tests the simd unary method f against the expected behavior generated by want
|
||
|
|
func testUint64x8Unary(t *testing.T, f func(_ simd.Uint64x8) simd.Uint64x8, want func(_ []uint64) []uint64) {
|
||
|
|
n := 8
|
||
|
|
t.Helper()
|
||
|
|
forSlice(t, uint64s, n, func(x []uint64) bool {
|
||
|
|
t.Helper()
|
||
|
|
a := simd.LoadUint64x8Slice(x)
|
||
|
|
g := make([]uint64, n)
|
||
|
|
f(a).StoreSlice(g)
|
||
|
|
w := want(x)
|
||
|
|
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// testFloat32x16Unary tests the simd unary method f against the expected behavior generated by want
|
||
|
|
func testFloat32x16Unary(t *testing.T, f func(_ simd.Float32x16) simd.Float32x16, want func(_ []float32) []float32) {
|
||
|
|
n := 16
|
||
|
|
t.Helper()
|
||
|
|
forSlice(t, float32s, n, func(x []float32) bool {
|
||
|
|
t.Helper()
|
||
|
|
a := simd.LoadFloat32x16Slice(x)
|
||
|
|
g := make([]float32, n)
|
||
|
|
f(a).StoreSlice(g)
|
||
|
|
w := want(x)
|
||
|
|
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
// testFloat64x8Unary tests the simd unary method f against the expected behavior generated by want
|
||
|
|
func testFloat64x8Unary(t *testing.T, f func(_ simd.Float64x8) simd.Float64x8, want func(_ []float64) []float64) {
|
||
|
|
n := 8
|
||
|
|
t.Helper()
|
||
|
|
forSlice(t, float64s, n, func(x []float64) bool {
|
||
|
|
t.Helper()
|
||
|
|
a := simd.LoadFloat64x8Slice(x)
|
||
|
|
g := make([]float64, n)
|
||
|
|
f(a).StoreSlice(g)
|
||
|
|
w := want(x)
|
||
|
|
return checkSlicesLogInput(t, g, w, func() { t.Helper(); t.Logf("x=%v", x) })
|
||
|
|
})
|
||
|
|
}
|