Source file src/simd/internal/simd_test/compare_helpers_test.go

     1  // Code generated by 'go run genfiles.go'; DO NOT EDIT.
     2  
     3  //go:build goexperiment.simd
     4  
     5  // This file contains functions testing simd methods that compare two operands.
     6  // Each function in this file is specialized for a
     7  // particular simd type <BaseType><Width>x<Count>.
     8  
     9  package simd_test
    10  
    11  import (
    12  	"simd"
    13  	"testing"
    14  )
    15  
    16  // testInt8x16Compare tests the simd comparison method f against the expected behavior generated by want
    17  func testInt8x16Compare(t *testing.T, f func(_, _ simd.Int8x16) simd.Mask8x16, want func(_, _ []int8) []int64) {
    18  	n := 16
    19  	t.Helper()
    20  	forSlicePair(t, int8s, n, func(x, y []int8) bool {
    21  		t.Helper()
    22  		a := simd.LoadInt8x16Slice(x)
    23  		b := simd.LoadInt8x16Slice(y)
    24  		g := make([]int8, n)
    25  		f(a, b).AsInt8x16().StoreSlice(g)
    26  		w := want(x, y)
    27  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
    28  	})
    29  }
    30  
    31  // testInt16x8Compare tests the simd comparison method f against the expected behavior generated by want
    32  func testInt16x8Compare(t *testing.T, f func(_, _ simd.Int16x8) simd.Mask16x8, want func(_, _ []int16) []int64) {
    33  	n := 8
    34  	t.Helper()
    35  	forSlicePair(t, int16s, n, func(x, y []int16) bool {
    36  		t.Helper()
    37  		a := simd.LoadInt16x8Slice(x)
    38  		b := simd.LoadInt16x8Slice(y)
    39  		g := make([]int16, n)
    40  		f(a, b).AsInt16x8().StoreSlice(g)
    41  		w := want(x, y)
    42  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
    43  	})
    44  }
    45  
    46  // testInt32x4Compare tests the simd comparison method f against the expected behavior generated by want
    47  func testInt32x4Compare(t *testing.T, f func(_, _ simd.Int32x4) simd.Mask32x4, want func(_, _ []int32) []int64) {
    48  	n := 4
    49  	t.Helper()
    50  	forSlicePair(t, int32s, n, func(x, y []int32) bool {
    51  		t.Helper()
    52  		a := simd.LoadInt32x4Slice(x)
    53  		b := simd.LoadInt32x4Slice(y)
    54  		g := make([]int32, n)
    55  		f(a, b).AsInt32x4().StoreSlice(g)
    56  		w := want(x, y)
    57  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
    58  	})
    59  }
    60  
    61  // testInt64x2Compare tests the simd comparison method f against the expected behavior generated by want
    62  func testInt64x2Compare(t *testing.T, f func(_, _ simd.Int64x2) simd.Mask64x2, want func(_, _ []int64) []int64) {
    63  	n := 2
    64  	t.Helper()
    65  	forSlicePair(t, int64s, n, func(x, y []int64) bool {
    66  		t.Helper()
    67  		a := simd.LoadInt64x2Slice(x)
    68  		b := simd.LoadInt64x2Slice(y)
    69  		g := make([]int64, n)
    70  		f(a, b).AsInt64x2().StoreSlice(g)
    71  		w := want(x, y)
    72  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
    73  	})
    74  }
    75  
    76  // testUint8x16Compare tests the simd comparison method f against the expected behavior generated by want
    77  func testUint8x16Compare(t *testing.T, f func(_, _ simd.Uint8x16) simd.Mask8x16, want func(_, _ []uint8) []int64) {
    78  	n := 16
    79  	t.Helper()
    80  	forSlicePair(t, uint8s, n, func(x, y []uint8) bool {
    81  		t.Helper()
    82  		a := simd.LoadUint8x16Slice(x)
    83  		b := simd.LoadUint8x16Slice(y)
    84  		g := make([]int8, n)
    85  		f(a, b).AsInt8x16().StoreSlice(g)
    86  		w := want(x, y)
    87  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
    88  	})
    89  }
    90  
    91  // testUint16x8Compare tests the simd comparison method f against the expected behavior generated by want
    92  func testUint16x8Compare(t *testing.T, f func(_, _ simd.Uint16x8) simd.Mask16x8, want func(_, _ []uint16) []int64) {
    93  	n := 8
    94  	t.Helper()
    95  	forSlicePair(t, uint16s, n, func(x, y []uint16) bool {
    96  		t.Helper()
    97  		a := simd.LoadUint16x8Slice(x)
    98  		b := simd.LoadUint16x8Slice(y)
    99  		g := make([]int16, n)
   100  		f(a, b).AsInt16x8().StoreSlice(g)
   101  		w := want(x, y)
   102  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   103  	})
   104  }
   105  
   106  // testUint32x4Compare tests the simd comparison method f against the expected behavior generated by want
   107  func testUint32x4Compare(t *testing.T, f func(_, _ simd.Uint32x4) simd.Mask32x4, want func(_, _ []uint32) []int64) {
   108  	n := 4
   109  	t.Helper()
   110  	forSlicePair(t, uint32s, n, func(x, y []uint32) bool {
   111  		t.Helper()
   112  		a := simd.LoadUint32x4Slice(x)
   113  		b := simd.LoadUint32x4Slice(y)
   114  		g := make([]int32, n)
   115  		f(a, b).AsInt32x4().StoreSlice(g)
   116  		w := want(x, y)
   117  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   118  	})
   119  }
   120  
   121  // testUint64x2Compare tests the simd comparison method f against the expected behavior generated by want
   122  func testUint64x2Compare(t *testing.T, f func(_, _ simd.Uint64x2) simd.Mask64x2, want func(_, _ []uint64) []int64) {
   123  	n := 2
   124  	t.Helper()
   125  	forSlicePair(t, uint64s, n, func(x, y []uint64) bool {
   126  		t.Helper()
   127  		a := simd.LoadUint64x2Slice(x)
   128  		b := simd.LoadUint64x2Slice(y)
   129  		g := make([]int64, n)
   130  		f(a, b).AsInt64x2().StoreSlice(g)
   131  		w := want(x, y)
   132  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   133  	})
   134  }
   135  
   136  // testFloat32x4Compare tests the simd comparison method f against the expected behavior generated by want
   137  func testFloat32x4Compare(t *testing.T, f func(_, _ simd.Float32x4) simd.Mask32x4, want func(_, _ []float32) []int64) {
   138  	n := 4
   139  	t.Helper()
   140  	forSlicePair(t, float32s, n, func(x, y []float32) bool {
   141  		t.Helper()
   142  		a := simd.LoadFloat32x4Slice(x)
   143  		b := simd.LoadFloat32x4Slice(y)
   144  		g := make([]int32, n)
   145  		f(a, b).AsInt32x4().StoreSlice(g)
   146  		w := want(x, y)
   147  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   148  	})
   149  }
   150  
   151  // testFloat64x2Compare tests the simd comparison method f against the expected behavior generated by want
   152  func testFloat64x2Compare(t *testing.T, f func(_, _ simd.Float64x2) simd.Mask64x2, want func(_, _ []float64) []int64) {
   153  	n := 2
   154  	t.Helper()
   155  	forSlicePair(t, float64s, n, func(x, y []float64) bool {
   156  		t.Helper()
   157  		a := simd.LoadFloat64x2Slice(x)
   158  		b := simd.LoadFloat64x2Slice(y)
   159  		g := make([]int64, n)
   160  		f(a, b).AsInt64x2().StoreSlice(g)
   161  		w := want(x, y)
   162  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   163  	})
   164  }
   165  
   166  // testInt8x32Compare tests the simd comparison method f against the expected behavior generated by want
   167  func testInt8x32Compare(t *testing.T, f func(_, _ simd.Int8x32) simd.Mask8x32, want func(_, _ []int8) []int64) {
   168  	n := 32
   169  	t.Helper()
   170  	forSlicePair(t, int8s, n, func(x, y []int8) bool {
   171  		t.Helper()
   172  		a := simd.LoadInt8x32Slice(x)
   173  		b := simd.LoadInt8x32Slice(y)
   174  		g := make([]int8, n)
   175  		f(a, b).AsInt8x32().StoreSlice(g)
   176  		w := want(x, y)
   177  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   178  	})
   179  }
   180  
   181  // testInt16x16Compare tests the simd comparison method f against the expected behavior generated by want
   182  func testInt16x16Compare(t *testing.T, f func(_, _ simd.Int16x16) simd.Mask16x16, want func(_, _ []int16) []int64) {
   183  	n := 16
   184  	t.Helper()
   185  	forSlicePair(t, int16s, n, func(x, y []int16) bool {
   186  		t.Helper()
   187  		a := simd.LoadInt16x16Slice(x)
   188  		b := simd.LoadInt16x16Slice(y)
   189  		g := make([]int16, n)
   190  		f(a, b).AsInt16x16().StoreSlice(g)
   191  		w := want(x, y)
   192  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   193  	})
   194  }
   195  
   196  // testInt32x8Compare tests the simd comparison method f against the expected behavior generated by want
   197  func testInt32x8Compare(t *testing.T, f func(_, _ simd.Int32x8) simd.Mask32x8, want func(_, _ []int32) []int64) {
   198  	n := 8
   199  	t.Helper()
   200  	forSlicePair(t, int32s, n, func(x, y []int32) bool {
   201  		t.Helper()
   202  		a := simd.LoadInt32x8Slice(x)
   203  		b := simd.LoadInt32x8Slice(y)
   204  		g := make([]int32, n)
   205  		f(a, b).AsInt32x8().StoreSlice(g)
   206  		w := want(x, y)
   207  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   208  	})
   209  }
   210  
   211  // testInt64x4Compare tests the simd comparison method f against the expected behavior generated by want
   212  func testInt64x4Compare(t *testing.T, f func(_, _ simd.Int64x4) simd.Mask64x4, want func(_, _ []int64) []int64) {
   213  	n := 4
   214  	t.Helper()
   215  	forSlicePair(t, int64s, n, func(x, y []int64) bool {
   216  		t.Helper()
   217  		a := simd.LoadInt64x4Slice(x)
   218  		b := simd.LoadInt64x4Slice(y)
   219  		g := make([]int64, n)
   220  		f(a, b).AsInt64x4().StoreSlice(g)
   221  		w := want(x, y)
   222  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   223  	})
   224  }
   225  
   226  // testUint8x32Compare tests the simd comparison method f against the expected behavior generated by want
   227  func testUint8x32Compare(t *testing.T, f func(_, _ simd.Uint8x32) simd.Mask8x32, want func(_, _ []uint8) []int64) {
   228  	n := 32
   229  	t.Helper()
   230  	forSlicePair(t, uint8s, n, func(x, y []uint8) bool {
   231  		t.Helper()
   232  		a := simd.LoadUint8x32Slice(x)
   233  		b := simd.LoadUint8x32Slice(y)
   234  		g := make([]int8, n)
   235  		f(a, b).AsInt8x32().StoreSlice(g)
   236  		w := want(x, y)
   237  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   238  	})
   239  }
   240  
   241  // testUint16x16Compare tests the simd comparison method f against the expected behavior generated by want
   242  func testUint16x16Compare(t *testing.T, f func(_, _ simd.Uint16x16) simd.Mask16x16, want func(_, _ []uint16) []int64) {
   243  	n := 16
   244  	t.Helper()
   245  	forSlicePair(t, uint16s, n, func(x, y []uint16) bool {
   246  		t.Helper()
   247  		a := simd.LoadUint16x16Slice(x)
   248  		b := simd.LoadUint16x16Slice(y)
   249  		g := make([]int16, n)
   250  		f(a, b).AsInt16x16().StoreSlice(g)
   251  		w := want(x, y)
   252  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   253  	})
   254  }
   255  
   256  // testUint32x8Compare tests the simd comparison method f against the expected behavior generated by want
   257  func testUint32x8Compare(t *testing.T, f func(_, _ simd.Uint32x8) simd.Mask32x8, want func(_, _ []uint32) []int64) {
   258  	n := 8
   259  	t.Helper()
   260  	forSlicePair(t, uint32s, n, func(x, y []uint32) bool {
   261  		t.Helper()
   262  		a := simd.LoadUint32x8Slice(x)
   263  		b := simd.LoadUint32x8Slice(y)
   264  		g := make([]int32, n)
   265  		f(a, b).AsInt32x8().StoreSlice(g)
   266  		w := want(x, y)
   267  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   268  	})
   269  }
   270  
   271  // testUint64x4Compare tests the simd comparison method f against the expected behavior generated by want
   272  func testUint64x4Compare(t *testing.T, f func(_, _ simd.Uint64x4) simd.Mask64x4, want func(_, _ []uint64) []int64) {
   273  	n := 4
   274  	t.Helper()
   275  	forSlicePair(t, uint64s, n, func(x, y []uint64) bool {
   276  		t.Helper()
   277  		a := simd.LoadUint64x4Slice(x)
   278  		b := simd.LoadUint64x4Slice(y)
   279  		g := make([]int64, n)
   280  		f(a, b).AsInt64x4().StoreSlice(g)
   281  		w := want(x, y)
   282  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   283  	})
   284  }
   285  
   286  // testFloat32x8Compare tests the simd comparison method f against the expected behavior generated by want
   287  func testFloat32x8Compare(t *testing.T, f func(_, _ simd.Float32x8) simd.Mask32x8, want func(_, _ []float32) []int64) {
   288  	n := 8
   289  	t.Helper()
   290  	forSlicePair(t, float32s, n, func(x, y []float32) bool {
   291  		t.Helper()
   292  		a := simd.LoadFloat32x8Slice(x)
   293  		b := simd.LoadFloat32x8Slice(y)
   294  		g := make([]int32, n)
   295  		f(a, b).AsInt32x8().StoreSlice(g)
   296  		w := want(x, y)
   297  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   298  	})
   299  }
   300  
   301  // testFloat64x4Compare tests the simd comparison method f against the expected behavior generated by want
   302  func testFloat64x4Compare(t *testing.T, f func(_, _ simd.Float64x4) simd.Mask64x4, want func(_, _ []float64) []int64) {
   303  	n := 4
   304  	t.Helper()
   305  	forSlicePair(t, float64s, n, func(x, y []float64) bool {
   306  		t.Helper()
   307  		a := simd.LoadFloat64x4Slice(x)
   308  		b := simd.LoadFloat64x4Slice(y)
   309  		g := make([]int64, n)
   310  		f(a, b).AsInt64x4().StoreSlice(g)
   311  		w := want(x, y)
   312  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   313  	})
   314  }
   315  
   316  // testInt8x64Compare tests the simd comparison method f against the expected behavior generated by want
   317  func testInt8x64Compare(t *testing.T, f func(_, _ simd.Int8x64) simd.Mask8x64, want func(_, _ []int8) []int64) {
   318  	n := 64
   319  	t.Helper()
   320  	forSlicePair(t, int8s, n, func(x, y []int8) bool {
   321  		t.Helper()
   322  		a := simd.LoadInt8x64Slice(x)
   323  		b := simd.LoadInt8x64Slice(y)
   324  		g := make([]int8, n)
   325  		f(a, b).AsInt8x64().StoreSlice(g)
   326  		w := want(x, y)
   327  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   328  	})
   329  }
   330  
   331  // testInt16x32Compare tests the simd comparison method f against the expected behavior generated by want
   332  func testInt16x32Compare(t *testing.T, f func(_, _ simd.Int16x32) simd.Mask16x32, want func(_, _ []int16) []int64) {
   333  	n := 32
   334  	t.Helper()
   335  	forSlicePair(t, int16s, n, func(x, y []int16) bool {
   336  		t.Helper()
   337  		a := simd.LoadInt16x32Slice(x)
   338  		b := simd.LoadInt16x32Slice(y)
   339  		g := make([]int16, n)
   340  		f(a, b).AsInt16x32().StoreSlice(g)
   341  		w := want(x, y)
   342  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   343  	})
   344  }
   345  
   346  // testInt32x16Compare tests the simd comparison method f against the expected behavior generated by want
   347  func testInt32x16Compare(t *testing.T, f func(_, _ simd.Int32x16) simd.Mask32x16, want func(_, _ []int32) []int64) {
   348  	n := 16
   349  	t.Helper()
   350  	forSlicePair(t, int32s, n, func(x, y []int32) bool {
   351  		t.Helper()
   352  		a := simd.LoadInt32x16Slice(x)
   353  		b := simd.LoadInt32x16Slice(y)
   354  		g := make([]int32, n)
   355  		f(a, b).AsInt32x16().StoreSlice(g)
   356  		w := want(x, y)
   357  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   358  	})
   359  }
   360  
   361  // testInt64x8Compare tests the simd comparison method f against the expected behavior generated by want
   362  func testInt64x8Compare(t *testing.T, f func(_, _ simd.Int64x8) simd.Mask64x8, want func(_, _ []int64) []int64) {
   363  	n := 8
   364  	t.Helper()
   365  	forSlicePair(t, int64s, n, func(x, y []int64) bool {
   366  		t.Helper()
   367  		a := simd.LoadInt64x8Slice(x)
   368  		b := simd.LoadInt64x8Slice(y)
   369  		g := make([]int64, n)
   370  		f(a, b).AsInt64x8().StoreSlice(g)
   371  		w := want(x, y)
   372  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   373  	})
   374  }
   375  
   376  // testUint8x64Compare tests the simd comparison method f against the expected behavior generated by want
   377  func testUint8x64Compare(t *testing.T, f func(_, _ simd.Uint8x64) simd.Mask8x64, want func(_, _ []uint8) []int64) {
   378  	n := 64
   379  	t.Helper()
   380  	forSlicePair(t, uint8s, n, func(x, y []uint8) bool {
   381  		t.Helper()
   382  		a := simd.LoadUint8x64Slice(x)
   383  		b := simd.LoadUint8x64Slice(y)
   384  		g := make([]int8, n)
   385  		f(a, b).AsInt8x64().StoreSlice(g)
   386  		w := want(x, y)
   387  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   388  	})
   389  }
   390  
   391  // testUint16x32Compare tests the simd comparison method f against the expected behavior generated by want
   392  func testUint16x32Compare(t *testing.T, f func(_, _ simd.Uint16x32) simd.Mask16x32, want func(_, _ []uint16) []int64) {
   393  	n := 32
   394  	t.Helper()
   395  	forSlicePair(t, uint16s, n, func(x, y []uint16) bool {
   396  		t.Helper()
   397  		a := simd.LoadUint16x32Slice(x)
   398  		b := simd.LoadUint16x32Slice(y)
   399  		g := make([]int16, n)
   400  		f(a, b).AsInt16x32().StoreSlice(g)
   401  		w := want(x, y)
   402  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   403  	})
   404  }
   405  
   406  // testUint32x16Compare tests the simd comparison method f against the expected behavior generated by want
   407  func testUint32x16Compare(t *testing.T, f func(_, _ simd.Uint32x16) simd.Mask32x16, want func(_, _ []uint32) []int64) {
   408  	n := 16
   409  	t.Helper()
   410  	forSlicePair(t, uint32s, n, func(x, y []uint32) bool {
   411  		t.Helper()
   412  		a := simd.LoadUint32x16Slice(x)
   413  		b := simd.LoadUint32x16Slice(y)
   414  		g := make([]int32, n)
   415  		f(a, b).AsInt32x16().StoreSlice(g)
   416  		w := want(x, y)
   417  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   418  	})
   419  }
   420  
   421  // testUint64x8Compare tests the simd comparison method f against the expected behavior generated by want
   422  func testUint64x8Compare(t *testing.T, f func(_, _ simd.Uint64x8) simd.Mask64x8, want func(_, _ []uint64) []int64) {
   423  	n := 8
   424  	t.Helper()
   425  	forSlicePair(t, uint64s, n, func(x, y []uint64) bool {
   426  		t.Helper()
   427  		a := simd.LoadUint64x8Slice(x)
   428  		b := simd.LoadUint64x8Slice(y)
   429  		g := make([]int64, n)
   430  		f(a, b).AsInt64x8().StoreSlice(g)
   431  		w := want(x, y)
   432  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   433  	})
   434  }
   435  
   436  // testFloat32x16Compare tests the simd comparison method f against the expected behavior generated by want
   437  func testFloat32x16Compare(t *testing.T, f func(_, _ simd.Float32x16) simd.Mask32x16, want func(_, _ []float32) []int64) {
   438  	n := 16
   439  	t.Helper()
   440  	forSlicePair(t, float32s, n, func(x, y []float32) bool {
   441  		t.Helper()
   442  		a := simd.LoadFloat32x16Slice(x)
   443  		b := simd.LoadFloat32x16Slice(y)
   444  		g := make([]int32, n)
   445  		f(a, b).AsInt32x16().StoreSlice(g)
   446  		w := want(x, y)
   447  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   448  	})
   449  }
   450  
   451  // testFloat64x8Compare tests the simd comparison method f against the expected behavior generated by want
   452  func testFloat64x8Compare(t *testing.T, f func(_, _ simd.Float64x8) simd.Mask64x8, want func(_, _ []float64) []int64) {
   453  	n := 8
   454  	t.Helper()
   455  	forSlicePair(t, float64s, n, func(x, y []float64) bool {
   456  		t.Helper()
   457  		a := simd.LoadFloat64x8Slice(x)
   458  		b := simd.LoadFloat64x8Slice(y)
   459  		g := make([]int64, n)
   460  		f(a, b).AsInt64x8().StoreSlice(g)
   461  		w := want(x, y)
   462  		return checkSlicesLogInput(t, s64(g), w, 0.0, func() { t.Helper(); t.Logf("x=%v", x); t.Logf("y=%v", y) })
   463  	})
   464  }
   465  

View as plain text