| // Code generated by 'tmplgen'; DO NOT EDIT. | |
| //go:build goexperiment.simd && arm64 | |
| // This file contains functions testing shift simd methods. | |
| // Each function in this file is specialized for a | |
| // particular simd type <BaseType><Width>x<Count>. | |
| package simd_test | |
| import ( | |
| "simd/archsimd" | |
| "testing" | |
| ) | |
| // testUint8x16Shift tests a shift-like method where the first operand is Uint8x16 | |
| // and the second operand is Int8x16 (mixed-type shift). | |
| func testUint8x16Shift(t *testing.T, f func(_ archsimd.Uint8x16, _ archsimd.Int8x16) archsimd.Uint8x16, want func(_ []uint8, _ []int8) []uint8) { | |
| n := 16 | |
| t.Helper() | |
| forSliceMixed(t, uint8s, int8s, n, func(x []uint8, y []int8) bool { | |
| t.Helper() | |
| a := archsimd.LoadUint8x16(x) | |
| b := archsimd.LoadInt8x16(y) | |
| g := make([]uint8, n) | |
| f(a, b).Store(g) | |
| w := want(x, y) | |
| return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) }) | |
| }) | |
| } | |
| // testUint16x8Shift tests a shift-like method where the first operand is Uint16x8 | |
| // and the second operand is Int16x8 (mixed-type shift). | |
| func testUint16x8Shift(t *testing.T, f func(_ archsimd.Uint16x8, _ archsimd.Int16x8) archsimd.Uint16x8, want func(_ []uint16, _ []int16) []uint16) { | |
| n := 8 | |
| t.Helper() | |
| forSliceMixed(t, uint16s, int16s, n, func(x []uint16, y []int16) bool { | |
| t.Helper() | |
| a := archsimd.LoadUint16x8(x) | |
| b := archsimd.LoadInt16x8(y) | |
| g := make([]uint16, n) | |
| f(a, b).Store(g) | |
| w := want(x, y) | |
| return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) }) | |
| }) | |
| } | |
| // testUint32x4Shift tests a shift-like method where the first operand is Uint32x4 | |
| // and the second operand is Int32x4 (mixed-type shift). | |
| func testUint32x4Shift(t *testing.T, f func(_ archsimd.Uint32x4, _ archsimd.Int32x4) archsimd.Uint32x4, want func(_ []uint32, _ []int32) []uint32) { | |
| n := 4 | |
| t.Helper() | |
| forSliceMixed(t, uint32s, int32s, n, func(x []uint32, y []int32) bool { | |
| t.Helper() | |
| a := archsimd.LoadUint32x4(x) | |
| b := archsimd.LoadInt32x4(y) | |
| g := make([]uint32, n) | |
| f(a, b).Store(g) | |
| w := want(x, y) | |
| return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) }) | |
| }) | |
| } | |
| // testUint64x2Shift tests a shift-like method where the first operand is Uint64x2 | |
| // and the second operand is Int64x2 (mixed-type shift). | |
| func testUint64x2Shift(t *testing.T, f func(_ archsimd.Uint64x2, _ archsimd.Int64x2) archsimd.Uint64x2, want func(_ []uint64, _ []int64) []uint64) { | |
| n := 2 | |
| t.Helper() | |
| forSliceMixed(t, uint64s, int64s, n, func(x []uint64, y []int64) bool { | |
| t.Helper() | |
| a := archsimd.LoadUint64x2(x) | |
| b := archsimd.LoadInt64x2(y) | |
| g := make([]uint64, n) | |
| f(a, b).Store(g) | |
| w := want(x, y) | |
| return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) }) | |
| }) | |
| } |