Source file src/simd/internal/simd_test/unary_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 unary simd methods.
     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  // testInt8x16Unary tests the simd unary method f against the expected behavior generated by want
    17  func testInt8x16Unary(t *testing.T, f func(_ simd.Int8x16) simd.Int8x16, want func(_ []int8) []int8) {
    18  	n := 16
    19  	t.Helper()
    20  	forSlice(t, int8s, n, func(x []int8) bool {
    21  		t.Helper()
    22  		a := simd.LoadInt8x16Slice(x)
    23  		g := make([]int8, n)
    24  		f(a).StoreSlice(g)
    25  		w := want(x)
    26  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
    27  	})
    28  }
    29  
    30  // testInt16x8Unary tests the simd unary method f against the expected behavior generated by want
    31  func testInt16x8Unary(t *testing.T, f func(_ simd.Int16x8) simd.Int16x8, want func(_ []int16) []int16) {
    32  	n := 8
    33  	t.Helper()
    34  	forSlice(t, int16s, n, func(x []int16) bool {
    35  		t.Helper()
    36  		a := simd.LoadInt16x8Slice(x)
    37  		g := make([]int16, n)
    38  		f(a).StoreSlice(g)
    39  		w := want(x)
    40  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
    41  	})
    42  }
    43  
    44  // testInt32x4Unary tests the simd unary method f against the expected behavior generated by want
    45  func testInt32x4Unary(t *testing.T, f func(_ simd.Int32x4) simd.Int32x4, want func(_ []int32) []int32) {
    46  	n := 4
    47  	t.Helper()
    48  	forSlice(t, int32s, n, func(x []int32) bool {
    49  		t.Helper()
    50  		a := simd.LoadInt32x4Slice(x)
    51  		g := make([]int32, n)
    52  		f(a).StoreSlice(g)
    53  		w := want(x)
    54  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
    55  	})
    56  }
    57  
    58  // testInt64x2Unary tests the simd unary method f against the expected behavior generated by want
    59  func testInt64x2Unary(t *testing.T, f func(_ simd.Int64x2) simd.Int64x2, want func(_ []int64) []int64) {
    60  	n := 2
    61  	t.Helper()
    62  	forSlice(t, int64s, n, func(x []int64) bool {
    63  		t.Helper()
    64  		a := simd.LoadInt64x2Slice(x)
    65  		g := make([]int64, n)
    66  		f(a).StoreSlice(g)
    67  		w := want(x)
    68  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
    69  	})
    70  }
    71  
    72  // testUint8x16Unary tests the simd unary method f against the expected behavior generated by want
    73  func testUint8x16Unary(t *testing.T, f func(_ simd.Uint8x16) simd.Uint8x16, want func(_ []uint8) []uint8) {
    74  	n := 16
    75  	t.Helper()
    76  	forSlice(t, uint8s, n, func(x []uint8) bool {
    77  		t.Helper()
    78  		a := simd.LoadUint8x16Slice(x)
    79  		g := make([]uint8, n)
    80  		f(a).StoreSlice(g)
    81  		w := want(x)
    82  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
    83  	})
    84  }
    85  
    86  // testUint16x8Unary tests the simd unary method f against the expected behavior generated by want
    87  func testUint16x8Unary(t *testing.T, f func(_ simd.Uint16x8) simd.Uint16x8, want func(_ []uint16) []uint16) {
    88  	n := 8
    89  	t.Helper()
    90  	forSlice(t, uint16s, n, func(x []uint16) bool {
    91  		t.Helper()
    92  		a := simd.LoadUint16x8Slice(x)
    93  		g := make([]uint16, n)
    94  		f(a).StoreSlice(g)
    95  		w := want(x)
    96  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
    97  	})
    98  }
    99  
   100  // testUint32x4Unary tests the simd unary method f against the expected behavior generated by want
   101  func testUint32x4Unary(t *testing.T, f func(_ simd.Uint32x4) simd.Uint32x4, want func(_ []uint32) []uint32) {
   102  	n := 4
   103  	t.Helper()
   104  	forSlice(t, uint32s, n, func(x []uint32) bool {
   105  		t.Helper()
   106  		a := simd.LoadUint32x4Slice(x)
   107  		g := make([]uint32, n)
   108  		f(a).StoreSlice(g)
   109  		w := want(x)
   110  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   111  	})
   112  }
   113  
   114  // testUint64x2Unary tests the simd unary method f against the expected behavior generated by want
   115  func testUint64x2Unary(t *testing.T, f func(_ simd.Uint64x2) simd.Uint64x2, want func(_ []uint64) []uint64) {
   116  	n := 2
   117  	t.Helper()
   118  	forSlice(t, uint64s, n, func(x []uint64) bool {
   119  		t.Helper()
   120  		a := simd.LoadUint64x2Slice(x)
   121  		g := make([]uint64, n)
   122  		f(a).StoreSlice(g)
   123  		w := want(x)
   124  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   125  	})
   126  }
   127  
   128  // testFloat32x4Unary tests the simd unary method f against the expected behavior generated by want
   129  func testFloat32x4Unary(t *testing.T, f func(_ simd.Float32x4) simd.Float32x4, want func(_ []float32) []float32) {
   130  	n := 4
   131  	t.Helper()
   132  	forSlice(t, float32s, n, func(x []float32) bool {
   133  		t.Helper()
   134  		a := simd.LoadFloat32x4Slice(x)
   135  		g := make([]float32, n)
   136  		f(a).StoreSlice(g)
   137  		w := want(x)
   138  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   139  	})
   140  }
   141  
   142  // testFloat64x2Unary tests the simd unary method f against the expected behavior generated by want
   143  func testFloat64x2Unary(t *testing.T, f func(_ simd.Float64x2) simd.Float64x2, want func(_ []float64) []float64) {
   144  	n := 2
   145  	t.Helper()
   146  	forSlice(t, float64s, n, func(x []float64) bool {
   147  		t.Helper()
   148  		a := simd.LoadFloat64x2Slice(x)
   149  		g := make([]float64, n)
   150  		f(a).StoreSlice(g)
   151  		w := want(x)
   152  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   153  	})
   154  }
   155  
   156  // testInt8x32Unary tests the simd unary method f against the expected behavior generated by want
   157  func testInt8x32Unary(t *testing.T, f func(_ simd.Int8x32) simd.Int8x32, want func(_ []int8) []int8) {
   158  	n := 32
   159  	t.Helper()
   160  	forSlice(t, int8s, n, func(x []int8) bool {
   161  		t.Helper()
   162  		a := simd.LoadInt8x32Slice(x)
   163  		g := make([]int8, n)
   164  		f(a).StoreSlice(g)
   165  		w := want(x)
   166  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   167  	})
   168  }
   169  
   170  // testInt16x16Unary tests the simd unary method f against the expected behavior generated by want
   171  func testInt16x16Unary(t *testing.T, f func(_ simd.Int16x16) simd.Int16x16, want func(_ []int16) []int16) {
   172  	n := 16
   173  	t.Helper()
   174  	forSlice(t, int16s, n, func(x []int16) bool {
   175  		t.Helper()
   176  		a := simd.LoadInt16x16Slice(x)
   177  		g := make([]int16, n)
   178  		f(a).StoreSlice(g)
   179  		w := want(x)
   180  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   181  	})
   182  }
   183  
   184  // testInt32x8Unary tests the simd unary method f against the expected behavior generated by want
   185  func testInt32x8Unary(t *testing.T, f func(_ simd.Int32x8) simd.Int32x8, want func(_ []int32) []int32) {
   186  	n := 8
   187  	t.Helper()
   188  	forSlice(t, int32s, n, func(x []int32) bool {
   189  		t.Helper()
   190  		a := simd.LoadInt32x8Slice(x)
   191  		g := make([]int32, n)
   192  		f(a).StoreSlice(g)
   193  		w := want(x)
   194  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   195  	})
   196  }
   197  
   198  // testInt64x4Unary tests the simd unary method f against the expected behavior generated by want
   199  func testInt64x4Unary(t *testing.T, f func(_ simd.Int64x4) simd.Int64x4, want func(_ []int64) []int64) {
   200  	n := 4
   201  	t.Helper()
   202  	forSlice(t, int64s, n, func(x []int64) bool {
   203  		t.Helper()
   204  		a := simd.LoadInt64x4Slice(x)
   205  		g := make([]int64, n)
   206  		f(a).StoreSlice(g)
   207  		w := want(x)
   208  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   209  	})
   210  }
   211  
   212  // testUint8x32Unary tests the simd unary method f against the expected behavior generated by want
   213  func testUint8x32Unary(t *testing.T, f func(_ simd.Uint8x32) simd.Uint8x32, want func(_ []uint8) []uint8) {
   214  	n := 32
   215  	t.Helper()
   216  	forSlice(t, uint8s, n, func(x []uint8) bool {
   217  		t.Helper()
   218  		a := simd.LoadUint8x32Slice(x)
   219  		g := make([]uint8, n)
   220  		f(a).StoreSlice(g)
   221  		w := want(x)
   222  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   223  	})
   224  }
   225  
   226  // testUint16x16Unary tests the simd unary method f against the expected behavior generated by want
   227  func testUint16x16Unary(t *testing.T, f func(_ simd.Uint16x16) simd.Uint16x16, want func(_ []uint16) []uint16) {
   228  	n := 16
   229  	t.Helper()
   230  	forSlice(t, uint16s, n, func(x []uint16) bool {
   231  		t.Helper()
   232  		a := simd.LoadUint16x16Slice(x)
   233  		g := make([]uint16, n)
   234  		f(a).StoreSlice(g)
   235  		w := want(x)
   236  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   237  	})
   238  }
   239  
   240  // testUint32x8Unary tests the simd unary method f against the expected behavior generated by want
   241  func testUint32x8Unary(t *testing.T, f func(_ simd.Uint32x8) simd.Uint32x8, want func(_ []uint32) []uint32) {
   242  	n := 8
   243  	t.Helper()
   244  	forSlice(t, uint32s, n, func(x []uint32) bool {
   245  		t.Helper()
   246  		a := simd.LoadUint32x8Slice(x)
   247  		g := make([]uint32, n)
   248  		f(a).StoreSlice(g)
   249  		w := want(x)
   250  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   251  	})
   252  }
   253  
   254  // testUint64x4Unary tests the simd unary method f against the expected behavior generated by want
   255  func testUint64x4Unary(t *testing.T, f func(_ simd.Uint64x4) simd.Uint64x4, want func(_ []uint64) []uint64) {
   256  	n := 4
   257  	t.Helper()
   258  	forSlice(t, uint64s, n, func(x []uint64) bool {
   259  		t.Helper()
   260  		a := simd.LoadUint64x4Slice(x)
   261  		g := make([]uint64, n)
   262  		f(a).StoreSlice(g)
   263  		w := want(x)
   264  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   265  	})
   266  }
   267  
   268  // testFloat32x8Unary tests the simd unary method f against the expected behavior generated by want
   269  func testFloat32x8Unary(t *testing.T, f func(_ simd.Float32x8) simd.Float32x8, want func(_ []float32) []float32) {
   270  	n := 8
   271  	t.Helper()
   272  	forSlice(t, float32s, n, func(x []float32) bool {
   273  		t.Helper()
   274  		a := simd.LoadFloat32x8Slice(x)
   275  		g := make([]float32, n)
   276  		f(a).StoreSlice(g)
   277  		w := want(x)
   278  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   279  	})
   280  }
   281  
   282  // testFloat64x4Unary tests the simd unary method f against the expected behavior generated by want
   283  func testFloat64x4Unary(t *testing.T, f func(_ simd.Float64x4) simd.Float64x4, want func(_ []float64) []float64) {
   284  	n := 4
   285  	t.Helper()
   286  	forSlice(t, float64s, n, func(x []float64) bool {
   287  		t.Helper()
   288  		a := simd.LoadFloat64x4Slice(x)
   289  		g := make([]float64, n)
   290  		f(a).StoreSlice(g)
   291  		w := want(x)
   292  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   293  	})
   294  }
   295  
   296  // testInt8x64Unary tests the simd unary method f against the expected behavior generated by want
   297  func testInt8x64Unary(t *testing.T, f func(_ simd.Int8x64) simd.Int8x64, want func(_ []int8) []int8) {
   298  	n := 64
   299  	t.Helper()
   300  	forSlice(t, int8s, n, func(x []int8) bool {
   301  		t.Helper()
   302  		a := simd.LoadInt8x64Slice(x)
   303  		g := make([]int8, n)
   304  		f(a).StoreSlice(g)
   305  		w := want(x)
   306  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   307  	})
   308  }
   309  
   310  // testInt16x32Unary tests the simd unary method f against the expected behavior generated by want
   311  func testInt16x32Unary(t *testing.T, f func(_ simd.Int16x32) simd.Int16x32, want func(_ []int16) []int16) {
   312  	n := 32
   313  	t.Helper()
   314  	forSlice(t, int16s, n, func(x []int16) bool {
   315  		t.Helper()
   316  		a := simd.LoadInt16x32Slice(x)
   317  		g := make([]int16, n)
   318  		f(a).StoreSlice(g)
   319  		w := want(x)
   320  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   321  	})
   322  }
   323  
   324  // testInt32x16Unary tests the simd unary method f against the expected behavior generated by want
   325  func testInt32x16Unary(t *testing.T, f func(_ simd.Int32x16) simd.Int32x16, want func(_ []int32) []int32) {
   326  	n := 16
   327  	t.Helper()
   328  	forSlice(t, int32s, n, func(x []int32) bool {
   329  		t.Helper()
   330  		a := simd.LoadInt32x16Slice(x)
   331  		g := make([]int32, n)
   332  		f(a).StoreSlice(g)
   333  		w := want(x)
   334  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   335  	})
   336  }
   337  
   338  // testInt64x8Unary tests the simd unary method f against the expected behavior generated by want
   339  func testInt64x8Unary(t *testing.T, f func(_ simd.Int64x8) simd.Int64x8, want func(_ []int64) []int64) {
   340  	n := 8
   341  	t.Helper()
   342  	forSlice(t, int64s, n, func(x []int64) bool {
   343  		t.Helper()
   344  		a := simd.LoadInt64x8Slice(x)
   345  		g := make([]int64, n)
   346  		f(a).StoreSlice(g)
   347  		w := want(x)
   348  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   349  	})
   350  }
   351  
   352  // testUint8x64Unary tests the simd unary method f against the expected behavior generated by want
   353  func testUint8x64Unary(t *testing.T, f func(_ simd.Uint8x64) simd.Uint8x64, want func(_ []uint8) []uint8) {
   354  	n := 64
   355  	t.Helper()
   356  	forSlice(t, uint8s, n, func(x []uint8) bool {
   357  		t.Helper()
   358  		a := simd.LoadUint8x64Slice(x)
   359  		g := make([]uint8, n)
   360  		f(a).StoreSlice(g)
   361  		w := want(x)
   362  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   363  	})
   364  }
   365  
   366  // testUint16x32Unary tests the simd unary method f against the expected behavior generated by want
   367  func testUint16x32Unary(t *testing.T, f func(_ simd.Uint16x32) simd.Uint16x32, want func(_ []uint16) []uint16) {
   368  	n := 32
   369  	t.Helper()
   370  	forSlice(t, uint16s, n, func(x []uint16) bool {
   371  		t.Helper()
   372  		a := simd.LoadUint16x32Slice(x)
   373  		g := make([]uint16, n)
   374  		f(a).StoreSlice(g)
   375  		w := want(x)
   376  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   377  	})
   378  }
   379  
   380  // testUint32x16Unary tests the simd unary method f against the expected behavior generated by want
   381  func testUint32x16Unary(t *testing.T, f func(_ simd.Uint32x16) simd.Uint32x16, want func(_ []uint32) []uint32) {
   382  	n := 16
   383  	t.Helper()
   384  	forSlice(t, uint32s, n, func(x []uint32) bool {
   385  		t.Helper()
   386  		a := simd.LoadUint32x16Slice(x)
   387  		g := make([]uint32, n)
   388  		f(a).StoreSlice(g)
   389  		w := want(x)
   390  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   391  	})
   392  }
   393  
   394  // testUint64x8Unary tests the simd unary method f against the expected behavior generated by want
   395  func testUint64x8Unary(t *testing.T, f func(_ simd.Uint64x8) simd.Uint64x8, want func(_ []uint64) []uint64) {
   396  	n := 8
   397  	t.Helper()
   398  	forSlice(t, uint64s, n, func(x []uint64) bool {
   399  		t.Helper()
   400  		a := simd.LoadUint64x8Slice(x)
   401  		g := make([]uint64, n)
   402  		f(a).StoreSlice(g)
   403  		w := want(x)
   404  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   405  	})
   406  }
   407  
   408  // testFloat32x16Unary tests the simd unary method f against the expected behavior generated by want
   409  func testFloat32x16Unary(t *testing.T, f func(_ simd.Float32x16) simd.Float32x16, want func(_ []float32) []float32) {
   410  	n := 16
   411  	t.Helper()
   412  	forSlice(t, float32s, n, func(x []float32) bool {
   413  		t.Helper()
   414  		a := simd.LoadFloat32x16Slice(x)
   415  		g := make([]float32, n)
   416  		f(a).StoreSlice(g)
   417  		w := want(x)
   418  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   419  	})
   420  }
   421  
   422  // testFloat64x8Unary tests the simd unary method f against the expected behavior generated by want
   423  func testFloat64x8Unary(t *testing.T, f func(_ simd.Float64x8) simd.Float64x8, want func(_ []float64) []float64) {
   424  	n := 8
   425  	t.Helper()
   426  	forSlice(t, float64s, n, func(x []float64) bool {
   427  		t.Helper()
   428  		a := simd.LoadFloat64x8Slice(x)
   429  		g := make([]float64, n)
   430  		f(a).StoreSlice(g)
   431  		w := want(x)
   432  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   433  	})
   434  }
   435  
   436  // testInt8x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want
   437  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   438  func testInt8x16ConvertToInt32(t *testing.T, f func(x simd.Int8x16) simd.Int32x16, want func(x []int8) []int32) {
   439  	n := 16
   440  	t.Helper()
   441  	forSlice(t, int8s, n, func(x []int8) bool {
   442  		t.Helper()
   443  		a := simd.LoadInt8x16Slice(x)
   444  		g := make([]int32, n)
   445  		f(a).StoreSlice(g)
   446  		w := want(x)
   447  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   448  	})
   449  }
   450  
   451  // testInt16x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want
   452  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   453  func testInt16x8ConvertToInt32(t *testing.T, f func(x simd.Int16x8) simd.Int32x8, want func(x []int16) []int32) {
   454  	n := 8
   455  	t.Helper()
   456  	forSlice(t, int16s, n, func(x []int16) bool {
   457  		t.Helper()
   458  		a := simd.LoadInt16x8Slice(x)
   459  		g := make([]int32, n)
   460  		f(a).StoreSlice(g)
   461  		w := want(x)
   462  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   463  	})
   464  }
   465  
   466  // testInt32x4ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want
   467  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   468  func testInt32x4ConvertToInt32(t *testing.T, f func(x simd.Int32x4) simd.Int32x4, want func(x []int32) []int32) {
   469  	n := 4
   470  	t.Helper()
   471  	forSlice(t, int32s, n, func(x []int32) bool {
   472  		t.Helper()
   473  		a := simd.LoadInt32x4Slice(x)
   474  		g := make([]int32, n)
   475  		f(a).StoreSlice(g)
   476  		w := want(x)
   477  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   478  	})
   479  }
   480  
   481  // testUint8x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want
   482  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   483  func testUint8x16ConvertToInt32(t *testing.T, f func(x simd.Uint8x16) simd.Int32x16, want func(x []uint8) []int32) {
   484  	n := 16
   485  	t.Helper()
   486  	forSlice(t, uint8s, n, func(x []uint8) bool {
   487  		t.Helper()
   488  		a := simd.LoadUint8x16Slice(x)
   489  		g := make([]int32, n)
   490  		f(a).StoreSlice(g)
   491  		w := want(x)
   492  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   493  	})
   494  }
   495  
   496  // testUint16x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want
   497  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   498  func testUint16x8ConvertToInt32(t *testing.T, f func(x simd.Uint16x8) simd.Int32x8, want func(x []uint16) []int32) {
   499  	n := 8
   500  	t.Helper()
   501  	forSlice(t, uint16s, n, func(x []uint16) bool {
   502  		t.Helper()
   503  		a := simd.LoadUint16x8Slice(x)
   504  		g := make([]int32, n)
   505  		f(a).StoreSlice(g)
   506  		w := want(x)
   507  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   508  	})
   509  }
   510  
   511  // testUint32x4ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want
   512  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   513  func testUint32x4ConvertToInt32(t *testing.T, f func(x simd.Uint32x4) simd.Int32x4, want func(x []uint32) []int32) {
   514  	n := 4
   515  	t.Helper()
   516  	forSlice(t, uint32s, n, func(x []uint32) bool {
   517  		t.Helper()
   518  		a := simd.LoadUint32x4Slice(x)
   519  		g := make([]int32, n)
   520  		f(a).StoreSlice(g)
   521  		w := want(x)
   522  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   523  	})
   524  }
   525  
   526  // testFloat32x4ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want
   527  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   528  func testFloat32x4ConvertToInt32(t *testing.T, f func(x simd.Float32x4) simd.Int32x4, want func(x []float32) []int32) {
   529  	n := 4
   530  	t.Helper()
   531  	forSlice(t, float32s, n, func(x []float32) bool {
   532  		t.Helper()
   533  		a := simd.LoadFloat32x4Slice(x)
   534  		g := make([]int32, n)
   535  		f(a).StoreSlice(g)
   536  		w := want(x)
   537  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   538  	})
   539  }
   540  
   541  // testInt16x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want
   542  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   543  func testInt16x16ConvertToInt32(t *testing.T, f func(x simd.Int16x16) simd.Int32x16, want func(x []int16) []int32) {
   544  	n := 16
   545  	t.Helper()
   546  	forSlice(t, int16s, n, func(x []int16) bool {
   547  		t.Helper()
   548  		a := simd.LoadInt16x16Slice(x)
   549  		g := make([]int32, n)
   550  		f(a).StoreSlice(g)
   551  		w := want(x)
   552  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   553  	})
   554  }
   555  
   556  // testInt32x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want
   557  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   558  func testInt32x8ConvertToInt32(t *testing.T, f func(x simd.Int32x8) simd.Int32x8, want func(x []int32) []int32) {
   559  	n := 8
   560  	t.Helper()
   561  	forSlice(t, int32s, n, func(x []int32) bool {
   562  		t.Helper()
   563  		a := simd.LoadInt32x8Slice(x)
   564  		g := make([]int32, n)
   565  		f(a).StoreSlice(g)
   566  		w := want(x)
   567  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   568  	})
   569  }
   570  
   571  // testInt64x4ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want
   572  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   573  func testInt64x4ConvertToInt32(t *testing.T, f func(x simd.Int64x4) simd.Int32x4, want func(x []int64) []int32) {
   574  	n := 4
   575  	t.Helper()
   576  	forSlice(t, int64s, n, func(x []int64) bool {
   577  		t.Helper()
   578  		a := simd.LoadInt64x4Slice(x)
   579  		g := make([]int32, n)
   580  		f(a).StoreSlice(g)
   581  		w := want(x)
   582  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   583  	})
   584  }
   585  
   586  // testUint16x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want
   587  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   588  func testUint16x16ConvertToInt32(t *testing.T, f func(x simd.Uint16x16) simd.Int32x16, want func(x []uint16) []int32) {
   589  	n := 16
   590  	t.Helper()
   591  	forSlice(t, uint16s, n, func(x []uint16) bool {
   592  		t.Helper()
   593  		a := simd.LoadUint16x16Slice(x)
   594  		g := make([]int32, n)
   595  		f(a).StoreSlice(g)
   596  		w := want(x)
   597  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   598  	})
   599  }
   600  
   601  // testUint32x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want
   602  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   603  func testUint32x8ConvertToInt32(t *testing.T, f func(x simd.Uint32x8) simd.Int32x8, want func(x []uint32) []int32) {
   604  	n := 8
   605  	t.Helper()
   606  	forSlice(t, uint32s, n, func(x []uint32) bool {
   607  		t.Helper()
   608  		a := simd.LoadUint32x8Slice(x)
   609  		g := make([]int32, n)
   610  		f(a).StoreSlice(g)
   611  		w := want(x)
   612  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   613  	})
   614  }
   615  
   616  // testUint64x4ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want
   617  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   618  func testUint64x4ConvertToInt32(t *testing.T, f func(x simd.Uint64x4) simd.Int32x4, want func(x []uint64) []int32) {
   619  	n := 4
   620  	t.Helper()
   621  	forSlice(t, uint64s, n, func(x []uint64) bool {
   622  		t.Helper()
   623  		a := simd.LoadUint64x4Slice(x)
   624  		g := make([]int32, n)
   625  		f(a).StoreSlice(g)
   626  		w := want(x)
   627  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   628  	})
   629  }
   630  
   631  // testFloat32x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want
   632  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   633  func testFloat32x8ConvertToInt32(t *testing.T, f func(x simd.Float32x8) simd.Int32x8, want func(x []float32) []int32) {
   634  	n := 8
   635  	t.Helper()
   636  	forSlice(t, float32s, n, func(x []float32) bool {
   637  		t.Helper()
   638  		a := simd.LoadFloat32x8Slice(x)
   639  		g := make([]int32, n)
   640  		f(a).StoreSlice(g)
   641  		w := want(x)
   642  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   643  	})
   644  }
   645  
   646  // testFloat64x4ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want
   647  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   648  func testFloat64x4ConvertToInt32(t *testing.T, f func(x simd.Float64x4) simd.Int32x4, want func(x []float64) []int32) {
   649  	n := 4
   650  	t.Helper()
   651  	forSlice(t, float64s, n, func(x []float64) bool {
   652  		t.Helper()
   653  		a := simd.LoadFloat64x4Slice(x)
   654  		g := make([]int32, n)
   655  		f(a).StoreSlice(g)
   656  		w := want(x)
   657  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   658  	})
   659  }
   660  
   661  // testInt32x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want
   662  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   663  func testInt32x16ConvertToInt32(t *testing.T, f func(x simd.Int32x16) simd.Int32x16, want func(x []int32) []int32) {
   664  	n := 16
   665  	t.Helper()
   666  	forSlice(t, int32s, n, func(x []int32) bool {
   667  		t.Helper()
   668  		a := simd.LoadInt32x16Slice(x)
   669  		g := make([]int32, n)
   670  		f(a).StoreSlice(g)
   671  		w := want(x)
   672  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   673  	})
   674  }
   675  
   676  // testInt64x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want
   677  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   678  func testInt64x8ConvertToInt32(t *testing.T, f func(x simd.Int64x8) simd.Int32x8, want func(x []int64) []int32) {
   679  	n := 8
   680  	t.Helper()
   681  	forSlice(t, int64s, n, func(x []int64) bool {
   682  		t.Helper()
   683  		a := simd.LoadInt64x8Slice(x)
   684  		g := make([]int32, n)
   685  		f(a).StoreSlice(g)
   686  		w := want(x)
   687  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   688  	})
   689  }
   690  
   691  // testUint32x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want
   692  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   693  func testUint32x16ConvertToInt32(t *testing.T, f func(x simd.Uint32x16) simd.Int32x16, want func(x []uint32) []int32) {
   694  	n := 16
   695  	t.Helper()
   696  	forSlice(t, uint32s, n, func(x []uint32) bool {
   697  		t.Helper()
   698  		a := simd.LoadUint32x16Slice(x)
   699  		g := make([]int32, n)
   700  		f(a).StoreSlice(g)
   701  		w := want(x)
   702  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   703  	})
   704  }
   705  
   706  // testUint64x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want
   707  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   708  func testUint64x8ConvertToInt32(t *testing.T, f func(x simd.Uint64x8) simd.Int32x8, want func(x []uint64) []int32) {
   709  	n := 8
   710  	t.Helper()
   711  	forSlice(t, uint64s, n, func(x []uint64) bool {
   712  		t.Helper()
   713  		a := simd.LoadUint64x8Slice(x)
   714  		g := make([]int32, n)
   715  		f(a).StoreSlice(g)
   716  		w := want(x)
   717  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   718  	})
   719  }
   720  
   721  // testFloat32x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want
   722  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   723  func testFloat32x16ConvertToInt32(t *testing.T, f func(x simd.Float32x16) simd.Int32x16, want func(x []float32) []int32) {
   724  	n := 16
   725  	t.Helper()
   726  	forSlice(t, float32s, n, func(x []float32) bool {
   727  		t.Helper()
   728  		a := simd.LoadFloat32x16Slice(x)
   729  		g := make([]int32, n)
   730  		f(a).StoreSlice(g)
   731  		w := want(x)
   732  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   733  	})
   734  }
   735  
   736  // testFloat64x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want
   737  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   738  func testFloat64x8ConvertToInt32(t *testing.T, f func(x simd.Float64x8) simd.Int32x8, want func(x []float64) []int32) {
   739  	n := 8
   740  	t.Helper()
   741  	forSlice(t, float64s, n, func(x []float64) bool {
   742  		t.Helper()
   743  		a := simd.LoadFloat64x8Slice(x)
   744  		g := make([]int32, n)
   745  		f(a).StoreSlice(g)
   746  		w := want(x)
   747  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   748  	})
   749  }
   750  
   751  // testInt8x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want
   752  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   753  func testInt8x16ConvertToUint32(t *testing.T, f func(x simd.Int8x16) simd.Uint32x16, want func(x []int8) []uint32) {
   754  	n := 16
   755  	t.Helper()
   756  	forSlice(t, int8s, n, func(x []int8) bool {
   757  		t.Helper()
   758  		a := simd.LoadInt8x16Slice(x)
   759  		g := make([]uint32, n)
   760  		f(a).StoreSlice(g)
   761  		w := want(x)
   762  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   763  	})
   764  }
   765  
   766  // testInt16x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want
   767  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   768  func testInt16x8ConvertToUint32(t *testing.T, f func(x simd.Int16x8) simd.Uint32x8, want func(x []int16) []uint32) {
   769  	n := 8
   770  	t.Helper()
   771  	forSlice(t, int16s, n, func(x []int16) bool {
   772  		t.Helper()
   773  		a := simd.LoadInt16x8Slice(x)
   774  		g := make([]uint32, n)
   775  		f(a).StoreSlice(g)
   776  		w := want(x)
   777  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   778  	})
   779  }
   780  
   781  // testInt32x4ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want
   782  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   783  func testInt32x4ConvertToUint32(t *testing.T, f func(x simd.Int32x4) simd.Uint32x4, want func(x []int32) []uint32) {
   784  	n := 4
   785  	t.Helper()
   786  	forSlice(t, int32s, n, func(x []int32) bool {
   787  		t.Helper()
   788  		a := simd.LoadInt32x4Slice(x)
   789  		g := make([]uint32, n)
   790  		f(a).StoreSlice(g)
   791  		w := want(x)
   792  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   793  	})
   794  }
   795  
   796  // testUint8x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want
   797  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   798  func testUint8x16ConvertToUint32(t *testing.T, f func(x simd.Uint8x16) simd.Uint32x16, want func(x []uint8) []uint32) {
   799  	n := 16
   800  	t.Helper()
   801  	forSlice(t, uint8s, n, func(x []uint8) bool {
   802  		t.Helper()
   803  		a := simd.LoadUint8x16Slice(x)
   804  		g := make([]uint32, n)
   805  		f(a).StoreSlice(g)
   806  		w := want(x)
   807  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   808  	})
   809  }
   810  
   811  // testUint16x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want
   812  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   813  func testUint16x8ConvertToUint32(t *testing.T, f func(x simd.Uint16x8) simd.Uint32x8, want func(x []uint16) []uint32) {
   814  	n := 8
   815  	t.Helper()
   816  	forSlice(t, uint16s, n, func(x []uint16) bool {
   817  		t.Helper()
   818  		a := simd.LoadUint16x8Slice(x)
   819  		g := make([]uint32, n)
   820  		f(a).StoreSlice(g)
   821  		w := want(x)
   822  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   823  	})
   824  }
   825  
   826  // testUint32x4ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want
   827  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   828  func testUint32x4ConvertToUint32(t *testing.T, f func(x simd.Uint32x4) simd.Uint32x4, want func(x []uint32) []uint32) {
   829  	n := 4
   830  	t.Helper()
   831  	forSlice(t, uint32s, n, func(x []uint32) bool {
   832  		t.Helper()
   833  		a := simd.LoadUint32x4Slice(x)
   834  		g := make([]uint32, n)
   835  		f(a).StoreSlice(g)
   836  		w := want(x)
   837  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   838  	})
   839  }
   840  
   841  // testFloat32x4ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want
   842  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   843  func testFloat32x4ConvertToUint32(t *testing.T, f func(x simd.Float32x4) simd.Uint32x4, want func(x []float32) []uint32) {
   844  	n := 4
   845  	t.Helper()
   846  	forSlice(t, float32s, n, func(x []float32) bool {
   847  		t.Helper()
   848  		a := simd.LoadFloat32x4Slice(x)
   849  		g := make([]uint32, n)
   850  		f(a).StoreSlice(g)
   851  		w := want(x)
   852  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   853  	})
   854  }
   855  
   856  // testInt16x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want
   857  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   858  func testInt16x16ConvertToUint32(t *testing.T, f func(x simd.Int16x16) simd.Uint32x16, want func(x []int16) []uint32) {
   859  	n := 16
   860  	t.Helper()
   861  	forSlice(t, int16s, n, func(x []int16) bool {
   862  		t.Helper()
   863  		a := simd.LoadInt16x16Slice(x)
   864  		g := make([]uint32, n)
   865  		f(a).StoreSlice(g)
   866  		w := want(x)
   867  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   868  	})
   869  }
   870  
   871  // testInt32x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want
   872  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   873  func testInt32x8ConvertToUint32(t *testing.T, f func(x simd.Int32x8) simd.Uint32x8, want func(x []int32) []uint32) {
   874  	n := 8
   875  	t.Helper()
   876  	forSlice(t, int32s, n, func(x []int32) bool {
   877  		t.Helper()
   878  		a := simd.LoadInt32x8Slice(x)
   879  		g := make([]uint32, n)
   880  		f(a).StoreSlice(g)
   881  		w := want(x)
   882  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   883  	})
   884  }
   885  
   886  // testInt64x4ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want
   887  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   888  func testInt64x4ConvertToUint32(t *testing.T, f func(x simd.Int64x4) simd.Uint32x4, want func(x []int64) []uint32) {
   889  	n := 4
   890  	t.Helper()
   891  	forSlice(t, int64s, n, func(x []int64) bool {
   892  		t.Helper()
   893  		a := simd.LoadInt64x4Slice(x)
   894  		g := make([]uint32, n)
   895  		f(a).StoreSlice(g)
   896  		w := want(x)
   897  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   898  	})
   899  }
   900  
   901  // testUint16x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want
   902  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   903  func testUint16x16ConvertToUint32(t *testing.T, f func(x simd.Uint16x16) simd.Uint32x16, want func(x []uint16) []uint32) {
   904  	n := 16
   905  	t.Helper()
   906  	forSlice(t, uint16s, n, func(x []uint16) bool {
   907  		t.Helper()
   908  		a := simd.LoadUint16x16Slice(x)
   909  		g := make([]uint32, n)
   910  		f(a).StoreSlice(g)
   911  		w := want(x)
   912  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   913  	})
   914  }
   915  
   916  // testUint32x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want
   917  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   918  func testUint32x8ConvertToUint32(t *testing.T, f func(x simd.Uint32x8) simd.Uint32x8, want func(x []uint32) []uint32) {
   919  	n := 8
   920  	t.Helper()
   921  	forSlice(t, uint32s, n, func(x []uint32) bool {
   922  		t.Helper()
   923  		a := simd.LoadUint32x8Slice(x)
   924  		g := make([]uint32, n)
   925  		f(a).StoreSlice(g)
   926  		w := want(x)
   927  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   928  	})
   929  }
   930  
   931  // testUint64x4ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want
   932  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   933  func testUint64x4ConvertToUint32(t *testing.T, f func(x simd.Uint64x4) simd.Uint32x4, want func(x []uint64) []uint32) {
   934  	n := 4
   935  	t.Helper()
   936  	forSlice(t, uint64s, n, func(x []uint64) bool {
   937  		t.Helper()
   938  		a := simd.LoadUint64x4Slice(x)
   939  		g := make([]uint32, n)
   940  		f(a).StoreSlice(g)
   941  		w := want(x)
   942  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   943  	})
   944  }
   945  
   946  // testFloat32x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want
   947  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   948  func testFloat32x8ConvertToUint32(t *testing.T, f func(x simd.Float32x8) simd.Uint32x8, want func(x []float32) []uint32) {
   949  	n := 8
   950  	t.Helper()
   951  	forSlice(t, float32s, n, func(x []float32) bool {
   952  		t.Helper()
   953  		a := simd.LoadFloat32x8Slice(x)
   954  		g := make([]uint32, n)
   955  		f(a).StoreSlice(g)
   956  		w := want(x)
   957  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   958  	})
   959  }
   960  
   961  // testFloat64x4ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want
   962  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   963  func testFloat64x4ConvertToUint32(t *testing.T, f func(x simd.Float64x4) simd.Uint32x4, want func(x []float64) []uint32) {
   964  	n := 4
   965  	t.Helper()
   966  	forSlice(t, float64s, n, func(x []float64) bool {
   967  		t.Helper()
   968  		a := simd.LoadFloat64x4Slice(x)
   969  		g := make([]uint32, n)
   970  		f(a).StoreSlice(g)
   971  		w := want(x)
   972  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   973  	})
   974  }
   975  
   976  // testInt32x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want
   977  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   978  func testInt32x16ConvertToUint32(t *testing.T, f func(x simd.Int32x16) simd.Uint32x16, want func(x []int32) []uint32) {
   979  	n := 16
   980  	t.Helper()
   981  	forSlice(t, int32s, n, func(x []int32) bool {
   982  		t.Helper()
   983  		a := simd.LoadInt32x16Slice(x)
   984  		g := make([]uint32, n)
   985  		f(a).StoreSlice(g)
   986  		w := want(x)
   987  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   988  	})
   989  }
   990  
   991  // testInt64x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want
   992  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
   993  func testInt64x8ConvertToUint32(t *testing.T, f func(x simd.Int64x8) simd.Uint32x8, want func(x []int64) []uint32) {
   994  	n := 8
   995  	t.Helper()
   996  	forSlice(t, int64s, n, func(x []int64) bool {
   997  		t.Helper()
   998  		a := simd.LoadInt64x8Slice(x)
   999  		g := make([]uint32, n)
  1000  		f(a).StoreSlice(g)
  1001  		w := want(x)
  1002  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1003  	})
  1004  }
  1005  
  1006  // testUint32x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want
  1007  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
  1008  func testUint32x16ConvertToUint32(t *testing.T, f func(x simd.Uint32x16) simd.Uint32x16, want func(x []uint32) []uint32) {
  1009  	n := 16
  1010  	t.Helper()
  1011  	forSlice(t, uint32s, n, func(x []uint32) bool {
  1012  		t.Helper()
  1013  		a := simd.LoadUint32x16Slice(x)
  1014  		g := make([]uint32, n)
  1015  		f(a).StoreSlice(g)
  1016  		w := want(x)
  1017  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1018  	})
  1019  }
  1020  
  1021  // testUint64x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want
  1022  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
  1023  func testUint64x8ConvertToUint32(t *testing.T, f func(x simd.Uint64x8) simd.Uint32x8, want func(x []uint64) []uint32) {
  1024  	n := 8
  1025  	t.Helper()
  1026  	forSlice(t, uint64s, n, func(x []uint64) bool {
  1027  		t.Helper()
  1028  		a := simd.LoadUint64x8Slice(x)
  1029  		g := make([]uint32, n)
  1030  		f(a).StoreSlice(g)
  1031  		w := want(x)
  1032  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1033  	})
  1034  }
  1035  
  1036  // testFloat32x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want
  1037  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
  1038  func testFloat32x16ConvertToUint32(t *testing.T, f func(x simd.Float32x16) simd.Uint32x16, want func(x []float32) []uint32) {
  1039  	n := 16
  1040  	t.Helper()
  1041  	forSlice(t, float32s, n, func(x []float32) bool {
  1042  		t.Helper()
  1043  		a := simd.LoadFloat32x16Slice(x)
  1044  		g := make([]uint32, n)
  1045  		f(a).StoreSlice(g)
  1046  		w := want(x)
  1047  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1048  	})
  1049  }
  1050  
  1051  // testFloat64x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want
  1052  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
  1053  func testFloat64x8ConvertToUint32(t *testing.T, f func(x simd.Float64x8) simd.Uint32x8, want func(x []float64) []uint32) {
  1054  	n := 8
  1055  	t.Helper()
  1056  	forSlice(t, float64s, n, func(x []float64) bool {
  1057  		t.Helper()
  1058  		a := simd.LoadFloat64x8Slice(x)
  1059  		g := make([]uint32, n)
  1060  		f(a).StoreSlice(g)
  1061  		w := want(x)
  1062  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1063  	})
  1064  }
  1065  
  1066  // testInt8x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want
  1067  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
  1068  func testInt8x16ConvertToUint16(t *testing.T, f func(x simd.Int8x16) simd.Uint16x16, want func(x []int8) []uint16) {
  1069  	n := 16
  1070  	t.Helper()
  1071  	forSlice(t, int8s, n, func(x []int8) bool {
  1072  		t.Helper()
  1073  		a := simd.LoadInt8x16Slice(x)
  1074  		g := make([]uint16, n)
  1075  		f(a).StoreSlice(g)
  1076  		w := want(x)
  1077  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1078  	})
  1079  }
  1080  
  1081  // testInt16x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want
  1082  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
  1083  func testInt16x8ConvertToUint16(t *testing.T, f func(x simd.Int16x8) simd.Uint16x8, want func(x []int16) []uint16) {
  1084  	n := 8
  1085  	t.Helper()
  1086  	forSlice(t, int16s, n, func(x []int16) bool {
  1087  		t.Helper()
  1088  		a := simd.LoadInt16x8Slice(x)
  1089  		g := make([]uint16, n)
  1090  		f(a).StoreSlice(g)
  1091  		w := want(x)
  1092  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1093  	})
  1094  }
  1095  
  1096  // testUint8x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want
  1097  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
  1098  func testUint8x16ConvertToUint16(t *testing.T, f func(x simd.Uint8x16) simd.Uint16x16, want func(x []uint8) []uint16) {
  1099  	n := 16
  1100  	t.Helper()
  1101  	forSlice(t, uint8s, n, func(x []uint8) bool {
  1102  		t.Helper()
  1103  		a := simd.LoadUint8x16Slice(x)
  1104  		g := make([]uint16, n)
  1105  		f(a).StoreSlice(g)
  1106  		w := want(x)
  1107  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1108  	})
  1109  }
  1110  
  1111  // testUint16x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want
  1112  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
  1113  func testUint16x8ConvertToUint16(t *testing.T, f func(x simd.Uint16x8) simd.Uint16x8, want func(x []uint16) []uint16) {
  1114  	n := 8
  1115  	t.Helper()
  1116  	forSlice(t, uint16s, n, func(x []uint16) bool {
  1117  		t.Helper()
  1118  		a := simd.LoadUint16x8Slice(x)
  1119  		g := make([]uint16, n)
  1120  		f(a).StoreSlice(g)
  1121  		w := want(x)
  1122  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1123  	})
  1124  }
  1125  
  1126  // testInt8x32ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want
  1127  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
  1128  func testInt8x32ConvertToUint16(t *testing.T, f func(x simd.Int8x32) simd.Uint16x32, want func(x []int8) []uint16) {
  1129  	n := 32
  1130  	t.Helper()
  1131  	forSlice(t, int8s, n, func(x []int8) bool {
  1132  		t.Helper()
  1133  		a := simd.LoadInt8x32Slice(x)
  1134  		g := make([]uint16, n)
  1135  		f(a).StoreSlice(g)
  1136  		w := want(x)
  1137  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1138  	})
  1139  }
  1140  
  1141  // testInt16x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want
  1142  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
  1143  func testInt16x16ConvertToUint16(t *testing.T, f func(x simd.Int16x16) simd.Uint16x16, want func(x []int16) []uint16) {
  1144  	n := 16
  1145  	t.Helper()
  1146  	forSlice(t, int16s, n, func(x []int16) bool {
  1147  		t.Helper()
  1148  		a := simd.LoadInt16x16Slice(x)
  1149  		g := make([]uint16, n)
  1150  		f(a).StoreSlice(g)
  1151  		w := want(x)
  1152  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1153  	})
  1154  }
  1155  
  1156  // testInt32x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want
  1157  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
  1158  func testInt32x8ConvertToUint16(t *testing.T, f func(x simd.Int32x8) simd.Uint16x8, want func(x []int32) []uint16) {
  1159  	n := 8
  1160  	t.Helper()
  1161  	forSlice(t, int32s, n, func(x []int32) bool {
  1162  		t.Helper()
  1163  		a := simd.LoadInt32x8Slice(x)
  1164  		g := make([]uint16, n)
  1165  		f(a).StoreSlice(g)
  1166  		w := want(x)
  1167  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1168  	})
  1169  }
  1170  
  1171  // testUint8x32ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want
  1172  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
  1173  func testUint8x32ConvertToUint16(t *testing.T, f func(x simd.Uint8x32) simd.Uint16x32, want func(x []uint8) []uint16) {
  1174  	n := 32
  1175  	t.Helper()
  1176  	forSlice(t, uint8s, n, func(x []uint8) bool {
  1177  		t.Helper()
  1178  		a := simd.LoadUint8x32Slice(x)
  1179  		g := make([]uint16, n)
  1180  		f(a).StoreSlice(g)
  1181  		w := want(x)
  1182  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1183  	})
  1184  }
  1185  
  1186  // testUint16x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want
  1187  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
  1188  func testUint16x16ConvertToUint16(t *testing.T, f func(x simd.Uint16x16) simd.Uint16x16, want func(x []uint16) []uint16) {
  1189  	n := 16
  1190  	t.Helper()
  1191  	forSlice(t, uint16s, n, func(x []uint16) bool {
  1192  		t.Helper()
  1193  		a := simd.LoadUint16x16Slice(x)
  1194  		g := make([]uint16, n)
  1195  		f(a).StoreSlice(g)
  1196  		w := want(x)
  1197  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1198  	})
  1199  }
  1200  
  1201  // testUint32x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want
  1202  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
  1203  func testUint32x8ConvertToUint16(t *testing.T, f func(x simd.Uint32x8) simd.Uint16x8, want func(x []uint32) []uint16) {
  1204  	n := 8
  1205  	t.Helper()
  1206  	forSlice(t, uint32s, n, func(x []uint32) bool {
  1207  		t.Helper()
  1208  		a := simd.LoadUint32x8Slice(x)
  1209  		g := make([]uint16, n)
  1210  		f(a).StoreSlice(g)
  1211  		w := want(x)
  1212  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1213  	})
  1214  }
  1215  
  1216  // testFloat32x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want
  1217  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
  1218  func testFloat32x8ConvertToUint16(t *testing.T, f func(x simd.Float32x8) simd.Uint16x8, want func(x []float32) []uint16) {
  1219  	n := 8
  1220  	t.Helper()
  1221  	forSlice(t, float32s, n, func(x []float32) bool {
  1222  		t.Helper()
  1223  		a := simd.LoadFloat32x8Slice(x)
  1224  		g := make([]uint16, n)
  1225  		f(a).StoreSlice(g)
  1226  		w := want(x)
  1227  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1228  	})
  1229  }
  1230  
  1231  // testInt16x32ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want
  1232  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
  1233  func testInt16x32ConvertToUint16(t *testing.T, f func(x simd.Int16x32) simd.Uint16x32, want func(x []int16) []uint16) {
  1234  	n := 32
  1235  	t.Helper()
  1236  	forSlice(t, int16s, n, func(x []int16) bool {
  1237  		t.Helper()
  1238  		a := simd.LoadInt16x32Slice(x)
  1239  		g := make([]uint16, n)
  1240  		f(a).StoreSlice(g)
  1241  		w := want(x)
  1242  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1243  	})
  1244  }
  1245  
  1246  // testInt32x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want
  1247  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
  1248  func testInt32x16ConvertToUint16(t *testing.T, f func(x simd.Int32x16) simd.Uint16x16, want func(x []int32) []uint16) {
  1249  	n := 16
  1250  	t.Helper()
  1251  	forSlice(t, int32s, n, func(x []int32) bool {
  1252  		t.Helper()
  1253  		a := simd.LoadInt32x16Slice(x)
  1254  		g := make([]uint16, n)
  1255  		f(a).StoreSlice(g)
  1256  		w := want(x)
  1257  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1258  	})
  1259  }
  1260  
  1261  // testInt64x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want
  1262  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
  1263  func testInt64x8ConvertToUint16(t *testing.T, f func(x simd.Int64x8) simd.Uint16x8, want func(x []int64) []uint16) {
  1264  	n := 8
  1265  	t.Helper()
  1266  	forSlice(t, int64s, n, func(x []int64) bool {
  1267  		t.Helper()
  1268  		a := simd.LoadInt64x8Slice(x)
  1269  		g := make([]uint16, n)
  1270  		f(a).StoreSlice(g)
  1271  		w := want(x)
  1272  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1273  	})
  1274  }
  1275  
  1276  // testUint16x32ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want
  1277  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
  1278  func testUint16x32ConvertToUint16(t *testing.T, f func(x simd.Uint16x32) simd.Uint16x32, want func(x []uint16) []uint16) {
  1279  	n := 32
  1280  	t.Helper()
  1281  	forSlice(t, uint16s, n, func(x []uint16) bool {
  1282  		t.Helper()
  1283  		a := simd.LoadUint16x32Slice(x)
  1284  		g := make([]uint16, n)
  1285  		f(a).StoreSlice(g)
  1286  		w := want(x)
  1287  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1288  	})
  1289  }
  1290  
  1291  // testUint32x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want
  1292  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
  1293  func testUint32x16ConvertToUint16(t *testing.T, f func(x simd.Uint32x16) simd.Uint16x16, want func(x []uint32) []uint16) {
  1294  	n := 16
  1295  	t.Helper()
  1296  	forSlice(t, uint32s, n, func(x []uint32) bool {
  1297  		t.Helper()
  1298  		a := simd.LoadUint32x16Slice(x)
  1299  		g := make([]uint16, n)
  1300  		f(a).StoreSlice(g)
  1301  		w := want(x)
  1302  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1303  	})
  1304  }
  1305  
  1306  // testUint64x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want
  1307  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
  1308  func testUint64x8ConvertToUint16(t *testing.T, f func(x simd.Uint64x8) simd.Uint16x8, want func(x []uint64) []uint16) {
  1309  	n := 8
  1310  	t.Helper()
  1311  	forSlice(t, uint64s, n, func(x []uint64) bool {
  1312  		t.Helper()
  1313  		a := simd.LoadUint64x8Slice(x)
  1314  		g := make([]uint16, n)
  1315  		f(a).StoreSlice(g)
  1316  		w := want(x)
  1317  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1318  	})
  1319  }
  1320  
  1321  // testFloat32x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want
  1322  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
  1323  func testFloat32x16ConvertToUint16(t *testing.T, f func(x simd.Float32x16) simd.Uint16x16, want func(x []float32) []uint16) {
  1324  	n := 16
  1325  	t.Helper()
  1326  	forSlice(t, float32s, n, func(x []float32) bool {
  1327  		t.Helper()
  1328  		a := simd.LoadFloat32x16Slice(x)
  1329  		g := make([]uint16, n)
  1330  		f(a).StoreSlice(g)
  1331  		w := want(x)
  1332  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1333  	})
  1334  }
  1335  
  1336  // testFloat64x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want
  1337  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width.
  1338  func testFloat64x8ConvertToUint16(t *testing.T, f func(x simd.Float64x8) simd.Uint16x8, want func(x []float64) []uint16) {
  1339  	n := 8
  1340  	t.Helper()
  1341  	forSlice(t, float64s, n, func(x []float64) bool {
  1342  		t.Helper()
  1343  		a := simd.LoadFloat64x8Slice(x)
  1344  		g := make([]uint16, n)
  1345  		f(a).StoreSlice(g)
  1346  		w := want(x)
  1347  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1348  	})
  1349  }
  1350  
  1351  // testFloat32x4UnaryFlaky tests the simd unary method f against the expected behavior generated by want,
  1352  // but using a flakiness parameter because we haven't exactly figured out how simd floating point works
  1353  func testFloat32x4UnaryFlaky(t *testing.T, f func(x simd.Float32x4) simd.Float32x4, want func(x []float32) []float32, flakiness float64) {
  1354  	n := 4
  1355  	t.Helper()
  1356  	forSlice(t, float32s, n, func(x []float32) bool {
  1357  		t.Helper()
  1358  		a := simd.LoadFloat32x4Slice(x)
  1359  		g := make([]float32, n)
  1360  		f(a).StoreSlice(g)
  1361  		w := want(x)
  1362  		return checkSlicesLogInput(t, g, w, flakiness, func() { t.Helper(); t.Logf("x=%v", x) })
  1363  	})
  1364  }
  1365  
  1366  // testFloat64x2UnaryFlaky tests the simd unary method f against the expected behavior generated by want,
  1367  // but using a flakiness parameter because we haven't exactly figured out how simd floating point works
  1368  func testFloat64x2UnaryFlaky(t *testing.T, f func(x simd.Float64x2) simd.Float64x2, want func(x []float64) []float64, flakiness float64) {
  1369  	n := 2
  1370  	t.Helper()
  1371  	forSlice(t, float64s, n, func(x []float64) bool {
  1372  		t.Helper()
  1373  		a := simd.LoadFloat64x2Slice(x)
  1374  		g := make([]float64, n)
  1375  		f(a).StoreSlice(g)
  1376  		w := want(x)
  1377  		return checkSlicesLogInput(t, g, w, flakiness, func() { t.Helper(); t.Logf("x=%v", x) })
  1378  	})
  1379  }
  1380  
  1381  // testFloat32x8UnaryFlaky tests the simd unary method f against the expected behavior generated by want,
  1382  // but using a flakiness parameter because we haven't exactly figured out how simd floating point works
  1383  func testFloat32x8UnaryFlaky(t *testing.T, f func(x simd.Float32x8) simd.Float32x8, want func(x []float32) []float32, flakiness float64) {
  1384  	n := 8
  1385  	t.Helper()
  1386  	forSlice(t, float32s, n, func(x []float32) bool {
  1387  		t.Helper()
  1388  		a := simd.LoadFloat32x8Slice(x)
  1389  		g := make([]float32, n)
  1390  		f(a).StoreSlice(g)
  1391  		w := want(x)
  1392  		return checkSlicesLogInput(t, g, w, flakiness, func() { t.Helper(); t.Logf("x=%v", x) })
  1393  	})
  1394  }
  1395  
  1396  // testFloat64x4UnaryFlaky tests the simd unary method f against the expected behavior generated by want,
  1397  // but using a flakiness parameter because we haven't exactly figured out how simd floating point works
  1398  func testFloat64x4UnaryFlaky(t *testing.T, f func(x simd.Float64x4) simd.Float64x4, want func(x []float64) []float64, flakiness float64) {
  1399  	n := 4
  1400  	t.Helper()
  1401  	forSlice(t, float64s, n, func(x []float64) bool {
  1402  		t.Helper()
  1403  		a := simd.LoadFloat64x4Slice(x)
  1404  		g := make([]float64, n)
  1405  		f(a).StoreSlice(g)
  1406  		w := want(x)
  1407  		return checkSlicesLogInput(t, g, w, flakiness, func() { t.Helper(); t.Logf("x=%v", x) })
  1408  	})
  1409  }
  1410  
  1411  // testFloat32x16UnaryFlaky tests the simd unary method f against the expected behavior generated by want,
  1412  // but using a flakiness parameter because we haven't exactly figured out how simd floating point works
  1413  func testFloat32x16UnaryFlaky(t *testing.T, f func(x simd.Float32x16) simd.Float32x16, want func(x []float32) []float32, flakiness float64) {
  1414  	n := 16
  1415  	t.Helper()
  1416  	forSlice(t, float32s, n, func(x []float32) bool {
  1417  		t.Helper()
  1418  		a := simd.LoadFloat32x16Slice(x)
  1419  		g := make([]float32, n)
  1420  		f(a).StoreSlice(g)
  1421  		w := want(x)
  1422  		return checkSlicesLogInput(t, g, w, flakiness, func() { t.Helper(); t.Logf("x=%v", x) })
  1423  	})
  1424  }
  1425  
  1426  // testFloat64x8UnaryFlaky tests the simd unary method f against the expected behavior generated by want,
  1427  // but using a flakiness parameter because we haven't exactly figured out how simd floating point works
  1428  func testFloat64x8UnaryFlaky(t *testing.T, f func(x simd.Float64x8) simd.Float64x8, want func(x []float64) []float64, flakiness float64) {
  1429  	n := 8
  1430  	t.Helper()
  1431  	forSlice(t, float64s, n, func(x []float64) bool {
  1432  		t.Helper()
  1433  		a := simd.LoadFloat64x8Slice(x)
  1434  		g := make([]float64, n)
  1435  		f(a).StoreSlice(g)
  1436  		w := want(x)
  1437  		return checkSlicesLogInput(t, g, w, flakiness, func() { t.Helper(); t.Logf("x=%v", x) })
  1438  	})
  1439  }
  1440  

View as plain text