From: Cherry Mui Date: Sat, 27 Dec 2025 19:21:37 +0000 (-0500) Subject: simd/archsimd: add more tests for Truncate operations X-Git-Tag: go1.26rc2~7^2~21 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e0c99fe285be8df2b8a74d9c23f4b06391d7594a;p=gostls13.git simd/archsimd: add more tests for Truncate operations Now include operations with input and output with different lengths. Change-Id: I5c9759e31ffae2d621a13f9cb3f5dd64e87a1c44 Reviewed-on: https://go-review.googlesource.com/c/go/+/732920 LUCI-TryBot-Result: Go LUCI Reviewed-by: David Chase --- diff --git a/src/simd/archsimd/_gen/tmplgen/main.go b/src/simd/archsimd/_gen/tmplgen/main.go index a54d462d01..5a4a3af272 100644 --- a/src/simd/archsimd/_gen/tmplgen/main.go +++ b/src/simd/archsimd/_gen/tmplgen/main.go @@ -40,7 +40,13 @@ func (sat shapeAndTemplate) target(outType string, width int) shapeAndTemplate { newSat := sat newShape := *sat.s newShape.output = func(t string, w, c int) (ot string, ow int, oc int) { - return outType, width, c + oc = c + if width*c > 512 { + oc = 512 / width + } else if width*c < 128 { + oc = 128 / width + } + return outType, width, oc } newSat.s = &newShape return newSat @@ -356,15 +362,16 @@ func test{{.VType}}UnaryFlaky(t *testing.T, f func(x archsimd.{{.VType}}) archsi `) var convertTemplate = templateOf("convert_helpers", ` -// test{{.VType}}ConvertTo{{.OEType}} tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// test{{.VType}}ConvertTo{{.OEType}} tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func test{{.VType}}ConvertTo{{.OEType}}(t *testing.T, f func(x archsimd.{{.VType}}) archsimd.{{.OVType}}, want func(x []{{.Etype}}) []{{.OEtype}}) { n := {{.Count}} t.Helper() forSlice(t, {{.Etype}}s, n, func(x []{{.Etype}}) bool { t.Helper() a := archsimd.Load{{.VType}}Slice(x) - g := make([]{{.OEtype}}, n) + g := make([]{{.OEtype}}, {{.OCount}}) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() {t.Helper(); t.Logf("x=%v", x)}) diff --git a/src/simd/archsimd/internal/simd_test/helpers_test.go b/src/simd/archsimd/internal/simd_test/helpers_test.go index ccad70de92..37cc98194a 100644 --- a/src/simd/archsimd/internal/simd_test/helpers_test.go +++ b/src/simd/archsimd/internal/simd_test/helpers_test.go @@ -126,6 +126,19 @@ func map1[T, U any](elem func(x T) U) func(x []T) []U { } } +// map1n returns a function that returns the slice of the results of applying +// input parameter elem to the respective elements of its single slice input, +// extended (with zero values) or truncated to length n. +func map1n[T, U any](elem func(x T) U, n int) func(x []T) []U { + return func(x []T) []U { + s := make([]U, n) + for i := range min(len(x), n) { + s[i] = elem(x[i]) + } + return s + } +} + // mapCompare returns a function that returns the slice of the results of applying // comparison function elem to the respective elements of its two slice inputs, // and returns -1 if the comparison is true, 0 otherwise. diff --git a/src/simd/archsimd/internal/simd_test/unary_helpers_test.go b/src/simd/archsimd/internal/simd_test/unary_helpers_test.go index 626a0971d7..e545a8330d 100644 --- a/src/simd/archsimd/internal/simd_test/unary_helpers_test.go +++ b/src/simd/archsimd/internal/simd_test/unary_helpers_test.go @@ -433,2670 +433,4800 @@ func testFloat64x8Unary(t *testing.T, f func(_ archsimd.Float64x8) archsimd.Floa }) } -// testInt8x16ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt8x16ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt8x16ConvertToInt8(t *testing.T, f func(x archsimd.Int8x16) archsimd.Int8x16, want func(x []int8) []int8) { n := 16 t.Helper() forSlice(t, int8s, n, func(x []int8) bool { t.Helper() a := archsimd.LoadInt8x16Slice(x) - g := make([]int8, n) + g := make([]int8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt16x8ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt16x8ConvertToInt8(t *testing.T, f func(x archsimd.Int16x8) archsimd.Int8x16, want func(x []int16) []int8) { + n := 8 + t.Helper() + forSlice(t, int16s, n, func(x []int16) bool { + t.Helper() + a := archsimd.LoadInt16x8Slice(x) + g := make([]int8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt32x4ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt32x4ConvertToInt8(t *testing.T, f func(x archsimd.Int32x4) archsimd.Int8x16, want func(x []int32) []int8) { + n := 4 + t.Helper() + forSlice(t, int32s, n, func(x []int32) bool { + t.Helper() + a := archsimd.LoadInt32x4Slice(x) + g := make([]int8, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint8x16ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt64x2ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt64x2ConvertToInt8(t *testing.T, f func(x archsimd.Int64x2) archsimd.Int8x16, want func(x []int64) []int8) { + n := 2 + t.Helper() + forSlice(t, int64s, n, func(x []int64) bool { + t.Helper() + a := archsimd.LoadInt64x2Slice(x) + g := make([]int8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint8x16ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint8x16ConvertToInt8(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Int8x16, want func(x []uint8) []int8) { n := 16 t.Helper() forSlice(t, uint8s, n, func(x []uint8) bool { t.Helper() a := archsimd.LoadUint8x16Slice(x) - g := make([]int8, n) + g := make([]int8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint16x8ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint16x8ConvertToInt8(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Int8x16, want func(x []uint16) []int8) { + n := 8 + t.Helper() + forSlice(t, uint16s, n, func(x []uint16) bool { + t.Helper() + a := archsimd.LoadUint16x8Slice(x) + g := make([]int8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint32x4ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint32x4ConvertToInt8(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Int8x16, want func(x []uint32) []int8) { + n := 4 + t.Helper() + forSlice(t, uint32s, n, func(x []uint32) bool { + t.Helper() + a := archsimd.LoadUint32x4Slice(x) + g := make([]int8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint64x2ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint64x2ConvertToInt8(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Int8x16, want func(x []uint64) []int8) { + n := 2 + t.Helper() + forSlice(t, uint64s, n, func(x []uint64) bool { + t.Helper() + a := archsimd.LoadUint64x2Slice(x) + g := make([]int8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testFloat32x4ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat32x4ConvertToInt8(t *testing.T, f func(x archsimd.Float32x4) archsimd.Int8x16, want func(x []float32) []int8) { + n := 4 + t.Helper() + forSlice(t, float32s, n, func(x []float32) bool { + t.Helper() + a := archsimd.LoadFloat32x4Slice(x) + g := make([]int8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testFloat64x2ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat64x2ConvertToInt8(t *testing.T, f func(x archsimd.Float64x2) archsimd.Int8x16, want func(x []float64) []int8) { + n := 2 + t.Helper() + forSlice(t, float64s, n, func(x []float64) bool { + t.Helper() + a := archsimd.LoadFloat64x2Slice(x) + g := make([]int8, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt8x32ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt8x32ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt8x32ConvertToInt8(t *testing.T, f func(x archsimd.Int8x32) archsimd.Int8x32, want func(x []int8) []int8) { n := 32 t.Helper() forSlice(t, int8s, n, func(x []int8) bool { t.Helper() a := archsimd.LoadInt8x32Slice(x) - g := make([]int8, n) + g := make([]int8, 32) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt16x16ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt16x16ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt16x16ConvertToInt8(t *testing.T, f func(x archsimd.Int16x16) archsimd.Int8x16, want func(x []int16) []int8) { n := 16 t.Helper() forSlice(t, int16s, n, func(x []int16) bool { t.Helper() a := archsimd.LoadInt16x16Slice(x) - g := make([]int8, n) + g := make([]int8, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint8x32ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt32x8ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt32x8ConvertToInt8(t *testing.T, f func(x archsimd.Int32x8) archsimd.Int8x16, want func(x []int32) []int8) { + n := 8 + t.Helper() + forSlice(t, int32s, n, func(x []int32) bool { + t.Helper() + a := archsimd.LoadInt32x8Slice(x) + g := make([]int8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt64x4ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt64x4ConvertToInt8(t *testing.T, f func(x archsimd.Int64x4) archsimd.Int8x16, want func(x []int64) []int8) { + n := 4 + t.Helper() + forSlice(t, int64s, n, func(x []int64) bool { + t.Helper() + a := archsimd.LoadInt64x4Slice(x) + g := make([]int8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint8x32ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint8x32ConvertToInt8(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Int8x32, want func(x []uint8) []int8) { n := 32 t.Helper() forSlice(t, uint8s, n, func(x []uint8) bool { t.Helper() a := archsimd.LoadUint8x32Slice(x) - g := make([]int8, n) + g := make([]int8, 32) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint16x16ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint16x16ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint16x16ConvertToInt8(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Int8x16, want func(x []uint16) []int8) { n := 16 t.Helper() forSlice(t, uint16s, n, func(x []uint16) bool { t.Helper() a := archsimd.LoadUint16x16Slice(x) - g := make([]int8, n) + g := make([]int8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint32x8ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint32x8ConvertToInt8(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Int8x16, want func(x []uint32) []int8) { + n := 8 + t.Helper() + forSlice(t, uint32s, n, func(x []uint32) bool { + t.Helper() + a := archsimd.LoadUint32x8Slice(x) + g := make([]int8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint64x4ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint64x4ConvertToInt8(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Int8x16, want func(x []uint64) []int8) { + n := 4 + t.Helper() + forSlice(t, uint64s, n, func(x []uint64) bool { + t.Helper() + a := archsimd.LoadUint64x4Slice(x) + g := make([]int8, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt8x64ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat32x8ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat32x8ConvertToInt8(t *testing.T, f func(x archsimd.Float32x8) archsimd.Int8x16, want func(x []float32) []int8) { + n := 8 + t.Helper() + forSlice(t, float32s, n, func(x []float32) bool { + t.Helper() + a := archsimd.LoadFloat32x8Slice(x) + g := make([]int8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testFloat64x4ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat64x4ConvertToInt8(t *testing.T, f func(x archsimd.Float64x4) archsimd.Int8x16, want func(x []float64) []int8) { + n := 4 + t.Helper() + forSlice(t, float64s, n, func(x []float64) bool { + t.Helper() + a := archsimd.LoadFloat64x4Slice(x) + g := make([]int8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt8x64ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt8x64ConvertToInt8(t *testing.T, f func(x archsimd.Int8x64) archsimd.Int8x64, want func(x []int8) []int8) { n := 64 t.Helper() forSlice(t, int8s, n, func(x []int8) bool { t.Helper() a := archsimd.LoadInt8x64Slice(x) - g := make([]int8, n) + g := make([]int8, 64) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt16x32ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt16x32ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt16x32ConvertToInt8(t *testing.T, f func(x archsimd.Int16x32) archsimd.Int8x32, want func(x []int16) []int8) { n := 32 t.Helper() forSlice(t, int16s, n, func(x []int16) bool { t.Helper() a := archsimd.LoadInt16x32Slice(x) - g := make([]int8, n) + g := make([]int8, 32) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt32x16ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt32x16ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt32x16ConvertToInt8(t *testing.T, f func(x archsimd.Int32x16) archsimd.Int8x16, want func(x []int32) []int8) { n := 16 t.Helper() forSlice(t, int32s, n, func(x []int32) bool { t.Helper() a := archsimd.LoadInt32x16Slice(x) - g := make([]int8, n) + g := make([]int8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt64x8ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt64x8ConvertToInt8(t *testing.T, f func(x archsimd.Int64x8) archsimd.Int8x16, want func(x []int64) []int8) { + n := 8 + t.Helper() + forSlice(t, int64s, n, func(x []int64) bool { + t.Helper() + a := archsimd.LoadInt64x8Slice(x) + g := make([]int8, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint8x64ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint8x64ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint8x64ConvertToInt8(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Int8x64, want func(x []uint8) []int8) { n := 64 t.Helper() forSlice(t, uint8s, n, func(x []uint8) bool { t.Helper() a := archsimd.LoadUint8x64Slice(x) - g := make([]int8, n) + g := make([]int8, 64) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint16x32ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint16x32ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint16x32ConvertToInt8(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Int8x32, want func(x []uint16) []int8) { n := 32 t.Helper() forSlice(t, uint16s, n, func(x []uint16) bool { t.Helper() a := archsimd.LoadUint16x32Slice(x) - g := make([]int8, n) + g := make([]int8, 32) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint32x16ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint32x16ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint32x16ConvertToInt8(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Int8x16, want func(x []uint32) []int8) { n := 16 t.Helper() forSlice(t, uint32s, n, func(x []uint32) bool { t.Helper() a := archsimd.LoadUint32x16Slice(x) - g := make([]int8, n) + g := make([]int8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint64x8ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint64x8ConvertToInt8(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Int8x16, want func(x []uint64) []int8) { + n := 8 + t.Helper() + forSlice(t, uint64s, n, func(x []uint64) bool { + t.Helper() + a := archsimd.LoadUint64x8Slice(x) + g := make([]int8, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat32x16ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat32x16ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat32x16ConvertToInt8(t *testing.T, f func(x archsimd.Float32x16) archsimd.Int8x16, want func(x []float32) []int8) { n := 16 t.Helper() forSlice(t, float32s, n, func(x []float32) bool { t.Helper() a := archsimd.LoadFloat32x16Slice(x) - g := make([]int8, n) + g := make([]int8, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt8x16ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat64x8ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat64x8ConvertToInt8(t *testing.T, f func(x archsimd.Float64x8) archsimd.Int8x16, want func(x []float64) []int8) { + n := 8 + t.Helper() + forSlice(t, float64s, n, func(x []float64) bool { + t.Helper() + a := archsimd.LoadFloat64x8Slice(x) + g := make([]int8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt8x16ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt8x16ConvertToUint8(t *testing.T, f func(x archsimd.Int8x16) archsimd.Uint8x16, want func(x []int8) []uint8) { n := 16 t.Helper() forSlice(t, int8s, n, func(x []int8) bool { t.Helper() a := archsimd.LoadInt8x16Slice(x) - g := make([]uint8, n) + g := make([]uint8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt16x8ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt16x8ConvertToUint8(t *testing.T, f func(x archsimd.Int16x8) archsimd.Uint8x16, want func(x []int16) []uint8) { + n := 8 + t.Helper() + forSlice(t, int16s, n, func(x []int16) bool { + t.Helper() + a := archsimd.LoadInt16x8Slice(x) + g := make([]uint8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt32x4ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt32x4ConvertToUint8(t *testing.T, f func(x archsimd.Int32x4) archsimd.Uint8x16, want func(x []int32) []uint8) { + n := 4 + t.Helper() + forSlice(t, int32s, n, func(x []int32) bool { + t.Helper() + a := archsimd.LoadInt32x4Slice(x) + g := make([]uint8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt64x2ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt64x2ConvertToUint8(t *testing.T, f func(x archsimd.Int64x2) archsimd.Uint8x16, want func(x []int64) []uint8) { + n := 2 + t.Helper() + forSlice(t, int64s, n, func(x []int64) bool { + t.Helper() + a := archsimd.LoadInt64x2Slice(x) + g := make([]uint8, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint8x16ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint8x16ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint8x16ConvertToUint8(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Uint8x16, want func(x []uint8) []uint8) { n := 16 t.Helper() forSlice(t, uint8s, n, func(x []uint8) bool { t.Helper() a := archsimd.LoadUint8x16Slice(x) - g := make([]uint8, n) + g := make([]uint8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint16x8ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint16x8ConvertToUint8(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Uint8x16, want func(x []uint16) []uint8) { + n := 8 + t.Helper() + forSlice(t, uint16s, n, func(x []uint16) bool { + t.Helper() + a := archsimd.LoadUint16x8Slice(x) + g := make([]uint8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint32x4ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint32x4ConvertToUint8(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Uint8x16, want func(x []uint32) []uint8) { + n := 4 + t.Helper() + forSlice(t, uint32s, n, func(x []uint32) bool { + t.Helper() + a := archsimd.LoadUint32x4Slice(x) + g := make([]uint8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint64x2ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint64x2ConvertToUint8(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Uint8x16, want func(x []uint64) []uint8) { + n := 2 + t.Helper() + forSlice(t, uint64s, n, func(x []uint64) bool { + t.Helper() + a := archsimd.LoadUint64x2Slice(x) + g := make([]uint8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testFloat32x4ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat32x4ConvertToUint8(t *testing.T, f func(x archsimd.Float32x4) archsimd.Uint8x16, want func(x []float32) []uint8) { + n := 4 + t.Helper() + forSlice(t, float32s, n, func(x []float32) bool { + t.Helper() + a := archsimd.LoadFloat32x4Slice(x) + g := make([]uint8, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt8x32ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat64x2ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat64x2ConvertToUint8(t *testing.T, f func(x archsimd.Float64x2) archsimd.Uint8x16, want func(x []float64) []uint8) { + n := 2 + t.Helper() + forSlice(t, float64s, n, func(x []float64) bool { + t.Helper() + a := archsimd.LoadFloat64x2Slice(x) + g := make([]uint8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt8x32ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt8x32ConvertToUint8(t *testing.T, f func(x archsimd.Int8x32) archsimd.Uint8x32, want func(x []int8) []uint8) { n := 32 t.Helper() forSlice(t, int8s, n, func(x []int8) bool { t.Helper() a := archsimd.LoadInt8x32Slice(x) - g := make([]uint8, n) + g := make([]uint8, 32) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt16x16ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt16x16ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt16x16ConvertToUint8(t *testing.T, f func(x archsimd.Int16x16) archsimd.Uint8x16, want func(x []int16) []uint8) { n := 16 t.Helper() forSlice(t, int16s, n, func(x []int16) bool { t.Helper() a := archsimd.LoadInt16x16Slice(x) - g := make([]uint8, n) + g := make([]uint8, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint8x32ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt32x8ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt32x8ConvertToUint8(t *testing.T, f func(x archsimd.Int32x8) archsimd.Uint8x16, want func(x []int32) []uint8) { + n := 8 + t.Helper() + forSlice(t, int32s, n, func(x []int32) bool { + t.Helper() + a := archsimd.LoadInt32x8Slice(x) + g := make([]uint8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt64x4ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt64x4ConvertToUint8(t *testing.T, f func(x archsimd.Int64x4) archsimd.Uint8x16, want func(x []int64) []uint8) { + n := 4 + t.Helper() + forSlice(t, int64s, n, func(x []int64) bool { + t.Helper() + a := archsimd.LoadInt64x4Slice(x) + g := make([]uint8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint8x32ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint8x32ConvertToUint8(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Uint8x32, want func(x []uint8) []uint8) { n := 32 t.Helper() forSlice(t, uint8s, n, func(x []uint8) bool { t.Helper() a := archsimd.LoadUint8x32Slice(x) - g := make([]uint8, n) + g := make([]uint8, 32) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint16x16ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint16x16ConvertToUint8(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Uint8x16, want func(x []uint16) []uint8) { + n := 16 + t.Helper() + forSlice(t, uint16s, n, func(x []uint16) bool { + t.Helper() + a := archsimd.LoadUint16x16Slice(x) + g := make([]uint8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint32x8ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint32x8ConvertToUint8(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Uint8x16, want func(x []uint32) []uint8) { + n := 8 + t.Helper() + forSlice(t, uint32s, n, func(x []uint32) bool { + t.Helper() + a := archsimd.LoadUint32x8Slice(x) + g := make([]uint8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint64x4ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint64x4ConvertToUint8(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Uint8x16, want func(x []uint64) []uint8) { + n := 4 + t.Helper() + forSlice(t, uint64s, n, func(x []uint64) bool { + t.Helper() + a := archsimd.LoadUint64x4Slice(x) + g := make([]uint8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testFloat32x8ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat32x8ConvertToUint8(t *testing.T, f func(x archsimd.Float32x8) archsimd.Uint8x16, want func(x []float32) []uint8) { + n := 8 + t.Helper() + forSlice(t, float32s, n, func(x []float32) bool { + t.Helper() + a := archsimd.LoadFloat32x8Slice(x) + g := make([]uint8, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint16x16ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. -func testUint16x16ConvertToUint8(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Uint8x16, want func(x []uint16) []uint8) { - n := 16 +// testFloat64x4ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat64x4ConvertToUint8(t *testing.T, f func(x archsimd.Float64x4) archsimd.Uint8x16, want func(x []float64) []uint8) { + n := 4 t.Helper() - forSlice(t, uint16s, n, func(x []uint16) bool { + forSlice(t, float64s, n, func(x []float64) bool { t.Helper() - a := archsimd.LoadUint16x16Slice(x) - g := make([]uint8, n) + a := archsimd.LoadFloat64x4Slice(x) + g := make([]uint8, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt8x64ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt8x64ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt8x64ConvertToUint8(t *testing.T, f func(x archsimd.Int8x64) archsimd.Uint8x64, want func(x []int8) []uint8) { n := 64 t.Helper() forSlice(t, int8s, n, func(x []int8) bool { t.Helper() a := archsimd.LoadInt8x64Slice(x) - g := make([]uint8, n) + g := make([]uint8, 64) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt16x32ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt16x32ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt16x32ConvertToUint8(t *testing.T, f func(x archsimd.Int16x32) archsimd.Uint8x32, want func(x []int16) []uint8) { n := 32 t.Helper() forSlice(t, int16s, n, func(x []int16) bool { t.Helper() a := archsimd.LoadInt16x32Slice(x) - g := make([]uint8, n) + g := make([]uint8, 32) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt32x16ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt32x16ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt32x16ConvertToUint8(t *testing.T, f func(x archsimd.Int32x16) archsimd.Uint8x16, want func(x []int32) []uint8) { n := 16 t.Helper() forSlice(t, int32s, n, func(x []int32) bool { t.Helper() a := archsimd.LoadInt32x16Slice(x) - g := make([]uint8, n) + g := make([]uint8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt64x8ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt64x8ConvertToUint8(t *testing.T, f func(x archsimd.Int64x8) archsimd.Uint8x16, want func(x []int64) []uint8) { + n := 8 + t.Helper() + forSlice(t, int64s, n, func(x []int64) bool { + t.Helper() + a := archsimd.LoadInt64x8Slice(x) + g := make([]uint8, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint8x64ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint8x64ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint8x64ConvertToUint8(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Uint8x64, want func(x []uint8) []uint8) { n := 64 t.Helper() forSlice(t, uint8s, n, func(x []uint8) bool { t.Helper() a := archsimd.LoadUint8x64Slice(x) - g := make([]uint8, n) + g := make([]uint8, 64) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint16x32ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint16x32ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint16x32ConvertToUint8(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Uint8x32, want func(x []uint16) []uint8) { n := 32 t.Helper() forSlice(t, uint16s, n, func(x []uint16) bool { t.Helper() a := archsimd.LoadUint16x32Slice(x) - g := make([]uint8, n) + g := make([]uint8, 32) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint32x16ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint32x16ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint32x16ConvertToUint8(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Uint8x16, want func(x []uint32) []uint8) { n := 16 t.Helper() forSlice(t, uint32s, n, func(x []uint32) bool { t.Helper() a := archsimd.LoadUint32x16Slice(x) - g := make([]uint8, n) + g := make([]uint8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint64x8ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint64x8ConvertToUint8(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Uint8x16, want func(x []uint64) []uint8) { + n := 8 + t.Helper() + forSlice(t, uint64s, n, func(x []uint64) bool { + t.Helper() + a := archsimd.LoadUint64x8Slice(x) + g := make([]uint8, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat32x16ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat32x16ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat32x16ConvertToUint8(t *testing.T, f func(x archsimd.Float32x16) archsimd.Uint8x16, want func(x []float32) []uint8) { n := 16 t.Helper() forSlice(t, float32s, n, func(x []float32) bool { t.Helper() a := archsimd.LoadFloat32x16Slice(x) - g := make([]uint8, n) + g := make([]uint8, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testFloat64x8ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat64x8ConvertToUint8(t *testing.T, f func(x archsimd.Float64x8) archsimd.Uint8x16, want func(x []float64) []uint8) { + n := 8 + t.Helper() + forSlice(t, float64s, n, func(x []float64) bool { + t.Helper() + a := archsimd.LoadFloat64x8Slice(x) + g := make([]uint8, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt8x16ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt8x16ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt8x16ConvertToInt16(t *testing.T, f func(x archsimd.Int8x16) archsimd.Int16x16, want func(x []int8) []int16) { n := 16 t.Helper() forSlice(t, int8s, n, func(x []int8) bool { t.Helper() a := archsimd.LoadInt8x16Slice(x) - g := make([]int16, n) + g := make([]int16, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt16x8ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt16x8ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt16x8ConvertToInt16(t *testing.T, f func(x archsimd.Int16x8) archsimd.Int16x8, want func(x []int16) []int16) { n := 8 t.Helper() forSlice(t, int16s, n, func(x []int16) bool { t.Helper() a := archsimd.LoadInt16x8Slice(x) - g := make([]int16, n) + g := make([]int16, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt32x4ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt32x4ConvertToInt16(t *testing.T, f func(x archsimd.Int32x4) archsimd.Int16x8, want func(x []int32) []int16) { + n := 4 + t.Helper() + forSlice(t, int32s, n, func(x []int32) bool { + t.Helper() + a := archsimd.LoadInt32x4Slice(x) + g := make([]int16, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt64x2ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt64x2ConvertToInt16(t *testing.T, f func(x archsimd.Int64x2) archsimd.Int16x8, want func(x []int64) []int16) { + n := 2 + t.Helper() + forSlice(t, int64s, n, func(x []int64) bool { + t.Helper() + a := archsimd.LoadInt64x2Slice(x) + g := make([]int16, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint8x16ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint8x16ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint8x16ConvertToInt16(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Int16x16, want func(x []uint8) []int16) { n := 16 t.Helper() forSlice(t, uint8s, n, func(x []uint8) bool { t.Helper() a := archsimd.LoadUint8x16Slice(x) - g := make([]int16, n) + g := make([]int16, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint16x8ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint16x8ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint16x8ConvertToInt16(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Int16x8, want func(x []uint16) []int16) { n := 8 t.Helper() forSlice(t, uint16s, n, func(x []uint16) bool { t.Helper() a := archsimd.LoadUint16x8Slice(x) - g := make([]int16, n) + g := make([]int16, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint32x4ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint32x4ConvertToInt16(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Int16x8, want func(x []uint32) []int16) { + n := 4 + t.Helper() + forSlice(t, uint32s, n, func(x []uint32) bool { + t.Helper() + a := archsimd.LoadUint32x4Slice(x) + g := make([]int16, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint64x2ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint64x2ConvertToInt16(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Int16x8, want func(x []uint64) []int16) { + n := 2 + t.Helper() + forSlice(t, uint64s, n, func(x []uint64) bool { + t.Helper() + a := archsimd.LoadUint64x2Slice(x) + g := make([]int16, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt8x32ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat32x4ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat32x4ConvertToInt16(t *testing.T, f func(x archsimd.Float32x4) archsimd.Int16x8, want func(x []float32) []int16) { + n := 4 + t.Helper() + forSlice(t, float32s, n, func(x []float32) bool { + t.Helper() + a := archsimd.LoadFloat32x4Slice(x) + g := make([]int16, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testFloat64x2ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat64x2ConvertToInt16(t *testing.T, f func(x archsimd.Float64x2) archsimd.Int16x8, want func(x []float64) []int16) { + n := 2 + t.Helper() + forSlice(t, float64s, n, func(x []float64) bool { + t.Helper() + a := archsimd.LoadFloat64x2Slice(x) + g := make([]int16, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt8x32ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt8x32ConvertToInt16(t *testing.T, f func(x archsimd.Int8x32) archsimd.Int16x32, want func(x []int8) []int16) { n := 32 t.Helper() forSlice(t, int8s, n, func(x []int8) bool { t.Helper() a := archsimd.LoadInt8x32Slice(x) - g := make([]int16, n) + g := make([]int16, 32) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt16x16ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt16x16ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt16x16ConvertToInt16(t *testing.T, f func(x archsimd.Int16x16) archsimd.Int16x16, want func(x []int16) []int16) { n := 16 t.Helper() forSlice(t, int16s, n, func(x []int16) bool { t.Helper() a := archsimd.LoadInt16x16Slice(x) - g := make([]int16, n) + g := make([]int16, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt32x8ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt32x8ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt32x8ConvertToInt16(t *testing.T, f func(x archsimd.Int32x8) archsimd.Int16x8, want func(x []int32) []int16) { n := 8 t.Helper() forSlice(t, int32s, n, func(x []int32) bool { t.Helper() a := archsimd.LoadInt32x8Slice(x) - g := make([]int16, n) + g := make([]int16, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt64x4ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt64x4ConvertToInt16(t *testing.T, f func(x archsimd.Int64x4) archsimd.Int16x8, want func(x []int64) []int16) { + n := 4 + t.Helper() + forSlice(t, int64s, n, func(x []int64) bool { + t.Helper() + a := archsimd.LoadInt64x4Slice(x) + g := make([]int16, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint8x32ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint8x32ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint8x32ConvertToInt16(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Int16x32, want func(x []uint8) []int16) { n := 32 t.Helper() forSlice(t, uint8s, n, func(x []uint8) bool { t.Helper() a := archsimd.LoadUint8x32Slice(x) - g := make([]int16, n) + g := make([]int16, 32) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint16x16ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint16x16ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint16x16ConvertToInt16(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Int16x16, want func(x []uint16) []int16) { n := 16 t.Helper() forSlice(t, uint16s, n, func(x []uint16) bool { t.Helper() a := archsimd.LoadUint16x16Slice(x) - g := make([]int16, n) + g := make([]int16, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint32x8ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint32x8ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint32x8ConvertToInt16(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Int16x8, want func(x []uint32) []int16) { n := 8 t.Helper() forSlice(t, uint32s, n, func(x []uint32) bool { t.Helper() a := archsimd.LoadUint32x8Slice(x) - g := make([]int16, n) + g := make([]int16, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint64x4ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint64x4ConvertToInt16(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Int16x8, want func(x []uint64) []int16) { + n := 4 + t.Helper() + forSlice(t, uint64s, n, func(x []uint64) bool { + t.Helper() + a := archsimd.LoadUint64x4Slice(x) + g := make([]int16, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat32x8ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat32x8ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat32x8ConvertToInt16(t *testing.T, f func(x archsimd.Float32x8) archsimd.Int16x8, want func(x []float32) []int16) { n := 8 t.Helper() forSlice(t, float32s, n, func(x []float32) bool { t.Helper() a := archsimd.LoadFloat32x8Slice(x) - g := make([]int16, n) + g := make([]int16, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testFloat64x4ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat64x4ConvertToInt16(t *testing.T, f func(x archsimd.Float64x4) archsimd.Int16x8, want func(x []float64) []int16) { + n := 4 + t.Helper() + forSlice(t, float64s, n, func(x []float64) bool { + t.Helper() + a := archsimd.LoadFloat64x4Slice(x) + g := make([]int16, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt8x64ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt8x64ConvertToInt16(t *testing.T, f func(x archsimd.Int8x64) archsimd.Int16x32, want func(x []int8) []int16) { + n := 64 + t.Helper() + forSlice(t, int8s, n, func(x []int8) bool { + t.Helper() + a := archsimd.LoadInt8x64Slice(x) + g := make([]int16, 32) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt16x32ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt16x32ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt16x32ConvertToInt16(t *testing.T, f func(x archsimd.Int16x32) archsimd.Int16x32, want func(x []int16) []int16) { n := 32 t.Helper() forSlice(t, int16s, n, func(x []int16) bool { t.Helper() a := archsimd.LoadInt16x32Slice(x) - g := make([]int16, n) + g := make([]int16, 32) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt32x16ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt32x16ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt32x16ConvertToInt16(t *testing.T, f func(x archsimd.Int32x16) archsimd.Int16x16, want func(x []int32) []int16) { n := 16 t.Helper() forSlice(t, int32s, n, func(x []int32) bool { t.Helper() a := archsimd.LoadInt32x16Slice(x) - g := make([]int16, n) + g := make([]int16, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt64x8ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt64x8ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt64x8ConvertToInt16(t *testing.T, f func(x archsimd.Int64x8) archsimd.Int16x8, want func(x []int64) []int16) { n := 8 t.Helper() forSlice(t, int64s, n, func(x []int64) bool { t.Helper() a := archsimd.LoadInt64x8Slice(x) - g := make([]int16, n) + g := make([]int16, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint8x64ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint8x64ConvertToInt16(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Int16x32, want func(x []uint8) []int16) { + n := 64 + t.Helper() + forSlice(t, uint8s, n, func(x []uint8) bool { + t.Helper() + a := archsimd.LoadUint8x64Slice(x) + g := make([]int16, 32) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint16x32ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint16x32ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint16x32ConvertToInt16(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Int16x32, want func(x []uint16) []int16) { n := 32 t.Helper() forSlice(t, uint16s, n, func(x []uint16) bool { t.Helper() a := archsimd.LoadUint16x32Slice(x) - g := make([]int16, n) + g := make([]int16, 32) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint32x16ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint32x16ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint32x16ConvertToInt16(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Int16x16, want func(x []uint32) []int16) { n := 16 t.Helper() forSlice(t, uint32s, n, func(x []uint32) bool { t.Helper() a := archsimd.LoadUint32x16Slice(x) - g := make([]int16, n) + g := make([]int16, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint64x8ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint64x8ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint64x8ConvertToInt16(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Int16x8, want func(x []uint64) []int16) { n := 8 t.Helper() forSlice(t, uint64s, n, func(x []uint64) bool { t.Helper() a := archsimd.LoadUint64x8Slice(x) - g := make([]int16, n) + g := make([]int16, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat32x16ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat32x16ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat32x16ConvertToInt16(t *testing.T, f func(x archsimd.Float32x16) archsimd.Int16x16, want func(x []float32) []int16) { n := 16 t.Helper() forSlice(t, float32s, n, func(x []float32) bool { t.Helper() a := archsimd.LoadFloat32x16Slice(x) - g := make([]int16, n) + g := make([]int16, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat64x8ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat64x8ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat64x8ConvertToInt16(t *testing.T, f func(x archsimd.Float64x8) archsimd.Int16x8, want func(x []float64) []int16) { n := 8 t.Helper() forSlice(t, float64s, n, func(x []float64) bool { t.Helper() a := archsimd.LoadFloat64x8Slice(x) - g := make([]int16, n) + g := make([]int16, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt8x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt8x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt8x16ConvertToUint16(t *testing.T, f func(x archsimd.Int8x16) archsimd.Uint16x16, want func(x []int8) []uint16) { n := 16 t.Helper() forSlice(t, int8s, n, func(x []int8) bool { t.Helper() a := archsimd.LoadInt8x16Slice(x) - g := make([]uint16, n) + g := make([]uint16, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt16x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt16x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt16x8ConvertToUint16(t *testing.T, f func(x archsimd.Int16x8) archsimd.Uint16x8, want func(x []int16) []uint16) { n := 8 t.Helper() forSlice(t, int16s, n, func(x []int16) bool { t.Helper() a := archsimd.LoadInt16x8Slice(x) - g := make([]uint16, n) + g := make([]uint16, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt32x4ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt32x4ConvertToUint16(t *testing.T, f func(x archsimd.Int32x4) archsimd.Uint16x8, want func(x []int32) []uint16) { + n := 4 + t.Helper() + forSlice(t, int32s, n, func(x []int32) bool { + t.Helper() + a := archsimd.LoadInt32x4Slice(x) + g := make([]uint16, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt64x2ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt64x2ConvertToUint16(t *testing.T, f func(x archsimd.Int64x2) archsimd.Uint16x8, want func(x []int64) []uint16) { + n := 2 + t.Helper() + forSlice(t, int64s, n, func(x []int64) bool { + t.Helper() + a := archsimd.LoadInt64x2Slice(x) + g := make([]uint16, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint8x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint8x16ConvertToUint16(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Uint16x16, want func(x []uint8) []uint16) { + n := 16 + t.Helper() + forSlice(t, uint8s, n, func(x []uint8) bool { + t.Helper() + a := archsimd.LoadUint8x16Slice(x) + g := make([]uint16, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint16x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint16x8ConvertToUint16(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Uint16x8, want func(x []uint16) []uint16) { + n := 8 + t.Helper() + forSlice(t, uint16s, n, func(x []uint16) bool { + t.Helper() + a := archsimd.LoadUint16x8Slice(x) + g := make([]uint16, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint32x4ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint32x4ConvertToUint16(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Uint16x8, want func(x []uint32) []uint16) { + n := 4 + t.Helper() + forSlice(t, uint32s, n, func(x []uint32) bool { + t.Helper() + a := archsimd.LoadUint32x4Slice(x) + g := make([]uint16, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint64x2ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint64x2ConvertToUint16(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Uint16x8, want func(x []uint64) []uint16) { + n := 2 + t.Helper() + forSlice(t, uint64s, n, func(x []uint64) bool { + t.Helper() + a := archsimd.LoadUint64x2Slice(x) + g := make([]uint16, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint8x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. -func testUint8x16ConvertToUint16(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Uint16x16, want func(x []uint8) []uint16) { - n := 16 +// testFloat32x4ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat32x4ConvertToUint16(t *testing.T, f func(x archsimd.Float32x4) archsimd.Uint16x8, want func(x []float32) []uint16) { + n := 4 t.Helper() - forSlice(t, uint8s, n, func(x []uint8) bool { + forSlice(t, float32s, n, func(x []float32) bool { t.Helper() - a := archsimd.LoadUint8x16Slice(x) - g := make([]uint16, n) + a := archsimd.LoadFloat32x4Slice(x) + g := make([]uint16, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint16x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. -func testUint16x8ConvertToUint16(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Uint16x8, want func(x []uint16) []uint16) { - n := 8 +// testFloat64x2ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat64x2ConvertToUint16(t *testing.T, f func(x archsimd.Float64x2) archsimd.Uint16x8, want func(x []float64) []uint16) { + n := 2 t.Helper() - forSlice(t, uint16s, n, func(x []uint16) bool { + forSlice(t, float64s, n, func(x []float64) bool { t.Helper() - a := archsimd.LoadUint16x8Slice(x) - g := make([]uint16, n) + a := archsimd.LoadFloat64x2Slice(x) + g := make([]uint16, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt8x32ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt8x32ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt8x32ConvertToUint16(t *testing.T, f func(x archsimd.Int8x32) archsimd.Uint16x32, want func(x []int8) []uint16) { n := 32 t.Helper() forSlice(t, int8s, n, func(x []int8) bool { t.Helper() a := archsimd.LoadInt8x32Slice(x) - g := make([]uint16, n) + g := make([]uint16, 32) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt16x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt16x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt16x16ConvertToUint16(t *testing.T, f func(x archsimd.Int16x16) archsimd.Uint16x16, want func(x []int16) []uint16) { n := 16 t.Helper() forSlice(t, int16s, n, func(x []int16) bool { t.Helper() a := archsimd.LoadInt16x16Slice(x) - g := make([]uint16, n) + g := make([]uint16, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt32x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt32x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt32x8ConvertToUint16(t *testing.T, f func(x archsimd.Int32x8) archsimd.Uint16x8, want func(x []int32) []uint16) { n := 8 t.Helper() forSlice(t, int32s, n, func(x []int32) bool { t.Helper() a := archsimd.LoadInt32x8Slice(x) - g := make([]uint16, n) + g := make([]uint16, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt64x4ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt64x4ConvertToUint16(t *testing.T, f func(x archsimd.Int64x4) archsimd.Uint16x8, want func(x []int64) []uint16) { + n := 4 + t.Helper() + forSlice(t, int64s, n, func(x []int64) bool { + t.Helper() + a := archsimd.LoadInt64x4Slice(x) + g := make([]uint16, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint8x32ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint8x32ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint8x32ConvertToUint16(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Uint16x32, want func(x []uint8) []uint16) { n := 32 t.Helper() forSlice(t, uint8s, n, func(x []uint8) bool { t.Helper() a := archsimd.LoadUint8x32Slice(x) - g := make([]uint16, n) + g := make([]uint16, 32) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint16x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint16x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint16x16ConvertToUint16(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Uint16x16, want func(x []uint16) []uint16) { n := 16 t.Helper() forSlice(t, uint16s, n, func(x []uint16) bool { t.Helper() a := archsimd.LoadUint16x16Slice(x) - g := make([]uint16, n) + g := make([]uint16, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint32x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint32x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint32x8ConvertToUint16(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Uint16x8, want func(x []uint32) []uint16) { n := 8 t.Helper() forSlice(t, uint32s, n, func(x []uint32) bool { t.Helper() a := archsimd.LoadUint32x8Slice(x) - g := make([]uint16, n) + g := make([]uint16, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint64x4ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint64x4ConvertToUint16(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Uint16x8, want func(x []uint64) []uint16) { + n := 4 + t.Helper() + forSlice(t, uint64s, n, func(x []uint64) bool { + t.Helper() + a := archsimd.LoadUint64x4Slice(x) + g := make([]uint16, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat32x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat32x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat32x8ConvertToUint16(t *testing.T, f func(x archsimd.Float32x8) archsimd.Uint16x8, want func(x []float32) []uint16) { n := 8 t.Helper() forSlice(t, float32s, n, func(x []float32) bool { t.Helper() a := archsimd.LoadFloat32x8Slice(x) - g := make([]uint16, n) + g := make([]uint16, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testFloat64x4ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat64x4ConvertToUint16(t *testing.T, f func(x archsimd.Float64x4) archsimd.Uint16x8, want func(x []float64) []uint16) { + n := 4 + t.Helper() + forSlice(t, float64s, n, func(x []float64) bool { + t.Helper() + a := archsimd.LoadFloat64x4Slice(x) + g := make([]uint16, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt8x64ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt8x64ConvertToUint16(t *testing.T, f func(x archsimd.Int8x64) archsimd.Uint16x32, want func(x []int8) []uint16) { + n := 64 + t.Helper() + forSlice(t, int8s, n, func(x []int8) bool { + t.Helper() + a := archsimd.LoadInt8x64Slice(x) + g := make([]uint16, 32) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt16x32ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt16x32ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt16x32ConvertToUint16(t *testing.T, f func(x archsimd.Int16x32) archsimd.Uint16x32, want func(x []int16) []uint16) { n := 32 t.Helper() forSlice(t, int16s, n, func(x []int16) bool { t.Helper() a := archsimd.LoadInt16x32Slice(x) - g := make([]uint16, n) + g := make([]uint16, 32) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt32x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt32x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt32x16ConvertToUint16(t *testing.T, f func(x archsimd.Int32x16) archsimd.Uint16x16, want func(x []int32) []uint16) { n := 16 t.Helper() forSlice(t, int32s, n, func(x []int32) bool { t.Helper() a := archsimd.LoadInt32x16Slice(x) - g := make([]uint16, n) + g := make([]uint16, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt64x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt64x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt64x8ConvertToUint16(t *testing.T, f func(x archsimd.Int64x8) archsimd.Uint16x8, want func(x []int64) []uint16) { n := 8 t.Helper() forSlice(t, int64s, n, func(x []int64) bool { t.Helper() a := archsimd.LoadInt64x8Slice(x) - g := make([]uint16, n) + g := make([]uint16, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint8x64ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint8x64ConvertToUint16(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Uint16x32, want func(x []uint8) []uint16) { + n := 64 + t.Helper() + forSlice(t, uint8s, n, func(x []uint8) bool { + t.Helper() + a := archsimd.LoadUint8x64Slice(x) + g := make([]uint16, 32) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint16x32ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint16x32ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint16x32ConvertToUint16(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Uint16x32, want func(x []uint16) []uint16) { n := 32 t.Helper() forSlice(t, uint16s, n, func(x []uint16) bool { t.Helper() a := archsimd.LoadUint16x32Slice(x) - g := make([]uint16, n) + g := make([]uint16, 32) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint32x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint32x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint32x16ConvertToUint16(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Uint16x16, want func(x []uint32) []uint16) { n := 16 t.Helper() forSlice(t, uint32s, n, func(x []uint32) bool { t.Helper() a := archsimd.LoadUint32x16Slice(x) - g := make([]uint16, n) + g := make([]uint16, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint64x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint64x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint64x8ConvertToUint16(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Uint16x8, want func(x []uint64) []uint16) { n := 8 t.Helper() forSlice(t, uint64s, n, func(x []uint64) bool { t.Helper() a := archsimd.LoadUint64x8Slice(x) - g := make([]uint16, n) + g := make([]uint16, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat32x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat32x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat32x16ConvertToUint16(t *testing.T, f func(x archsimd.Float32x16) archsimd.Uint16x16, want func(x []float32) []uint16) { n := 16 t.Helper() forSlice(t, float32s, n, func(x []float32) bool { t.Helper() a := archsimd.LoadFloat32x16Slice(x) - g := make([]uint16, n) + g := make([]uint16, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat64x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat64x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat64x8ConvertToUint16(t *testing.T, f func(x archsimd.Float64x8) archsimd.Uint16x8, want func(x []float64) []uint16) { n := 8 t.Helper() forSlice(t, float64s, n, func(x []float64) bool { t.Helper() a := archsimd.LoadFloat64x8Slice(x) - g := make([]uint16, n) + g := make([]uint16, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt8x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt8x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt8x16ConvertToInt32(t *testing.T, f func(x archsimd.Int8x16) archsimd.Int32x16, want func(x []int8) []int32) { n := 16 t.Helper() forSlice(t, int8s, n, func(x []int8) bool { t.Helper() a := archsimd.LoadInt8x16Slice(x) - g := make([]int32, n) + g := make([]int32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt16x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt16x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt16x8ConvertToInt32(t *testing.T, f func(x archsimd.Int16x8) archsimd.Int32x8, want func(x []int16) []int32) { n := 8 t.Helper() forSlice(t, int16s, n, func(x []int16) bool { t.Helper() a := archsimd.LoadInt16x8Slice(x) - g := make([]int32, n) + g := make([]int32, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt32x4ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt32x4ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt32x4ConvertToInt32(t *testing.T, f func(x archsimd.Int32x4) archsimd.Int32x4, want func(x []int32) []int32) { n := 4 t.Helper() forSlice(t, int32s, n, func(x []int32) bool { t.Helper() a := archsimd.LoadInt32x4Slice(x) - g := make([]int32, n) + g := make([]int32, 4) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt64x2ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt64x2ConvertToInt32(t *testing.T, f func(x archsimd.Int64x2) archsimd.Int32x4, want func(x []int64) []int32) { + n := 2 + t.Helper() + forSlice(t, int64s, n, func(x []int64) bool { + t.Helper() + a := archsimd.LoadInt64x2Slice(x) + g := make([]int32, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint8x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint8x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint8x16ConvertToInt32(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Int32x16, want func(x []uint8) []int32) { n := 16 t.Helper() forSlice(t, uint8s, n, func(x []uint8) bool { t.Helper() a := archsimd.LoadUint8x16Slice(x) - g := make([]int32, n) + g := make([]int32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint16x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint16x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint16x8ConvertToInt32(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Int32x8, want func(x []uint16) []int32) { n := 8 t.Helper() forSlice(t, uint16s, n, func(x []uint16) bool { t.Helper() a := archsimd.LoadUint16x8Slice(x) - g := make([]int32, n) + g := make([]int32, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint32x4ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint32x4ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint32x4ConvertToInt32(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Int32x4, want func(x []uint32) []int32) { n := 4 t.Helper() forSlice(t, uint32s, n, func(x []uint32) bool { t.Helper() a := archsimd.LoadUint32x4Slice(x) - g := make([]int32, n) + g := make([]int32, 4) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint64x2ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint64x2ConvertToInt32(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Int32x4, want func(x []uint64) []int32) { + n := 2 + t.Helper() + forSlice(t, uint64s, n, func(x []uint64) bool { + t.Helper() + a := archsimd.LoadUint64x2Slice(x) + g := make([]int32, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat32x4ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat32x4ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat32x4ConvertToInt32(t *testing.T, f func(x archsimd.Float32x4) archsimd.Int32x4, want func(x []float32) []int32) { n := 4 t.Helper() forSlice(t, float32s, n, func(x []float32) bool { t.Helper() a := archsimd.LoadFloat32x4Slice(x) - g := make([]int32, n) + g := make([]int32, 4) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testFloat64x2ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat64x2ConvertToInt32(t *testing.T, f func(x archsimd.Float64x2) archsimd.Int32x4, want func(x []float64) []int32) { + n := 2 + t.Helper() + forSlice(t, float64s, n, func(x []float64) bool { + t.Helper() + a := archsimd.LoadFloat64x2Slice(x) + g := make([]int32, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt16x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt8x32ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt8x32ConvertToInt32(t *testing.T, f func(x archsimd.Int8x32) archsimd.Int32x16, want func(x []int8) []int32) { + n := 32 + t.Helper() + forSlice(t, int8s, n, func(x []int8) bool { + t.Helper() + a := archsimd.LoadInt8x32Slice(x) + g := make([]int32, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt16x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt16x16ConvertToInt32(t *testing.T, f func(x archsimd.Int16x16) archsimd.Int32x16, want func(x []int16) []int32) { n := 16 t.Helper() forSlice(t, int16s, n, func(x []int16) bool { t.Helper() a := archsimd.LoadInt16x16Slice(x) - g := make([]int32, n) + g := make([]int32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt32x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt32x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt32x8ConvertToInt32(t *testing.T, f func(x archsimd.Int32x8) archsimd.Int32x8, want func(x []int32) []int32) { n := 8 t.Helper() forSlice(t, int32s, n, func(x []int32) bool { t.Helper() a := archsimd.LoadInt32x8Slice(x) - g := make([]int32, n) + g := make([]int32, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt64x4ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt64x4ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt64x4ConvertToInt32(t *testing.T, f func(x archsimd.Int64x4) archsimd.Int32x4, want func(x []int64) []int32) { n := 4 t.Helper() forSlice(t, int64s, n, func(x []int64) bool { t.Helper() a := archsimd.LoadInt64x4Slice(x) - g := make([]int32, n) + g := make([]int32, 4) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint8x32ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint8x32ConvertToInt32(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Int32x16, want func(x []uint8) []int32) { + n := 32 + t.Helper() + forSlice(t, uint8s, n, func(x []uint8) bool { + t.Helper() + a := archsimd.LoadUint8x32Slice(x) + g := make([]int32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint16x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint16x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint16x16ConvertToInt32(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Int32x16, want func(x []uint16) []int32) { n := 16 t.Helper() forSlice(t, uint16s, n, func(x []uint16) bool { t.Helper() a := archsimd.LoadUint16x16Slice(x) - g := make([]int32, n) + g := make([]int32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint32x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint32x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint32x8ConvertToInt32(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Int32x8, want func(x []uint32) []int32) { n := 8 t.Helper() forSlice(t, uint32s, n, func(x []uint32) bool { t.Helper() a := archsimd.LoadUint32x8Slice(x) - g := make([]int32, n) + g := make([]int32, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint64x4ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint64x4ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint64x4ConvertToInt32(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Int32x4, want func(x []uint64) []int32) { n := 4 t.Helper() forSlice(t, uint64s, n, func(x []uint64) bool { t.Helper() a := archsimd.LoadUint64x4Slice(x) - g := make([]int32, n) + g := make([]int32, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat32x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat32x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat32x8ConvertToInt32(t *testing.T, f func(x archsimd.Float32x8) archsimd.Int32x8, want func(x []float32) []int32) { n := 8 t.Helper() forSlice(t, float32s, n, func(x []float32) bool { t.Helper() a := archsimd.LoadFloat32x8Slice(x) - g := make([]int32, n) + g := make([]int32, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat64x4ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat64x4ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat64x4ConvertToInt32(t *testing.T, f func(x archsimd.Float64x4) archsimd.Int32x4, want func(x []float64) []int32) { n := 4 t.Helper() forSlice(t, float64s, n, func(x []float64) bool { t.Helper() a := archsimd.LoadFloat64x4Slice(x) - g := make([]int32, n) + g := make([]int32, 4) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt8x64ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt8x64ConvertToInt32(t *testing.T, f func(x archsimd.Int8x64) archsimd.Int32x16, want func(x []int8) []int32) { + n := 64 + t.Helper() + forSlice(t, int8s, n, func(x []int8) bool { + t.Helper() + a := archsimd.LoadInt8x64Slice(x) + g := make([]int32, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt16x32ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt16x32ConvertToInt32(t *testing.T, f func(x archsimd.Int16x32) archsimd.Int32x16, want func(x []int16) []int32) { + n := 32 + t.Helper() + forSlice(t, int16s, n, func(x []int16) bool { + t.Helper() + a := archsimd.LoadInt16x32Slice(x) + g := make([]int32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt32x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt32x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt32x16ConvertToInt32(t *testing.T, f func(x archsimd.Int32x16) archsimd.Int32x16, want func(x []int32) []int32) { n := 16 t.Helper() forSlice(t, int32s, n, func(x []int32) bool { t.Helper() a := archsimd.LoadInt32x16Slice(x) - g := make([]int32, n) + g := make([]int32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt64x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt64x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt64x8ConvertToInt32(t *testing.T, f func(x archsimd.Int64x8) archsimd.Int32x8, want func(x []int64) []int32) { n := 8 t.Helper() forSlice(t, int64s, n, func(x []int64) bool { t.Helper() a := archsimd.LoadInt64x8Slice(x) - g := make([]int32, n) + g := make([]int32, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint8x64ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint8x64ConvertToInt32(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Int32x16, want func(x []uint8) []int32) { + n := 64 + t.Helper() + forSlice(t, uint8s, n, func(x []uint8) bool { + t.Helper() + a := archsimd.LoadUint8x64Slice(x) + g := make([]int32, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint16x32ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint16x32ConvertToInt32(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Int32x16, want func(x []uint16) []int32) { + n := 32 + t.Helper() + forSlice(t, uint16s, n, func(x []uint16) bool { + t.Helper() + a := archsimd.LoadUint16x32Slice(x) + g := make([]int32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint32x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint32x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint32x16ConvertToInt32(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Int32x16, want func(x []uint32) []int32) { n := 16 t.Helper() forSlice(t, uint32s, n, func(x []uint32) bool { t.Helper() a := archsimd.LoadUint32x16Slice(x) - g := make([]int32, n) + g := make([]int32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint64x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint64x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint64x8ConvertToInt32(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Int32x8, want func(x []uint64) []int32) { n := 8 t.Helper() forSlice(t, uint64s, n, func(x []uint64) bool { t.Helper() a := archsimd.LoadUint64x8Slice(x) - g := make([]int32, n) + g := make([]int32, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat32x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat32x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat32x16ConvertToInt32(t *testing.T, f func(x archsimd.Float32x16) archsimd.Int32x16, want func(x []float32) []int32) { n := 16 t.Helper() forSlice(t, float32s, n, func(x []float32) bool { t.Helper() a := archsimd.LoadFloat32x16Slice(x) - g := make([]int32, n) + g := make([]int32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat64x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat64x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat64x8ConvertToInt32(t *testing.T, f func(x archsimd.Float64x8) archsimd.Int32x8, want func(x []float64) []int32) { n := 8 t.Helper() forSlice(t, float64s, n, func(x []float64) bool { t.Helper() a := archsimd.LoadFloat64x8Slice(x) - g := make([]int32, n) + g := make([]int32, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt8x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt8x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt8x16ConvertToUint32(t *testing.T, f func(x archsimd.Int8x16) archsimd.Uint32x16, want func(x []int8) []uint32) { n := 16 t.Helper() forSlice(t, int8s, n, func(x []int8) bool { t.Helper() a := archsimd.LoadInt8x16Slice(x) - g := make([]uint32, n) + g := make([]uint32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt16x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt16x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt16x8ConvertToUint32(t *testing.T, f func(x archsimd.Int16x8) archsimd.Uint32x8, want func(x []int16) []uint32) { n := 8 t.Helper() forSlice(t, int16s, n, func(x []int16) bool { t.Helper() a := archsimd.LoadInt16x8Slice(x) - g := make([]uint32, n) + g := make([]uint32, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt32x4ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt32x4ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt32x4ConvertToUint32(t *testing.T, f func(x archsimd.Int32x4) archsimd.Uint32x4, want func(x []int32) []uint32) { n := 4 t.Helper() forSlice(t, int32s, n, func(x []int32) bool { t.Helper() a := archsimd.LoadInt32x4Slice(x) - g := make([]uint32, n) + g := make([]uint32, 4) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt64x2ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt64x2ConvertToUint32(t *testing.T, f func(x archsimd.Int64x2) archsimd.Uint32x4, want func(x []int64) []uint32) { + n := 2 + t.Helper() + forSlice(t, int64s, n, func(x []int64) bool { + t.Helper() + a := archsimd.LoadInt64x2Slice(x) + g := make([]uint32, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint8x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint8x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint8x16ConvertToUint32(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Uint32x16, want func(x []uint8) []uint32) { n := 16 t.Helper() - forSlice(t, uint8s, n, func(x []uint8) bool { + forSlice(t, uint8s, n, func(x []uint8) bool { + t.Helper() + a := archsimd.LoadUint8x16Slice(x) + g := make([]uint32, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint16x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint16x8ConvertToUint32(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Uint32x8, want func(x []uint16) []uint32) { + n := 8 + t.Helper() + forSlice(t, uint16s, n, func(x []uint16) bool { + t.Helper() + a := archsimd.LoadUint16x8Slice(x) + g := make([]uint32, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint32x4ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint32x4ConvertToUint32(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Uint32x4, want func(x []uint32) []uint32) { + n := 4 + t.Helper() + forSlice(t, uint32s, n, func(x []uint32) bool { + t.Helper() + a := archsimd.LoadUint32x4Slice(x) + g := make([]uint32, 4) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint64x2ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint64x2ConvertToUint32(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Uint32x4, want func(x []uint64) []uint32) { + n := 2 + t.Helper() + forSlice(t, uint64s, n, func(x []uint64) bool { t.Helper() - a := archsimd.LoadUint8x16Slice(x) - g := make([]uint32, n) + a := archsimd.LoadUint64x2Slice(x) + g := make([]uint32, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint16x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. -func testUint16x8ConvertToUint32(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Uint32x8, want func(x []uint16) []uint32) { - n := 8 +// testFloat32x4ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat32x4ConvertToUint32(t *testing.T, f func(x archsimd.Float32x4) archsimd.Uint32x4, want func(x []float32) []uint32) { + n := 4 t.Helper() - forSlice(t, uint16s, n, func(x []uint16) bool { + forSlice(t, float32s, n, func(x []float32) bool { t.Helper() - a := archsimd.LoadUint16x8Slice(x) - g := make([]uint32, n) + a := archsimd.LoadFloat32x4Slice(x) + g := make([]uint32, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint32x4ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. -func testUint32x4ConvertToUint32(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Uint32x4, want func(x []uint32) []uint32) { - n := 4 +// testFloat64x2ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat64x2ConvertToUint32(t *testing.T, f func(x archsimd.Float64x2) archsimd.Uint32x4, want func(x []float64) []uint32) { + n := 2 t.Helper() - forSlice(t, uint32s, n, func(x []uint32) bool { + forSlice(t, float64s, n, func(x []float64) bool { t.Helper() - a := archsimd.LoadUint32x4Slice(x) - g := make([]uint32, n) + a := archsimd.LoadFloat64x2Slice(x) + g := make([]uint32, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat32x4ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. -func testFloat32x4ConvertToUint32(t *testing.T, f func(x archsimd.Float32x4) archsimd.Uint32x4, want func(x []float32) []uint32) { - n := 4 +// testInt8x32ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt8x32ConvertToUint32(t *testing.T, f func(x archsimd.Int8x32) archsimd.Uint32x16, want func(x []int8) []uint32) { + n := 32 t.Helper() - forSlice(t, float32s, n, func(x []float32) bool { + forSlice(t, int8s, n, func(x []int8) bool { t.Helper() - a := archsimd.LoadFloat32x4Slice(x) - g := make([]uint32, n) + a := archsimd.LoadInt8x32Slice(x) + g := make([]uint32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt16x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt16x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt16x16ConvertToUint32(t *testing.T, f func(x archsimd.Int16x16) archsimd.Uint32x16, want func(x []int16) []uint32) { n := 16 t.Helper() forSlice(t, int16s, n, func(x []int16) bool { t.Helper() a := archsimd.LoadInt16x16Slice(x) - g := make([]uint32, n) + g := make([]uint32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt32x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt32x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt32x8ConvertToUint32(t *testing.T, f func(x archsimd.Int32x8) archsimd.Uint32x8, want func(x []int32) []uint32) { n := 8 t.Helper() forSlice(t, int32s, n, func(x []int32) bool { t.Helper() a := archsimd.LoadInt32x8Slice(x) - g := make([]uint32, n) + g := make([]uint32, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt64x4ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt64x4ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt64x4ConvertToUint32(t *testing.T, f func(x archsimd.Int64x4) archsimd.Uint32x4, want func(x []int64) []uint32) { n := 4 t.Helper() forSlice(t, int64s, n, func(x []int64) bool { t.Helper() a := archsimd.LoadInt64x4Slice(x) - g := make([]uint32, n) + g := make([]uint32, 4) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint8x32ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint8x32ConvertToUint32(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Uint32x16, want func(x []uint8) []uint32) { + n := 32 + t.Helper() + forSlice(t, uint8s, n, func(x []uint8) bool { + t.Helper() + a := archsimd.LoadUint8x32Slice(x) + g := make([]uint32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint16x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint16x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint16x16ConvertToUint32(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Uint32x16, want func(x []uint16) []uint32) { n := 16 t.Helper() forSlice(t, uint16s, n, func(x []uint16) bool { t.Helper() a := archsimd.LoadUint16x16Slice(x) - g := make([]uint32, n) + g := make([]uint32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint32x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint32x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint32x8ConvertToUint32(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Uint32x8, want func(x []uint32) []uint32) { n := 8 t.Helper() forSlice(t, uint32s, n, func(x []uint32) bool { t.Helper() a := archsimd.LoadUint32x8Slice(x) - g := make([]uint32, n) + g := make([]uint32, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint64x4ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint64x4ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint64x4ConvertToUint32(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Uint32x4, want func(x []uint64) []uint32) { n := 4 t.Helper() forSlice(t, uint64s, n, func(x []uint64) bool { t.Helper() a := archsimd.LoadUint64x4Slice(x) - g := make([]uint32, n) + g := make([]uint32, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat32x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat32x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat32x8ConvertToUint32(t *testing.T, f func(x archsimd.Float32x8) archsimd.Uint32x8, want func(x []float32) []uint32) { n := 8 t.Helper() forSlice(t, float32s, n, func(x []float32) bool { t.Helper() a := archsimd.LoadFloat32x8Slice(x) - g := make([]uint32, n) + g := make([]uint32, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat64x4ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat64x4ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat64x4ConvertToUint32(t *testing.T, f func(x archsimd.Float64x4) archsimd.Uint32x4, want func(x []float64) []uint32) { n := 4 t.Helper() forSlice(t, float64s, n, func(x []float64) bool { t.Helper() a := archsimd.LoadFloat64x4Slice(x) - g := make([]uint32, n) + g := make([]uint32, 4) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt8x64ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt8x64ConvertToUint32(t *testing.T, f func(x archsimd.Int8x64) archsimd.Uint32x16, want func(x []int8) []uint32) { + n := 64 + t.Helper() + forSlice(t, int8s, n, func(x []int8) bool { + t.Helper() + a := archsimd.LoadInt8x64Slice(x) + g := make([]uint32, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt16x32ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt16x32ConvertToUint32(t *testing.T, f func(x archsimd.Int16x32) archsimd.Uint32x16, want func(x []int16) []uint32) { + n := 32 + t.Helper() + forSlice(t, int16s, n, func(x []int16) bool { + t.Helper() + a := archsimd.LoadInt16x32Slice(x) + g := make([]uint32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt32x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt32x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt32x16ConvertToUint32(t *testing.T, f func(x archsimd.Int32x16) archsimd.Uint32x16, want func(x []int32) []uint32) { n := 16 t.Helper() forSlice(t, int32s, n, func(x []int32) bool { t.Helper() a := archsimd.LoadInt32x16Slice(x) - g := make([]uint32, n) + g := make([]uint32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt64x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt64x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt64x8ConvertToUint32(t *testing.T, f func(x archsimd.Int64x8) archsimd.Uint32x8, want func(x []int64) []uint32) { n := 8 t.Helper() forSlice(t, int64s, n, func(x []int64) bool { t.Helper() a := archsimd.LoadInt64x8Slice(x) - g := make([]uint32, n) + g := make([]uint32, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint8x64ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint8x64ConvertToUint32(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Uint32x16, want func(x []uint8) []uint32) { + n := 64 + t.Helper() + forSlice(t, uint8s, n, func(x []uint8) bool { + t.Helper() + a := archsimd.LoadUint8x64Slice(x) + g := make([]uint32, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint16x32ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint16x32ConvertToUint32(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Uint32x16, want func(x []uint16) []uint32) { + n := 32 + t.Helper() + forSlice(t, uint16s, n, func(x []uint16) bool { + t.Helper() + a := archsimd.LoadUint16x32Slice(x) + g := make([]uint32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint32x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint32x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint32x16ConvertToUint32(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Uint32x16, want func(x []uint32) []uint32) { n := 16 t.Helper() forSlice(t, uint32s, n, func(x []uint32) bool { t.Helper() a := archsimd.LoadUint32x16Slice(x) - g := make([]uint32, n) + g := make([]uint32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint64x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint64x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint64x8ConvertToUint32(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Uint32x8, want func(x []uint64) []uint32) { n := 8 t.Helper() forSlice(t, uint64s, n, func(x []uint64) bool { t.Helper() a := archsimd.LoadUint64x8Slice(x) - g := make([]uint32, n) + g := make([]uint32, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat32x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat32x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat32x16ConvertToUint32(t *testing.T, f func(x archsimd.Float32x16) archsimd.Uint32x16, want func(x []float32) []uint32) { n := 16 t.Helper() forSlice(t, float32s, n, func(x []float32) bool { t.Helper() a := archsimd.LoadFloat32x16Slice(x) - g := make([]uint32, n) + g := make([]uint32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat64x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat64x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat64x8ConvertToUint32(t *testing.T, f func(x archsimd.Float64x8) archsimd.Uint32x8, want func(x []float64) []uint32) { n := 8 t.Helper() forSlice(t, float64s, n, func(x []float64) bool { t.Helper() a := archsimd.LoadFloat64x8Slice(x) - g := make([]uint32, n) + g := make([]uint32, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt8x16ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt8x16ConvertToInt64(t *testing.T, f func(x archsimd.Int8x16) archsimd.Int64x8, want func(x []int8) []int64) { + n := 16 + t.Helper() + forSlice(t, int8s, n, func(x []int8) bool { + t.Helper() + a := archsimd.LoadInt8x16Slice(x) + g := make([]int64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt16x8ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt16x8ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt16x8ConvertToInt64(t *testing.T, f func(x archsimd.Int16x8) archsimd.Int64x8, want func(x []int16) []int64) { n := 8 t.Helper() forSlice(t, int16s, n, func(x []int16) bool { t.Helper() a := archsimd.LoadInt16x8Slice(x) - g := make([]int64, n) + g := make([]int64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt32x4ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt32x4ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt32x4ConvertToInt64(t *testing.T, f func(x archsimd.Int32x4) archsimd.Int64x4, want func(x []int32) []int64) { n := 4 t.Helper() forSlice(t, int32s, n, func(x []int32) bool { t.Helper() a := archsimd.LoadInt32x4Slice(x) - g := make([]int64, n) + g := make([]int64, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt64x2ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt64x2ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt64x2ConvertToInt64(t *testing.T, f func(x archsimd.Int64x2) archsimd.Int64x2, want func(x []int64) []int64) { n := 2 t.Helper() forSlice(t, int64s, n, func(x []int64) bool { t.Helper() a := archsimd.LoadInt64x2Slice(x) - g := make([]int64, n) + g := make([]int64, 2) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint8x16ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint8x16ConvertToInt64(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Int64x8, want func(x []uint8) []int64) { + n := 16 + t.Helper() + forSlice(t, uint8s, n, func(x []uint8) bool { + t.Helper() + a := archsimd.LoadUint8x16Slice(x) + g := make([]int64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint16x8ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint16x8ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint16x8ConvertToInt64(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Int64x8, want func(x []uint16) []int64) { n := 8 t.Helper() forSlice(t, uint16s, n, func(x []uint16) bool { t.Helper() a := archsimd.LoadUint16x8Slice(x) - g := make([]int64, n) + g := make([]int64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint32x4ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint32x4ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint32x4ConvertToInt64(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Int64x4, want func(x []uint32) []int64) { n := 4 t.Helper() forSlice(t, uint32s, n, func(x []uint32) bool { t.Helper() a := archsimd.LoadUint32x4Slice(x) - g := make([]int64, n) + g := make([]int64, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint64x2ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint64x2ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint64x2ConvertToInt64(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Int64x2, want func(x []uint64) []int64) { n := 2 t.Helper() forSlice(t, uint64s, n, func(x []uint64) bool { t.Helper() a := archsimd.LoadUint64x2Slice(x) - g := make([]int64, n) + g := make([]int64, 2) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat32x4ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat32x4ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat32x4ConvertToInt64(t *testing.T, f func(x archsimd.Float32x4) archsimd.Int64x4, want func(x []float32) []int64) { n := 4 t.Helper() forSlice(t, float32s, n, func(x []float32) bool { t.Helper() a := archsimd.LoadFloat32x4Slice(x) - g := make([]int64, n) + g := make([]int64, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat64x2ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat64x2ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat64x2ConvertToInt64(t *testing.T, f func(x archsimd.Float64x2) archsimd.Int64x2, want func(x []float64) []int64) { n := 2 t.Helper() forSlice(t, float64s, n, func(x []float64) bool { t.Helper() a := archsimd.LoadFloat64x2Slice(x) - g := make([]int64, n) + g := make([]int64, 2) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt8x32ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt8x32ConvertToInt64(t *testing.T, f func(x archsimd.Int8x32) archsimd.Int64x8, want func(x []int8) []int64) { + n := 32 + t.Helper() + forSlice(t, int8s, n, func(x []int8) bool { + t.Helper() + a := archsimd.LoadInt8x32Slice(x) + g := make([]int64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt16x16ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt16x16ConvertToInt64(t *testing.T, f func(x archsimd.Int16x16) archsimd.Int64x8, want func(x []int16) []int64) { + n := 16 + t.Helper() + forSlice(t, int16s, n, func(x []int16) bool { + t.Helper() + a := archsimd.LoadInt16x16Slice(x) + g := make([]int64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt32x8ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt32x8ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt32x8ConvertToInt64(t *testing.T, f func(x archsimd.Int32x8) archsimd.Int64x8, want func(x []int32) []int64) { n := 8 t.Helper() forSlice(t, int32s, n, func(x []int32) bool { t.Helper() a := archsimd.LoadInt32x8Slice(x) - g := make([]int64, n) + g := make([]int64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt64x4ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt64x4ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt64x4ConvertToInt64(t *testing.T, f func(x archsimd.Int64x4) archsimd.Int64x4, want func(x []int64) []int64) { n := 4 t.Helper() forSlice(t, int64s, n, func(x []int64) bool { t.Helper() a := archsimd.LoadInt64x4Slice(x) - g := make([]int64, n) + g := make([]int64, 4) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint8x32ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint8x32ConvertToInt64(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Int64x8, want func(x []uint8) []int64) { + n := 32 + t.Helper() + forSlice(t, uint8s, n, func(x []uint8) bool { + t.Helper() + a := archsimd.LoadUint8x32Slice(x) + g := make([]int64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint16x16ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint16x16ConvertToInt64(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Int64x8, want func(x []uint16) []int64) { + n := 16 + t.Helper() + forSlice(t, uint16s, n, func(x []uint16) bool { + t.Helper() + a := archsimd.LoadUint16x16Slice(x) + g := make([]int64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint32x8ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint32x8ConvertToInt64(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Int64x8, want func(x []uint32) []int64) { + n := 8 + t.Helper() + forSlice(t, uint32s, n, func(x []uint32) bool { + t.Helper() + a := archsimd.LoadUint32x8Slice(x) + g := make([]int64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint64x4ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint64x4ConvertToInt64(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Int64x4, want func(x []uint64) []int64) { + n := 4 + t.Helper() + forSlice(t, uint64s, n, func(x []uint64) bool { + t.Helper() + a := archsimd.LoadUint64x4Slice(x) + g := make([]int64, 4) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testFloat32x8ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat32x8ConvertToInt64(t *testing.T, f func(x archsimd.Float32x8) archsimd.Int64x8, want func(x []float32) []int64) { + n := 8 + t.Helper() + forSlice(t, float32s, n, func(x []float32) bool { + t.Helper() + a := archsimd.LoadFloat32x8Slice(x) + g := make([]int64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testFloat64x4ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat64x4ConvertToInt64(t *testing.T, f func(x archsimd.Float64x4) archsimd.Int64x4, want func(x []float64) []int64) { + n := 4 + t.Helper() + forSlice(t, float64s, n, func(x []float64) bool { + t.Helper() + a := archsimd.LoadFloat64x4Slice(x) + g := make([]int64, 4) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt8x64ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt8x64ConvertToInt64(t *testing.T, f func(x archsimd.Int8x64) archsimd.Int64x8, want func(x []int8) []int64) { + n := 64 + t.Helper() + forSlice(t, int8s, n, func(x []int8) bool { + t.Helper() + a := archsimd.LoadInt8x64Slice(x) + g := make([]int64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt16x32ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt16x32ConvertToInt64(t *testing.T, f func(x archsimd.Int16x32) archsimd.Int64x8, want func(x []int16) []int64) { + n := 32 + t.Helper() + forSlice(t, int16s, n, func(x []int16) bool { + t.Helper() + a := archsimd.LoadInt16x32Slice(x) + g := make([]int64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt32x16ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt32x16ConvertToInt64(t *testing.T, f func(x archsimd.Int32x16) archsimd.Int64x8, want func(x []int32) []int64) { + n := 16 + t.Helper() + forSlice(t, int32s, n, func(x []int32) bool { + t.Helper() + a := archsimd.LoadInt32x16Slice(x) + g := make([]int64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint32x8ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. -func testUint32x8ConvertToInt64(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Int64x8, want func(x []uint32) []int64) { +// testInt64x8ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt64x8ConvertToInt64(t *testing.T, f func(x archsimd.Int64x8) archsimd.Int64x8, want func(x []int64) []int64) { n := 8 t.Helper() - forSlice(t, uint32s, n, func(x []uint32) bool { + forSlice(t, int64s, n, func(x []int64) bool { t.Helper() - a := archsimd.LoadUint32x8Slice(x) - g := make([]int64, n) + a := archsimd.LoadInt64x8Slice(x) + g := make([]int64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint64x4ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. -func testUint64x4ConvertToInt64(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Int64x4, want func(x []uint64) []int64) { - n := 4 +// testUint8x64ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint8x64ConvertToInt64(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Int64x8, want func(x []uint8) []int64) { + n := 64 t.Helper() - forSlice(t, uint64s, n, func(x []uint64) bool { + forSlice(t, uint8s, n, func(x []uint8) bool { t.Helper() - a := archsimd.LoadUint64x4Slice(x) - g := make([]int64, n) + a := archsimd.LoadUint8x64Slice(x) + g := make([]int64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat32x8ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. -func testFloat32x8ConvertToInt64(t *testing.T, f func(x archsimd.Float32x8) archsimd.Int64x8, want func(x []float32) []int64) { - n := 8 +// testUint16x32ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint16x32ConvertToInt64(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Int64x8, want func(x []uint16) []int64) { + n := 32 t.Helper() - forSlice(t, float32s, n, func(x []float32) bool { + forSlice(t, uint16s, n, func(x []uint16) bool { t.Helper() - a := archsimd.LoadFloat32x8Slice(x) - g := make([]int64, n) + a := archsimd.LoadUint16x32Slice(x) + g := make([]int64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat64x4ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. -func testFloat64x4ConvertToInt64(t *testing.T, f func(x archsimd.Float64x4) archsimd.Int64x4, want func(x []float64) []int64) { - n := 4 +// testUint32x16ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint32x16ConvertToInt64(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Int64x8, want func(x []uint32) []int64) { + n := 16 t.Helper() - forSlice(t, float64s, n, func(x []float64) bool { + forSlice(t, uint32s, n, func(x []uint32) bool { t.Helper() - a := archsimd.LoadFloat64x4Slice(x) - g := make([]int64, n) + a := archsimd.LoadUint32x16Slice(x) + g := make([]int64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt64x8ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. -func testInt64x8ConvertToInt64(t *testing.T, f func(x archsimd.Int64x8) archsimd.Int64x8, want func(x []int64) []int64) { +// testUint64x8ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint64x8ConvertToInt64(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Int64x8, want func(x []uint64) []int64) { n := 8 t.Helper() - forSlice(t, int64s, n, func(x []int64) bool { + forSlice(t, uint64s, n, func(x []uint64) bool { t.Helper() - a := archsimd.LoadInt64x8Slice(x) - g := make([]int64, n) + a := archsimd.LoadUint64x8Slice(x) + g := make([]int64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint64x8ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. -func testUint64x8ConvertToInt64(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Int64x8, want func(x []uint64) []int64) { - n := 8 +// testFloat32x16ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat32x16ConvertToInt64(t *testing.T, f func(x archsimd.Float32x16) archsimd.Int64x8, want func(x []float32) []int64) { + n := 16 t.Helper() - forSlice(t, uint64s, n, func(x []uint64) bool { + forSlice(t, float32s, n, func(x []float32) bool { t.Helper() - a := archsimd.LoadUint64x8Slice(x) - g := make([]int64, n) + a := archsimd.LoadFloat32x16Slice(x) + g := make([]int64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat64x8ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat64x8ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat64x8ConvertToInt64(t *testing.T, f func(x archsimd.Float64x8) archsimd.Int64x8, want func(x []float64) []int64) { n := 8 t.Helper() forSlice(t, float64s, n, func(x []float64) bool { t.Helper() a := archsimd.LoadFloat64x8Slice(x) - g := make([]int64, n) + g := make([]int64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt16x8ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt8x16ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt8x16ConvertToUint64(t *testing.T, f func(x archsimd.Int8x16) archsimd.Uint64x8, want func(x []int8) []uint64) { + n := 16 + t.Helper() + forSlice(t, int8s, n, func(x []int8) bool { + t.Helper() + a := archsimd.LoadInt8x16Slice(x) + g := make([]uint64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt16x8ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt16x8ConvertToUint64(t *testing.T, f func(x archsimd.Int16x8) archsimd.Uint64x8, want func(x []int16) []uint64) { n := 8 t.Helper() forSlice(t, int16s, n, func(x []int16) bool { t.Helper() a := archsimd.LoadInt16x8Slice(x) - g := make([]uint64, n) + g := make([]uint64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt32x4ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt32x4ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt32x4ConvertToUint64(t *testing.T, f func(x archsimd.Int32x4) archsimd.Uint64x4, want func(x []int32) []uint64) { n := 4 t.Helper() forSlice(t, int32s, n, func(x []int32) bool { t.Helper() a := archsimd.LoadInt32x4Slice(x) - g := make([]uint64, n) + g := make([]uint64, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt64x2ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt64x2ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt64x2ConvertToUint64(t *testing.T, f func(x archsimd.Int64x2) archsimd.Uint64x2, want func(x []int64) []uint64) { n := 2 t.Helper() forSlice(t, int64s, n, func(x []int64) bool { t.Helper() a := archsimd.LoadInt64x2Slice(x) - g := make([]uint64, n) + g := make([]uint64, 2) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint8x16ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint8x16ConvertToUint64(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Uint64x8, want func(x []uint8) []uint64) { + n := 16 + t.Helper() + forSlice(t, uint8s, n, func(x []uint8) bool { + t.Helper() + a := archsimd.LoadUint8x16Slice(x) + g := make([]uint64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint16x8ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint16x8ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint16x8ConvertToUint64(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Uint64x8, want func(x []uint16) []uint64) { n := 8 t.Helper() forSlice(t, uint16s, n, func(x []uint16) bool { t.Helper() a := archsimd.LoadUint16x8Slice(x) - g := make([]uint64, n) + g := make([]uint64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint32x4ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint32x4ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint32x4ConvertToUint64(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Uint64x4, want func(x []uint32) []uint64) { n := 4 t.Helper() forSlice(t, uint32s, n, func(x []uint32) bool { t.Helper() a := archsimd.LoadUint32x4Slice(x) - g := make([]uint64, n) + g := make([]uint64, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint64x2ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint64x2ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint64x2ConvertToUint64(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Uint64x2, want func(x []uint64) []uint64) { n := 2 t.Helper() forSlice(t, uint64s, n, func(x []uint64) bool { t.Helper() a := archsimd.LoadUint64x2Slice(x) - g := make([]uint64, n) + g := make([]uint64, 2) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat32x4ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat32x4ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat32x4ConvertToUint64(t *testing.T, f func(x archsimd.Float32x4) archsimd.Uint64x4, want func(x []float32) []uint64) { n := 4 t.Helper() forSlice(t, float32s, n, func(x []float32) bool { t.Helper() a := archsimd.LoadFloat32x4Slice(x) - g := make([]uint64, n) + g := make([]uint64, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat64x2ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat64x2ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat64x2ConvertToUint64(t *testing.T, f func(x archsimd.Float64x2) archsimd.Uint64x2, want func(x []float64) []uint64) { n := 2 t.Helper() forSlice(t, float64s, n, func(x []float64) bool { t.Helper() a := archsimd.LoadFloat64x2Slice(x) - g := make([]uint64, n) + g := make([]uint64, 2) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt8x32ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt8x32ConvertToUint64(t *testing.T, f func(x archsimd.Int8x32) archsimd.Uint64x8, want func(x []int8) []uint64) { + n := 32 + t.Helper() + forSlice(t, int8s, n, func(x []int8) bool { + t.Helper() + a := archsimd.LoadInt8x32Slice(x) + g := make([]uint64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt16x16ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt16x16ConvertToUint64(t *testing.T, f func(x archsimd.Int16x16) archsimd.Uint64x8, want func(x []int16) []uint64) { + n := 16 + t.Helper() + forSlice(t, int16s, n, func(x []int16) bool { + t.Helper() + a := archsimd.LoadInt16x16Slice(x) + g := make([]uint64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt32x8ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt32x8ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt32x8ConvertToUint64(t *testing.T, f func(x archsimd.Int32x8) archsimd.Uint64x8, want func(x []int32) []uint64) { n := 8 t.Helper() forSlice(t, int32s, n, func(x []int32) bool { t.Helper() a := archsimd.LoadInt32x8Slice(x) - g := make([]uint64, n) + g := make([]uint64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt64x4ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt64x4ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt64x4ConvertToUint64(t *testing.T, f func(x archsimd.Int64x4) archsimd.Uint64x4, want func(x []int64) []uint64) { n := 4 t.Helper() forSlice(t, int64s, n, func(x []int64) bool { t.Helper() a := archsimd.LoadInt64x4Slice(x) - g := make([]uint64, n) + g := make([]uint64, 4) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint8x32ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint8x32ConvertToUint64(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Uint64x8, want func(x []uint8) []uint64) { + n := 32 + t.Helper() + forSlice(t, uint8s, n, func(x []uint8) bool { + t.Helper() + a := archsimd.LoadUint8x32Slice(x) + g := make([]uint64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint16x16ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint16x16ConvertToUint64(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Uint64x8, want func(x []uint16) []uint64) { + n := 16 + t.Helper() + forSlice(t, uint16s, n, func(x []uint16) bool { + t.Helper() + a := archsimd.LoadUint16x16Slice(x) + g := make([]uint64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint32x8ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint32x8ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint32x8ConvertToUint64(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Uint64x8, want func(x []uint32) []uint64) { n := 8 t.Helper() forSlice(t, uint32s, n, func(x []uint32) bool { t.Helper() a := archsimd.LoadUint32x8Slice(x) - g := make([]uint64, n) + g := make([]uint64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint64x4ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint64x4ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint64x4ConvertToUint64(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Uint64x4, want func(x []uint64) []uint64) { n := 4 t.Helper() forSlice(t, uint64s, n, func(x []uint64) bool { t.Helper() a := archsimd.LoadUint64x4Slice(x) - g := make([]uint64, n) + g := make([]uint64, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat32x8ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat32x8ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat32x8ConvertToUint64(t *testing.T, f func(x archsimd.Float32x8) archsimd.Uint64x8, want func(x []float32) []uint64) { n := 8 t.Helper() forSlice(t, float32s, n, func(x []float32) bool { t.Helper() a := archsimd.LoadFloat32x8Slice(x) - g := make([]uint64, n) + g := make([]uint64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat64x4ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat64x4ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat64x4ConvertToUint64(t *testing.T, f func(x archsimd.Float64x4) archsimd.Uint64x4, want func(x []float64) []uint64) { n := 4 t.Helper() forSlice(t, float64s, n, func(x []float64) bool { t.Helper() a := archsimd.LoadFloat64x4Slice(x) - g := make([]uint64, n) + g := make([]uint64, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt64x8ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt8x64ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt8x64ConvertToUint64(t *testing.T, f func(x archsimd.Int8x64) archsimd.Uint64x8, want func(x []int8) []uint64) { + n := 64 + t.Helper() + forSlice(t, int8s, n, func(x []int8) bool { + t.Helper() + a := archsimd.LoadInt8x64Slice(x) + g := make([]uint64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt16x32ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt16x32ConvertToUint64(t *testing.T, f func(x archsimd.Int16x32) archsimd.Uint64x8, want func(x []int16) []uint64) { + n := 32 + t.Helper() + forSlice(t, int16s, n, func(x []int16) bool { + t.Helper() + a := archsimd.LoadInt16x32Slice(x) + g := make([]uint64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt32x16ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt32x16ConvertToUint64(t *testing.T, f func(x archsimd.Int32x16) archsimd.Uint64x8, want func(x []int32) []uint64) { + n := 16 + t.Helper() + forSlice(t, int32s, n, func(x []int32) bool { + t.Helper() + a := archsimd.LoadInt32x16Slice(x) + g := make([]uint64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt64x8ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt64x8ConvertToUint64(t *testing.T, f func(x archsimd.Int64x8) archsimd.Uint64x8, want func(x []int64) []uint64) { n := 8 t.Helper() forSlice(t, int64s, n, func(x []int64) bool { t.Helper() a := archsimd.LoadInt64x8Slice(x) - g := make([]uint64, n) + g := make([]uint64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint8x64ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint8x64ConvertToUint64(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Uint64x8, want func(x []uint8) []uint64) { + n := 64 + t.Helper() + forSlice(t, uint8s, n, func(x []uint8) bool { + t.Helper() + a := archsimd.LoadUint8x64Slice(x) + g := make([]uint64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint16x32ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint16x32ConvertToUint64(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Uint64x8, want func(x []uint16) []uint64) { + n := 32 + t.Helper() + forSlice(t, uint16s, n, func(x []uint16) bool { + t.Helper() + a := archsimd.LoadUint16x32Slice(x) + g := make([]uint64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint32x16ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint32x16ConvertToUint64(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Uint64x8, want func(x []uint32) []uint64) { + n := 16 + t.Helper() + forSlice(t, uint32s, n, func(x []uint32) bool { + t.Helper() + a := archsimd.LoadUint32x16Slice(x) + g := make([]uint64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint64x8ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint64x8ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint64x8ConvertToUint64(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Uint64x8, want func(x []uint64) []uint64) { n := 8 t.Helper() forSlice(t, uint64s, n, func(x []uint64) bool { t.Helper() a := archsimd.LoadUint64x8Slice(x) - g := make([]uint64, n) + g := make([]uint64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testFloat32x16ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat32x16ConvertToUint64(t *testing.T, f func(x archsimd.Float32x16) archsimd.Uint64x8, want func(x []float32) []uint64) { + n := 16 + t.Helper() + forSlice(t, float32s, n, func(x []float32) bool { + t.Helper() + a := archsimd.LoadFloat32x16Slice(x) + g := make([]uint64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat64x8ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat64x8ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat64x8ConvertToUint64(t *testing.T, f func(x archsimd.Float64x8) archsimd.Uint64x8, want func(x []float64) []uint64) { n := 8 t.Helper() forSlice(t, float64s, n, func(x []float64) bool { t.Helper() a := archsimd.LoadFloat64x8Slice(x) - g := make([]uint64, n) + g := make([]uint64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt8x16ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt8x16ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt8x16ConvertToFloat32(t *testing.T, f func(x archsimd.Int8x16) archsimd.Float32x16, want func(x []int8) []float32) { n := 16 t.Helper() forSlice(t, int8s, n, func(x []int8) bool { t.Helper() a := archsimd.LoadInt8x16Slice(x) - g := make([]float32, n) + g := make([]float32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt16x8ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt16x8ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt16x8ConvertToFloat32(t *testing.T, f func(x archsimd.Int16x8) archsimd.Float32x8, want func(x []int16) []float32) { n := 8 t.Helper() forSlice(t, int16s, n, func(x []int16) bool { t.Helper() a := archsimd.LoadInt16x8Slice(x) - g := make([]float32, n) + g := make([]float32, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt32x4ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt32x4ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt32x4ConvertToFloat32(t *testing.T, f func(x archsimd.Int32x4) archsimd.Float32x4, want func(x []int32) []float32) { n := 4 t.Helper() forSlice(t, int32s, n, func(x []int32) bool { t.Helper() a := archsimd.LoadInt32x4Slice(x) - g := make([]float32, n) + g := make([]float32, 4) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt64x2ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt64x2ConvertToFloat32(t *testing.T, f func(x archsimd.Int64x2) archsimd.Float32x4, want func(x []int64) []float32) { + n := 2 + t.Helper() + forSlice(t, int64s, n, func(x []int64) bool { + t.Helper() + a := archsimd.LoadInt64x2Slice(x) + g := make([]float32, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint8x16ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint8x16ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint8x16ConvertToFloat32(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Float32x16, want func(x []uint8) []float32) { n := 16 t.Helper() forSlice(t, uint8s, n, func(x []uint8) bool { t.Helper() a := archsimd.LoadUint8x16Slice(x) - g := make([]float32, n) + g := make([]float32, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint16x8ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint16x8ConvertToFloat32(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Float32x8, want func(x []uint16) []float32) { + n := 8 + t.Helper() + forSlice(t, uint16s, n, func(x []uint16) bool { + t.Helper() + a := archsimd.LoadUint16x8Slice(x) + g := make([]float32, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint32x4ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint32x4ConvertToFloat32(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Float32x4, want func(x []uint32) []float32) { + n := 4 + t.Helper() + forSlice(t, uint32s, n, func(x []uint32) bool { + t.Helper() + a := archsimd.LoadUint32x4Slice(x) + g := make([]float32, 4) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint64x2ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint64x2ConvertToFloat32(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Float32x4, want func(x []uint64) []float32) { + n := 2 + t.Helper() + forSlice(t, uint64s, n, func(x []uint64) bool { + t.Helper() + a := archsimd.LoadUint64x2Slice(x) + g := make([]float32, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint16x8ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. -func testUint16x8ConvertToFloat32(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Float32x8, want func(x []uint16) []float32) { - n := 8 +// testFloat32x4ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat32x4ConvertToFloat32(t *testing.T, f func(x archsimd.Float32x4) archsimd.Float32x4, want func(x []float32) []float32) { + n := 4 t.Helper() - forSlice(t, uint16s, n, func(x []uint16) bool { + forSlice(t, float32s, n, func(x []float32) bool { t.Helper() - a := archsimd.LoadUint16x8Slice(x) - g := make([]float32, n) + a := archsimd.LoadFloat32x4Slice(x) + g := make([]float32, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint32x4ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. -func testUint32x4ConvertToFloat32(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Float32x4, want func(x []uint32) []float32) { - n := 4 +// testFloat64x2ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat64x2ConvertToFloat32(t *testing.T, f func(x archsimd.Float64x2) archsimd.Float32x4, want func(x []float64) []float32) { + n := 2 t.Helper() - forSlice(t, uint32s, n, func(x []uint32) bool { + forSlice(t, float64s, n, func(x []float64) bool { t.Helper() - a := archsimd.LoadUint32x4Slice(x) - g := make([]float32, n) + a := archsimd.LoadFloat64x2Slice(x) + g := make([]float32, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat32x4ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. -func testFloat32x4ConvertToFloat32(t *testing.T, f func(x archsimd.Float32x4) archsimd.Float32x4, want func(x []float32) []float32) { - n := 4 +// testInt8x32ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt8x32ConvertToFloat32(t *testing.T, f func(x archsimd.Int8x32) archsimd.Float32x16, want func(x []int8) []float32) { + n := 32 t.Helper() - forSlice(t, float32s, n, func(x []float32) bool { + forSlice(t, int8s, n, func(x []int8) bool { t.Helper() - a := archsimd.LoadFloat32x4Slice(x) - g := make([]float32, n) + a := archsimd.LoadInt8x32Slice(x) + g := make([]float32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt16x16ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt16x16ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt16x16ConvertToFloat32(t *testing.T, f func(x archsimd.Int16x16) archsimd.Float32x16, want func(x []int16) []float32) { n := 16 t.Helper() forSlice(t, int16s, n, func(x []int16) bool { t.Helper() a := archsimd.LoadInt16x16Slice(x) - g := make([]float32, n) + g := make([]float32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt32x8ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt32x8ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt32x8ConvertToFloat32(t *testing.T, f func(x archsimd.Int32x8) archsimd.Float32x8, want func(x []int32) []float32) { n := 8 t.Helper() forSlice(t, int32s, n, func(x []int32) bool { t.Helper() a := archsimd.LoadInt32x8Slice(x) - g := make([]float32, n) + g := make([]float32, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt64x4ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt64x4ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt64x4ConvertToFloat32(t *testing.T, f func(x archsimd.Int64x4) archsimd.Float32x4, want func(x []int64) []float32) { n := 4 t.Helper() forSlice(t, int64s, n, func(x []int64) bool { t.Helper() a := archsimd.LoadInt64x4Slice(x) - g := make([]float32, n) + g := make([]float32, 4) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint8x32ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint8x32ConvertToFloat32(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Float32x16, want func(x []uint8) []float32) { + n := 32 + t.Helper() + forSlice(t, uint8s, n, func(x []uint8) bool { + t.Helper() + a := archsimd.LoadUint8x32Slice(x) + g := make([]float32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint16x16ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint16x16ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint16x16ConvertToFloat32(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Float32x16, want func(x []uint16) []float32) { n := 16 t.Helper() forSlice(t, uint16s, n, func(x []uint16) bool { t.Helper() a := archsimd.LoadUint16x16Slice(x) - g := make([]float32, n) + g := make([]float32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint32x8ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint32x8ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint32x8ConvertToFloat32(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Float32x8, want func(x []uint32) []float32) { n := 8 t.Helper() forSlice(t, uint32s, n, func(x []uint32) bool { t.Helper() a := archsimd.LoadUint32x8Slice(x) - g := make([]float32, n) + g := make([]float32, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint64x4ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint64x4ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint64x4ConvertToFloat32(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Float32x4, want func(x []uint64) []float32) { n := 4 t.Helper() forSlice(t, uint64s, n, func(x []uint64) bool { t.Helper() a := archsimd.LoadUint64x4Slice(x) - g := make([]float32, n) + g := make([]float32, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat32x8ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat32x8ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat32x8ConvertToFloat32(t *testing.T, f func(x archsimd.Float32x8) archsimd.Float32x8, want func(x []float32) []float32) { n := 8 t.Helper() forSlice(t, float32s, n, func(x []float32) bool { t.Helper() a := archsimd.LoadFloat32x8Slice(x) - g := make([]float32, n) + g := make([]float32, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat64x4ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat64x4ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat64x4ConvertToFloat32(t *testing.T, f func(x archsimd.Float64x4) archsimd.Float32x4, want func(x []float64) []float32) { n := 4 t.Helper() forSlice(t, float64s, n, func(x []float64) bool { t.Helper() a := archsimd.LoadFloat64x4Slice(x) - g := make([]float32, n) + g := make([]float32, 4) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt8x64ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt8x64ConvertToFloat32(t *testing.T, f func(x archsimd.Int8x64) archsimd.Float32x16, want func(x []int8) []float32) { + n := 64 + t.Helper() + forSlice(t, int8s, n, func(x []int8) bool { + t.Helper() + a := archsimd.LoadInt8x64Slice(x) + g := make([]float32, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt16x32ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt16x32ConvertToFloat32(t *testing.T, f func(x archsimd.Int16x32) archsimd.Float32x16, want func(x []int16) []float32) { + n := 32 + t.Helper() + forSlice(t, int16s, n, func(x []int16) bool { + t.Helper() + a := archsimd.LoadInt16x32Slice(x) + g := make([]float32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt32x16ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt32x16ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt32x16ConvertToFloat32(t *testing.T, f func(x archsimd.Int32x16) archsimd.Float32x16, want func(x []int32) []float32) { n := 16 t.Helper() forSlice(t, int32s, n, func(x []int32) bool { t.Helper() a := archsimd.LoadInt32x16Slice(x) - g := make([]float32, n) + g := make([]float32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt64x8ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt64x8ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt64x8ConvertToFloat32(t *testing.T, f func(x archsimd.Int64x8) archsimd.Float32x8, want func(x []int64) []float32) { n := 8 t.Helper() forSlice(t, int64s, n, func(x []int64) bool { t.Helper() a := archsimd.LoadInt64x8Slice(x) - g := make([]float32, n) + g := make([]float32, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint8x64ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint8x64ConvertToFloat32(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Float32x16, want func(x []uint8) []float32) { + n := 64 + t.Helper() + forSlice(t, uint8s, n, func(x []uint8) bool { + t.Helper() + a := archsimd.LoadUint8x64Slice(x) + g := make([]float32, 16) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint16x32ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint16x32ConvertToFloat32(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Float32x16, want func(x []uint16) []float32) { + n := 32 + t.Helper() + forSlice(t, uint16s, n, func(x []uint16) bool { + t.Helper() + a := archsimd.LoadUint16x32Slice(x) + g := make([]float32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint32x16ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint32x16ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint32x16ConvertToFloat32(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Float32x16, want func(x []uint32) []float32) { n := 16 t.Helper() forSlice(t, uint32s, n, func(x []uint32) bool { t.Helper() a := archsimd.LoadUint32x16Slice(x) - g := make([]float32, n) + g := make([]float32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint64x8ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint64x8ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint64x8ConvertToFloat32(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Float32x8, want func(x []uint64) []float32) { n := 8 t.Helper() forSlice(t, uint64s, n, func(x []uint64) bool { t.Helper() a := archsimd.LoadUint64x8Slice(x) - g := make([]float32, n) + g := make([]float32, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat32x16ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat32x16ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat32x16ConvertToFloat32(t *testing.T, f func(x archsimd.Float32x16) archsimd.Float32x16, want func(x []float32) []float32) { n := 16 t.Helper() forSlice(t, float32s, n, func(x []float32) bool { t.Helper() a := archsimd.LoadFloat32x16Slice(x) - g := make([]float32, n) + g := make([]float32, 16) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat64x8ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat64x8ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat64x8ConvertToFloat32(t *testing.T, f func(x archsimd.Float64x8) archsimd.Float32x8, want func(x []float64) []float32) { n := 8 t.Helper() forSlice(t, float64s, n, func(x []float64) bool { t.Helper() a := archsimd.LoadFloat64x8Slice(x) - g := make([]float32, n) + g := make([]float32, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt16x8ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt8x16ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt8x16ConvertToFloat64(t *testing.T, f func(x archsimd.Int8x16) archsimd.Float64x8, want func(x []int8) []float64) { + n := 16 + t.Helper() + forSlice(t, int8s, n, func(x []int8) bool { + t.Helper() + a := archsimd.LoadInt8x16Slice(x) + g := make([]float64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt16x8ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt16x8ConvertToFloat64(t *testing.T, f func(x archsimd.Int16x8) archsimd.Float64x8, want func(x []int16) []float64) { n := 8 t.Helper() forSlice(t, int16s, n, func(x []int16) bool { t.Helper() a := archsimd.LoadInt16x8Slice(x) - g := make([]float64, n) + g := make([]float64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt32x4ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt32x4ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt32x4ConvertToFloat64(t *testing.T, f func(x archsimd.Int32x4) archsimd.Float64x4, want func(x []int32) []float64) { n := 4 t.Helper() forSlice(t, int32s, n, func(x []int32) bool { t.Helper() a := archsimd.LoadInt32x4Slice(x) - g := make([]float64, n) + g := make([]float64, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt64x2ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt64x2ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt64x2ConvertToFloat64(t *testing.T, f func(x archsimd.Int64x2) archsimd.Float64x2, want func(x []int64) []float64) { n := 2 t.Helper() forSlice(t, int64s, n, func(x []int64) bool { t.Helper() a := archsimd.LoadInt64x2Slice(x) - g := make([]float64, n) + g := make([]float64, 2) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint8x16ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint8x16ConvertToFloat64(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Float64x8, want func(x []uint8) []float64) { + n := 16 + t.Helper() + forSlice(t, uint8s, n, func(x []uint8) bool { + t.Helper() + a := archsimd.LoadUint8x16Slice(x) + g := make([]float64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint16x8ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint16x8ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint16x8ConvertToFloat64(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Float64x8, want func(x []uint16) []float64) { n := 8 t.Helper() forSlice(t, uint16s, n, func(x []uint16) bool { t.Helper() a := archsimd.LoadUint16x8Slice(x) - g := make([]float64, n) + g := make([]float64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint32x4ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint32x4ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint32x4ConvertToFloat64(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Float64x4, want func(x []uint32) []float64) { n := 4 t.Helper() forSlice(t, uint32s, n, func(x []uint32) bool { t.Helper() a := archsimd.LoadUint32x4Slice(x) - g := make([]float64, n) + g := make([]float64, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint64x2ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint64x2ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint64x2ConvertToFloat64(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Float64x2, want func(x []uint64) []float64) { n := 2 t.Helper() forSlice(t, uint64s, n, func(x []uint64) bool { t.Helper() a := archsimd.LoadUint64x2Slice(x) - g := make([]float64, n) + g := make([]float64, 2) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat32x4ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat32x4ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat32x4ConvertToFloat64(t *testing.T, f func(x archsimd.Float32x4) archsimd.Float64x4, want func(x []float32) []float64) { n := 4 t.Helper() forSlice(t, float32s, n, func(x []float32) bool { t.Helper() a := archsimd.LoadFloat32x4Slice(x) - g := make([]float64, n) + g := make([]float64, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat64x2ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat64x2ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat64x2ConvertToFloat64(t *testing.T, f func(x archsimd.Float64x2) archsimd.Float64x2, want func(x []float64) []float64) { n := 2 t.Helper() forSlice(t, float64s, n, func(x []float64) bool { t.Helper() a := archsimd.LoadFloat64x2Slice(x) - g := make([]float64, n) + g := make([]float64, 2) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt8x32ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt8x32ConvertToFloat64(t *testing.T, f func(x archsimd.Int8x32) archsimd.Float64x8, want func(x []int8) []float64) { + n := 32 + t.Helper() + forSlice(t, int8s, n, func(x []int8) bool { + t.Helper() + a := archsimd.LoadInt8x32Slice(x) + g := make([]float64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt16x16ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt16x16ConvertToFloat64(t *testing.T, f func(x archsimd.Int16x16) archsimd.Float64x8, want func(x []int16) []float64) { + n := 16 + t.Helper() + forSlice(t, int16s, n, func(x []int16) bool { + t.Helper() + a := archsimd.LoadInt16x16Slice(x) + g := make([]float64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt32x8ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt32x8ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt32x8ConvertToFloat64(t *testing.T, f func(x archsimd.Int32x8) archsimd.Float64x8, want func(x []int32) []float64) { n := 8 t.Helper() forSlice(t, int32s, n, func(x []int32) bool { t.Helper() a := archsimd.LoadInt32x8Slice(x) - g := make([]float64, n) + g := make([]float64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt64x4ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt64x4ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt64x4ConvertToFloat64(t *testing.T, f func(x archsimd.Int64x4) archsimd.Float64x4, want func(x []int64) []float64) { n := 4 t.Helper() forSlice(t, int64s, n, func(x []int64) bool { t.Helper() a := archsimd.LoadInt64x4Slice(x) - g := make([]float64, n) + g := make([]float64, 4) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint8x32ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint8x32ConvertToFloat64(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Float64x8, want func(x []uint8) []float64) { + n := 32 + t.Helper() + forSlice(t, uint8s, n, func(x []uint8) bool { + t.Helper() + a := archsimd.LoadUint8x32Slice(x) + g := make([]float64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint16x16ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint16x16ConvertToFloat64(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Float64x8, want func(x []uint16) []float64) { + n := 16 + t.Helper() + forSlice(t, uint16s, n, func(x []uint16) bool { + t.Helper() + a := archsimd.LoadUint16x16Slice(x) + g := make([]float64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint32x8ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint32x8ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint32x8ConvertToFloat64(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Float64x8, want func(x []uint32) []float64) { n := 8 t.Helper() forSlice(t, uint32s, n, func(x []uint32) bool { t.Helper() a := archsimd.LoadUint32x8Slice(x) - g := make([]float64, n) + g := make([]float64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint64x4ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint64x4ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint64x4ConvertToFloat64(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Float64x4, want func(x []uint64) []float64) { n := 4 t.Helper() forSlice(t, uint64s, n, func(x []uint64) bool { t.Helper() a := archsimd.LoadUint64x4Slice(x) - g := make([]float64, n) + g := make([]float64, 4) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat32x8ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat32x8ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat32x8ConvertToFloat64(t *testing.T, f func(x archsimd.Float32x8) archsimd.Float64x8, want func(x []float32) []float64) { n := 8 t.Helper() forSlice(t, float32s, n, func(x []float32) bool { t.Helper() a := archsimd.LoadFloat32x8Slice(x) - g := make([]float64, n) + g := make([]float64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat64x4ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat64x4ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat64x4ConvertToFloat64(t *testing.T, f func(x archsimd.Float64x4) archsimd.Float64x4, want func(x []float64) []float64) { n := 4 t.Helper() forSlice(t, float64s, n, func(x []float64) bool { t.Helper() a := archsimd.LoadFloat64x4Slice(x) - g := make([]float64, n) + g := make([]float64, 4) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt8x64ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt8x64ConvertToFloat64(t *testing.T, f func(x archsimd.Int8x64) archsimd.Float64x8, want func(x []int8) []float64) { + n := 64 + t.Helper() + forSlice(t, int8s, n, func(x []int8) bool { + t.Helper() + a := archsimd.LoadInt8x64Slice(x) + g := make([]float64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt16x32ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt16x32ConvertToFloat64(t *testing.T, f func(x archsimd.Int16x32) archsimd.Float64x8, want func(x []int16) []float64) { + n := 32 + t.Helper() + forSlice(t, int16s, n, func(x []int16) bool { + t.Helper() + a := archsimd.LoadInt16x32Slice(x) + g := make([]float64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testInt32x16ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testInt32x16ConvertToFloat64(t *testing.T, f func(x archsimd.Int32x16) archsimd.Float64x8, want func(x []int32) []float64) { + n := 16 + t.Helper() + forSlice(t, int32s, n, func(x []int32) bool { + t.Helper() + a := archsimd.LoadInt32x16Slice(x) + g := make([]float64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testInt64x8ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testInt64x8ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testInt64x8ConvertToFloat64(t *testing.T, f func(x archsimd.Int64x8) archsimd.Float64x8, want func(x []int64) []float64) { n := 8 t.Helper() forSlice(t, int64s, n, func(x []int64) bool { t.Helper() a := archsimd.LoadInt64x8Slice(x) - g := make([]float64, n) + g := make([]float64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint8x64ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint8x64ConvertToFloat64(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Float64x8, want func(x []uint8) []float64) { + n := 64 + t.Helper() + forSlice(t, uint8s, n, func(x []uint8) bool { + t.Helper() + a := archsimd.LoadUint8x64Slice(x) + g := make([]float64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint16x32ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint16x32ConvertToFloat64(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Float64x8, want func(x []uint16) []float64) { + n := 32 + t.Helper() + forSlice(t, uint16s, n, func(x []uint16) bool { + t.Helper() + a := archsimd.LoadUint16x32Slice(x) + g := make([]float64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testUint32x16ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testUint32x16ConvertToFloat64(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Float64x8, want func(x []uint32) []float64) { + n := 16 + t.Helper() + forSlice(t, uint32s, n, func(x []uint32) bool { + t.Helper() + a := archsimd.LoadUint32x16Slice(x) + g := make([]float64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testUint64x8ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testUint64x8ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testUint64x8ConvertToFloat64(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Float64x8, want func(x []uint64) []float64) { n := 8 t.Helper() forSlice(t, uint64s, n, func(x []uint64) bool { t.Helper() a := archsimd.LoadUint64x8Slice(x) - g := make([]float64, n) + g := make([]float64, 8) + f(a).StoreSlice(g) + w := want(x) + return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) + }) +} + +// testFloat32x16ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). +func testFloat32x16ConvertToFloat64(t *testing.T, f func(x archsimd.Float32x16) archsimd.Float64x8, want func(x []float32) []float64) { + n := 16 + t.Helper() + forSlice(t, float32s, n, func(x []float32) bool { + t.Helper() + a := archsimd.LoadFloat32x16Slice(x) + g := make([]float64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) }) } -// testFloat64x8ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want -// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width. +// testFloat64x8ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want. +// This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width, +// (extended to at least 128 bits, or truncated to at most 512 bits). func testFloat64x8ConvertToFloat64(t *testing.T, f func(x archsimd.Float64x8) archsimd.Float64x8, want func(x []float64) []float64) { n := 8 t.Helper() forSlice(t, float64s, n, func(x []float64) bool { t.Helper() a := archsimd.LoadFloat64x8Slice(x) - g := make([]float64, n) + g := make([]float64, 8) f(a).StoreSlice(g) w := want(x) return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) }) diff --git a/src/simd/archsimd/internal/simd_test/unary_test.go b/src/simd/archsimd/internal/simd_test/unary_test.go index 088cab68fa..32b4626f6a 100644 --- a/src/simd/archsimd/internal/simd_test/unary_test.go +++ b/src/simd/archsimd/internal/simd_test/unary_test.go @@ -197,20 +197,42 @@ func TestExtend(t *testing.T) { func TestTruncate(t *testing.T) { if archsimd.X86.AVX512() { + testInt16x8ConvertToInt8(t, archsimd.Int16x8.TruncateToInt8, map1n[int16](toInt8, 16)) testInt16x16ConvertToInt8(t, archsimd.Int16x16.TruncateToInt8, map1[int16](toInt8)) testInt16x32ConvertToInt8(t, archsimd.Int16x32.TruncateToInt8, map1[int16](toInt8)) + testInt32x4ConvertToInt8(t, archsimd.Int32x4.TruncateToInt8, map1n[int32](toInt8, 16)) + testInt32x8ConvertToInt8(t, archsimd.Int32x8.TruncateToInt8, map1n[int32](toInt8, 16)) testInt32x16ConvertToInt8(t, archsimd.Int32x16.TruncateToInt8, map1[int32](toInt8)) + testInt64x2ConvertToInt8(t, archsimd.Int64x2.TruncateToInt8, map1n[int64](toInt8, 16)) + testInt64x4ConvertToInt8(t, archsimd.Int64x4.TruncateToInt8, map1n[int64](toInt8, 16)) + testInt64x8ConvertToInt8(t, archsimd.Int64x8.TruncateToInt8, map1n[int64](toInt8, 16)) + testInt32x4ConvertToInt16(t, archsimd.Int32x4.TruncateToInt16, map1n[int32](toInt16, 8)) testInt32x8ConvertToInt16(t, archsimd.Int32x8.TruncateToInt16, map1[int32](toInt16)) testInt32x16ConvertToInt16(t, archsimd.Int32x16.TruncateToInt16, map1[int32](toInt16)) + testInt64x2ConvertToInt16(t, archsimd.Int64x2.TruncateToInt16, map1n[int64](toInt16, 8)) + testInt64x4ConvertToInt16(t, archsimd.Int64x4.TruncateToInt16, map1n[int64](toInt16, 8)) testInt64x8ConvertToInt16(t, archsimd.Int64x8.TruncateToInt16, map1[int64](toInt16)) + testInt64x2ConvertToInt32(t, archsimd.Int64x2.TruncateToInt32, map1n[int64](toInt32, 4)) + testInt64x4ConvertToInt32(t, archsimd.Int64x4.TruncateToInt32, map1[int64](toInt32)) testInt64x8ConvertToInt32(t, archsimd.Int64x8.TruncateToInt32, map1[int64](toInt32)) + testUint16x8ConvertToUint8(t, archsimd.Uint16x8.TruncateToUint8, map1n[uint16](toUint8, 16)) testUint16x16ConvertToUint8(t, archsimd.Uint16x16.TruncateToUint8, map1[uint16](toUint8)) testUint16x32ConvertToUint8(t, archsimd.Uint16x32.TruncateToUint8, map1[uint16](toUint8)) + testUint32x4ConvertToUint8(t, archsimd.Uint32x4.TruncateToUint8, map1n[uint32](toUint8, 16)) + testUint32x8ConvertToUint8(t, archsimd.Uint32x8.TruncateToUint8, map1n[uint32](toUint8, 16)) testUint32x16ConvertToUint8(t, archsimd.Uint32x16.TruncateToUint8, map1[uint32](toUint8)) + testUint64x2ConvertToUint8(t, archsimd.Uint64x2.TruncateToUint8, map1n[uint64](toUint8, 16)) + testUint64x4ConvertToUint8(t, archsimd.Uint64x4.TruncateToUint8, map1n[uint64](toUint8, 16)) + testUint64x8ConvertToUint8(t, archsimd.Uint64x8.TruncateToUint8, map1n[uint64](toUint8, 16)) + testUint32x4ConvertToUint16(t, archsimd.Uint32x4.TruncateToUint16, map1n[uint32](toUint16, 8)) testUint32x8ConvertToUint16(t, archsimd.Uint32x8.TruncateToUint16, map1[uint32](toUint16)) testUint32x16ConvertToUint16(t, archsimd.Uint32x16.TruncateToUint16, map1[uint32](toUint16)) + testUint64x2ConvertToUint16(t, archsimd.Uint64x2.TruncateToUint16, map1n[uint64](toUint16, 8)) + testUint64x4ConvertToUint16(t, archsimd.Uint64x4.TruncateToUint16, map1n[uint64](toUint16, 8)) testUint64x8ConvertToUint16(t, archsimd.Uint64x8.TruncateToUint16, map1[uint64](toUint16)) + testUint64x2ConvertToUint32(t, archsimd.Uint64x2.TruncateToUint32, map1n[uint64](toUint32, 4)) + testUint64x4ConvertToUint32(t, archsimd.Uint64x4.TruncateToUint32, map1[uint64](toUint32)) testUint64x8ConvertToUint32(t, archsimd.Uint64x8.TruncateToUint32, map1[uint64](toUint32)) } }