Source file src/simd/archsimd/internal/simd_test/convert_helpers_wider_test.go

     1  // Code generated by 'tmplgen'; DO NOT EDIT.
     2  
     3  //go:build goexperiment.simd && amd64
     4  
     5  // This file contains functions testing conversion 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/archsimd"
    13  	"testing"
    14  )
    15  
    16  // testInt16x16ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want.
    17  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
    18  // (extended to at least 128 bits, or truncated to at most 512 bits).
    19  func testInt16x16ConvertToInt8(t *testing.T, f func(x archsimd.Int16x16) archsimd.Int8x16, want func(x []int16) []int8) {
    20  	n := 16
    21  	t.Helper()
    22  	forSlice(t, int16s, n, func(x []int16) bool {
    23  		t.Helper()
    24  		a := archsimd.LoadInt16x16(x)
    25  		g := make([]int8, 16)
    26  		f(a).Store(g)
    27  		w := want(x)
    28  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
    29  	})
    30  }
    31  
    32  // testInt32x8ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want.
    33  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
    34  // (extended to at least 128 bits, or truncated to at most 512 bits).
    35  func testInt32x8ConvertToInt8(t *testing.T, f func(x archsimd.Int32x8) archsimd.Int8x16, want func(x []int32) []int8) {
    36  	n := 8
    37  	t.Helper()
    38  	forSlice(t, int32s, n, func(x []int32) bool {
    39  		t.Helper()
    40  		a := archsimd.LoadInt32x8(x)
    41  		g := make([]int8, 16)
    42  		f(a).Store(g)
    43  		w := want(x)
    44  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
    45  	})
    46  }
    47  
    48  // testInt64x4ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want.
    49  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
    50  // (extended to at least 128 bits, or truncated to at most 512 bits).
    51  func testInt64x4ConvertToInt8(t *testing.T, f func(x archsimd.Int64x4) archsimd.Int8x16, want func(x []int64) []int8) {
    52  	n := 4
    53  	t.Helper()
    54  	forSlice(t, int64s, n, func(x []int64) bool {
    55  		t.Helper()
    56  		a := archsimd.LoadInt64x4(x)
    57  		g := make([]int8, 16)
    58  		f(a).Store(g)
    59  		w := want(x)
    60  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
    61  	})
    62  }
    63  
    64  // testUint8x32ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want.
    65  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
    66  // (extended to at least 128 bits, or truncated to at most 512 bits).
    67  func testUint8x32ConvertToInt8(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Int8x32, want func(x []uint8) []int8) {
    68  	n := 32
    69  	t.Helper()
    70  	forSlice(t, uint8s, n, func(x []uint8) bool {
    71  		t.Helper()
    72  		a := archsimd.LoadUint8x32(x)
    73  		g := make([]int8, 32)
    74  		f(a).Store(g)
    75  		w := want(x)
    76  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
    77  	})
    78  }
    79  
    80  // testUint16x16ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want.
    81  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
    82  // (extended to at least 128 bits, or truncated to at most 512 bits).
    83  func testUint16x16ConvertToInt8(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Int8x16, want func(x []uint16) []int8) {
    84  	n := 16
    85  	t.Helper()
    86  	forSlice(t, uint16s, n, func(x []uint16) bool {
    87  		t.Helper()
    88  		a := archsimd.LoadUint16x16(x)
    89  		g := make([]int8, 16)
    90  		f(a).Store(g)
    91  		w := want(x)
    92  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
    93  	})
    94  }
    95  
    96  // testUint32x8ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want.
    97  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
    98  // (extended to at least 128 bits, or truncated to at most 512 bits).
    99  func testUint32x8ConvertToInt8(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Int8x16, want func(x []uint32) []int8) {
   100  	n := 8
   101  	t.Helper()
   102  	forSlice(t, uint32s, n, func(x []uint32) bool {
   103  		t.Helper()
   104  		a := archsimd.LoadUint32x8(x)
   105  		g := make([]int8, 16)
   106  		f(a).Store(g)
   107  		w := want(x)
   108  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   109  	})
   110  }
   111  
   112  // testUint64x4ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want.
   113  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   114  // (extended to at least 128 bits, or truncated to at most 512 bits).
   115  func testUint64x4ConvertToInt8(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Int8x16, want func(x []uint64) []int8) {
   116  	n := 4
   117  	t.Helper()
   118  	forSlice(t, uint64s, n, func(x []uint64) bool {
   119  		t.Helper()
   120  		a := archsimd.LoadUint64x4(x)
   121  		g := make([]int8, 16)
   122  		f(a).Store(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  // testFloat32x8ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want.
   129  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   130  // (extended to at least 128 bits, or truncated to at most 512 bits).
   131  func testFloat32x8ConvertToInt8(t *testing.T, f func(x archsimd.Float32x8) archsimd.Int8x16, want func(x []float32) []int8) {
   132  	n := 8
   133  	t.Helper()
   134  	forSlice(t, float32s, n, func(x []float32) bool {
   135  		t.Helper()
   136  		a := archsimd.LoadFloat32x8(x)
   137  		g := make([]int8, 16)
   138  		f(a).Store(g)
   139  		w := want(x)
   140  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   141  	})
   142  }
   143  
   144  // testFloat64x4ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want.
   145  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   146  // (extended to at least 128 bits, or truncated to at most 512 bits).
   147  func testFloat64x4ConvertToInt8(t *testing.T, f func(x archsimd.Float64x4) archsimd.Int8x16, want func(x []float64) []int8) {
   148  	n := 4
   149  	t.Helper()
   150  	forSlice(t, float64s, n, func(x []float64) bool {
   151  		t.Helper()
   152  		a := archsimd.LoadFloat64x4(x)
   153  		g := make([]int8, 16)
   154  		f(a).Store(g)
   155  		w := want(x)
   156  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   157  	})
   158  }
   159  
   160  // testInt16x32ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want.
   161  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   162  // (extended to at least 128 bits, or truncated to at most 512 bits).
   163  func testInt16x32ConvertToInt8(t *testing.T, f func(x archsimd.Int16x32) archsimd.Int8x32, want func(x []int16) []int8) {
   164  	n := 32
   165  	t.Helper()
   166  	forSlice(t, int16s, n, func(x []int16) bool {
   167  		t.Helper()
   168  		a := archsimd.LoadInt16x32(x)
   169  		g := make([]int8, 32)
   170  		f(a).Store(g)
   171  		w := want(x)
   172  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   173  	})
   174  }
   175  
   176  // testInt32x16ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want.
   177  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   178  // (extended to at least 128 bits, or truncated to at most 512 bits).
   179  func testInt32x16ConvertToInt8(t *testing.T, f func(x archsimd.Int32x16) archsimd.Int8x16, want func(x []int32) []int8) {
   180  	n := 16
   181  	t.Helper()
   182  	forSlice(t, int32s, n, func(x []int32) bool {
   183  		t.Helper()
   184  		a := archsimd.LoadInt32x16(x)
   185  		g := make([]int8, 16)
   186  		f(a).Store(g)
   187  		w := want(x)
   188  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   189  	})
   190  }
   191  
   192  // testInt64x8ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want.
   193  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   194  // (extended to at least 128 bits, or truncated to at most 512 bits).
   195  func testInt64x8ConvertToInt8(t *testing.T, f func(x archsimd.Int64x8) archsimd.Int8x16, want func(x []int64) []int8) {
   196  	n := 8
   197  	t.Helper()
   198  	forSlice(t, int64s, n, func(x []int64) bool {
   199  		t.Helper()
   200  		a := archsimd.LoadInt64x8(x)
   201  		g := make([]int8, 16)
   202  		f(a).Store(g)
   203  		w := want(x)
   204  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   205  	})
   206  }
   207  
   208  // testUint8x64ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want.
   209  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   210  // (extended to at least 128 bits, or truncated to at most 512 bits).
   211  func testUint8x64ConvertToInt8(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Int8x64, want func(x []uint8) []int8) {
   212  	n := 64
   213  	t.Helper()
   214  	forSlice(t, uint8s, n, func(x []uint8) bool {
   215  		t.Helper()
   216  		a := archsimd.LoadUint8x64(x)
   217  		g := make([]int8, 64)
   218  		f(a).Store(g)
   219  		w := want(x)
   220  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   221  	})
   222  }
   223  
   224  // testUint16x32ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want.
   225  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   226  // (extended to at least 128 bits, or truncated to at most 512 bits).
   227  func testUint16x32ConvertToInt8(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Int8x32, want func(x []uint16) []int8) {
   228  	n := 32
   229  	t.Helper()
   230  	forSlice(t, uint16s, n, func(x []uint16) bool {
   231  		t.Helper()
   232  		a := archsimd.LoadUint16x32(x)
   233  		g := make([]int8, 32)
   234  		f(a).Store(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  // testUint32x16ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want.
   241  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   242  // (extended to at least 128 bits, or truncated to at most 512 bits).
   243  func testUint32x16ConvertToInt8(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Int8x16, want func(x []uint32) []int8) {
   244  	n := 16
   245  	t.Helper()
   246  	forSlice(t, uint32s, n, func(x []uint32) bool {
   247  		t.Helper()
   248  		a := archsimd.LoadUint32x16(x)
   249  		g := make([]int8, 16)
   250  		f(a).Store(g)
   251  		w := want(x)
   252  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   253  	})
   254  }
   255  
   256  // testUint64x8ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want.
   257  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   258  // (extended to at least 128 bits, or truncated to at most 512 bits).
   259  func testUint64x8ConvertToInt8(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Int8x16, want func(x []uint64) []int8) {
   260  	n := 8
   261  	t.Helper()
   262  	forSlice(t, uint64s, n, func(x []uint64) bool {
   263  		t.Helper()
   264  		a := archsimd.LoadUint64x8(x)
   265  		g := make([]int8, 16)
   266  		f(a).Store(g)
   267  		w := want(x)
   268  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   269  	})
   270  }
   271  
   272  // testFloat32x16ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want.
   273  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   274  // (extended to at least 128 bits, or truncated to at most 512 bits).
   275  func testFloat32x16ConvertToInt8(t *testing.T, f func(x archsimd.Float32x16) archsimd.Int8x16, want func(x []float32) []int8) {
   276  	n := 16
   277  	t.Helper()
   278  	forSlice(t, float32s, n, func(x []float32) bool {
   279  		t.Helper()
   280  		a := archsimd.LoadFloat32x16(x)
   281  		g := make([]int8, 16)
   282  		f(a).Store(g)
   283  		w := want(x)
   284  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   285  	})
   286  }
   287  
   288  // testFloat64x8ConvertToInt8 tests the simd conversion method f against the expected behavior generated by want.
   289  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   290  // (extended to at least 128 bits, or truncated to at most 512 bits).
   291  func testFloat64x8ConvertToInt8(t *testing.T, f func(x archsimd.Float64x8) archsimd.Int8x16, want func(x []float64) []int8) {
   292  	n := 8
   293  	t.Helper()
   294  	forSlice(t, float64s, n, func(x []float64) bool {
   295  		t.Helper()
   296  		a := archsimd.LoadFloat64x8(x)
   297  		g := make([]int8, 16)
   298  		f(a).Store(g)
   299  		w := want(x)
   300  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   301  	})
   302  }
   303  
   304  // testInt8x32ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want.
   305  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   306  // (extended to at least 128 bits, or truncated to at most 512 bits).
   307  func testInt8x32ConvertToUint8(t *testing.T, f func(x archsimd.Int8x32) archsimd.Uint8x32, want func(x []int8) []uint8) {
   308  	n := 32
   309  	t.Helper()
   310  	forSlice(t, int8s, n, func(x []int8) bool {
   311  		t.Helper()
   312  		a := archsimd.LoadInt8x32(x)
   313  		g := make([]uint8, 32)
   314  		f(a).Store(g)
   315  		w := want(x)
   316  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   317  	})
   318  }
   319  
   320  // testInt16x16ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want.
   321  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   322  // (extended to at least 128 bits, or truncated to at most 512 bits).
   323  func testInt16x16ConvertToUint8(t *testing.T, f func(x archsimd.Int16x16) archsimd.Uint8x16, want func(x []int16) []uint8) {
   324  	n := 16
   325  	t.Helper()
   326  	forSlice(t, int16s, n, func(x []int16) bool {
   327  		t.Helper()
   328  		a := archsimd.LoadInt16x16(x)
   329  		g := make([]uint8, 16)
   330  		f(a).Store(g)
   331  		w := want(x)
   332  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   333  	})
   334  }
   335  
   336  // testInt32x8ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want.
   337  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   338  // (extended to at least 128 bits, or truncated to at most 512 bits).
   339  func testInt32x8ConvertToUint8(t *testing.T, f func(x archsimd.Int32x8) archsimd.Uint8x16, want func(x []int32) []uint8) {
   340  	n := 8
   341  	t.Helper()
   342  	forSlice(t, int32s, n, func(x []int32) bool {
   343  		t.Helper()
   344  		a := archsimd.LoadInt32x8(x)
   345  		g := make([]uint8, 16)
   346  		f(a).Store(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  // testInt64x4ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want.
   353  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   354  // (extended to at least 128 bits, or truncated to at most 512 bits).
   355  func testInt64x4ConvertToUint8(t *testing.T, f func(x archsimd.Int64x4) archsimd.Uint8x16, want func(x []int64) []uint8) {
   356  	n := 4
   357  	t.Helper()
   358  	forSlice(t, int64s, n, func(x []int64) bool {
   359  		t.Helper()
   360  		a := archsimd.LoadInt64x4(x)
   361  		g := make([]uint8, 16)
   362  		f(a).Store(g)
   363  		w := want(x)
   364  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   365  	})
   366  }
   367  
   368  // testUint16x16ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want.
   369  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   370  // (extended to at least 128 bits, or truncated to at most 512 bits).
   371  func testUint16x16ConvertToUint8(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Uint8x16, want func(x []uint16) []uint8) {
   372  	n := 16
   373  	t.Helper()
   374  	forSlice(t, uint16s, n, func(x []uint16) bool {
   375  		t.Helper()
   376  		a := archsimd.LoadUint16x16(x)
   377  		g := make([]uint8, 16)
   378  		f(a).Store(g)
   379  		w := want(x)
   380  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   381  	})
   382  }
   383  
   384  // testUint32x8ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want.
   385  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   386  // (extended to at least 128 bits, or truncated to at most 512 bits).
   387  func testUint32x8ConvertToUint8(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Uint8x16, want func(x []uint32) []uint8) {
   388  	n := 8
   389  	t.Helper()
   390  	forSlice(t, uint32s, n, func(x []uint32) bool {
   391  		t.Helper()
   392  		a := archsimd.LoadUint32x8(x)
   393  		g := make([]uint8, 16)
   394  		f(a).Store(g)
   395  		w := want(x)
   396  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   397  	})
   398  }
   399  
   400  // testUint64x4ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want.
   401  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   402  // (extended to at least 128 bits, or truncated to at most 512 bits).
   403  func testUint64x4ConvertToUint8(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Uint8x16, want func(x []uint64) []uint8) {
   404  	n := 4
   405  	t.Helper()
   406  	forSlice(t, uint64s, n, func(x []uint64) bool {
   407  		t.Helper()
   408  		a := archsimd.LoadUint64x4(x)
   409  		g := make([]uint8, 16)
   410  		f(a).Store(g)
   411  		w := want(x)
   412  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   413  	})
   414  }
   415  
   416  // testFloat32x8ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want.
   417  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   418  // (extended to at least 128 bits, or truncated to at most 512 bits).
   419  func testFloat32x8ConvertToUint8(t *testing.T, f func(x archsimd.Float32x8) archsimd.Uint8x16, want func(x []float32) []uint8) {
   420  	n := 8
   421  	t.Helper()
   422  	forSlice(t, float32s, n, func(x []float32) bool {
   423  		t.Helper()
   424  		a := archsimd.LoadFloat32x8(x)
   425  		g := make([]uint8, 16)
   426  		f(a).Store(g)
   427  		w := want(x)
   428  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   429  	})
   430  }
   431  
   432  // testFloat64x4ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want.
   433  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   434  // (extended to at least 128 bits, or truncated to at most 512 bits).
   435  func testFloat64x4ConvertToUint8(t *testing.T, f func(x archsimd.Float64x4) archsimd.Uint8x16, want func(x []float64) []uint8) {
   436  	n := 4
   437  	t.Helper()
   438  	forSlice(t, float64s, n, func(x []float64) bool {
   439  		t.Helper()
   440  		a := archsimd.LoadFloat64x4(x)
   441  		g := make([]uint8, 16)
   442  		f(a).Store(g)
   443  		w := want(x)
   444  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   445  	})
   446  }
   447  
   448  // testInt8x64ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want.
   449  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   450  // (extended to at least 128 bits, or truncated to at most 512 bits).
   451  func testInt8x64ConvertToUint8(t *testing.T, f func(x archsimd.Int8x64) archsimd.Uint8x64, want func(x []int8) []uint8) {
   452  	n := 64
   453  	t.Helper()
   454  	forSlice(t, int8s, n, func(x []int8) bool {
   455  		t.Helper()
   456  		a := archsimd.LoadInt8x64(x)
   457  		g := make([]uint8, 64)
   458  		f(a).Store(g)
   459  		w := want(x)
   460  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   461  	})
   462  }
   463  
   464  // testInt16x32ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want.
   465  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   466  // (extended to at least 128 bits, or truncated to at most 512 bits).
   467  func testInt16x32ConvertToUint8(t *testing.T, f func(x archsimd.Int16x32) archsimd.Uint8x32, want func(x []int16) []uint8) {
   468  	n := 32
   469  	t.Helper()
   470  	forSlice(t, int16s, n, func(x []int16) bool {
   471  		t.Helper()
   472  		a := archsimd.LoadInt16x32(x)
   473  		g := make([]uint8, 32)
   474  		f(a).Store(g)
   475  		w := want(x)
   476  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   477  	})
   478  }
   479  
   480  // testInt32x16ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want.
   481  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   482  // (extended to at least 128 bits, or truncated to at most 512 bits).
   483  func testInt32x16ConvertToUint8(t *testing.T, f func(x archsimd.Int32x16) archsimd.Uint8x16, want func(x []int32) []uint8) {
   484  	n := 16
   485  	t.Helper()
   486  	forSlice(t, int32s, n, func(x []int32) bool {
   487  		t.Helper()
   488  		a := archsimd.LoadInt32x16(x)
   489  		g := make([]uint8, 16)
   490  		f(a).Store(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  // testInt64x8ConvertToUint8 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  // (extended to at least 128 bits, or truncated to at most 512 bits).
   499  func testInt64x8ConvertToUint8(t *testing.T, f func(x archsimd.Int64x8) archsimd.Uint8x16, want func(x []int64) []uint8) {
   500  	n := 8
   501  	t.Helper()
   502  	forSlice(t, int64s, n, func(x []int64) bool {
   503  		t.Helper()
   504  		a := archsimd.LoadInt64x8(x)
   505  		g := make([]uint8, 16)
   506  		f(a).Store(g)
   507  		w := want(x)
   508  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   509  	})
   510  }
   511  
   512  // testUint16x32ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want.
   513  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   514  // (extended to at least 128 bits, or truncated to at most 512 bits).
   515  func testUint16x32ConvertToUint8(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Uint8x32, want func(x []uint16) []uint8) {
   516  	n := 32
   517  	t.Helper()
   518  	forSlice(t, uint16s, n, func(x []uint16) bool {
   519  		t.Helper()
   520  		a := archsimd.LoadUint16x32(x)
   521  		g := make([]uint8, 32)
   522  		f(a).Store(g)
   523  		w := want(x)
   524  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   525  	})
   526  }
   527  
   528  // testUint32x16ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want.
   529  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   530  // (extended to at least 128 bits, or truncated to at most 512 bits).
   531  func testUint32x16ConvertToUint8(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Uint8x16, want func(x []uint32) []uint8) {
   532  	n := 16
   533  	t.Helper()
   534  	forSlice(t, uint32s, n, func(x []uint32) bool {
   535  		t.Helper()
   536  		a := archsimd.LoadUint32x16(x)
   537  		g := make([]uint8, 16)
   538  		f(a).Store(g)
   539  		w := want(x)
   540  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   541  	})
   542  }
   543  
   544  // testUint64x8ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want.
   545  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   546  // (extended to at least 128 bits, or truncated to at most 512 bits).
   547  func testUint64x8ConvertToUint8(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Uint8x16, want func(x []uint64) []uint8) {
   548  	n := 8
   549  	t.Helper()
   550  	forSlice(t, uint64s, n, func(x []uint64) bool {
   551  		t.Helper()
   552  		a := archsimd.LoadUint64x8(x)
   553  		g := make([]uint8, 16)
   554  		f(a).Store(g)
   555  		w := want(x)
   556  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   557  	})
   558  }
   559  
   560  // testFloat32x16ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want.
   561  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   562  // (extended to at least 128 bits, or truncated to at most 512 bits).
   563  func testFloat32x16ConvertToUint8(t *testing.T, f func(x archsimd.Float32x16) archsimd.Uint8x16, want func(x []float32) []uint8) {
   564  	n := 16
   565  	t.Helper()
   566  	forSlice(t, float32s, n, func(x []float32) bool {
   567  		t.Helper()
   568  		a := archsimd.LoadFloat32x16(x)
   569  		g := make([]uint8, 16)
   570  		f(a).Store(g)
   571  		w := want(x)
   572  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   573  	})
   574  }
   575  
   576  // testFloat64x8ConvertToUint8 tests the simd conversion method f against the expected behavior generated by want.
   577  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   578  // (extended to at least 128 bits, or truncated to at most 512 bits).
   579  func testFloat64x8ConvertToUint8(t *testing.T, f func(x archsimd.Float64x8) archsimd.Uint8x16, want func(x []float64) []uint8) {
   580  	n := 8
   581  	t.Helper()
   582  	forSlice(t, float64s, n, func(x []float64) bool {
   583  		t.Helper()
   584  		a := archsimd.LoadFloat64x8(x)
   585  		g := make([]uint8, 16)
   586  		f(a).Store(g)
   587  		w := want(x)
   588  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   589  	})
   590  }
   591  
   592  // testInt8x16ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want.
   593  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   594  // (extended to at least 128 bits, or truncated to at most 512 bits).
   595  func testInt8x16ConvertToInt16(t *testing.T, f func(x archsimd.Int8x16) archsimd.Int16x16, want func(x []int8) []int16) {
   596  	n := 16
   597  	t.Helper()
   598  	forSlice(t, int8s, n, func(x []int8) bool {
   599  		t.Helper()
   600  		a := archsimd.LoadInt8x16(x)
   601  		g := make([]int16, 16)
   602  		f(a).Store(g)
   603  		w := want(x)
   604  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   605  	})
   606  }
   607  
   608  // testUint8x16ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want.
   609  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   610  // (extended to at least 128 bits, or truncated to at most 512 bits).
   611  func testUint8x16ConvertToInt16(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Int16x16, want func(x []uint8) []int16) {
   612  	n := 16
   613  	t.Helper()
   614  	forSlice(t, uint8s, n, func(x []uint8) bool {
   615  		t.Helper()
   616  		a := archsimd.LoadUint8x16(x)
   617  		g := make([]int16, 16)
   618  		f(a).Store(g)
   619  		w := want(x)
   620  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   621  	})
   622  }
   623  
   624  // testInt8x32ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want.
   625  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   626  // (extended to at least 128 bits, or truncated to at most 512 bits).
   627  func testInt8x32ConvertToInt16(t *testing.T, f func(x archsimd.Int8x32) archsimd.Int16x32, want func(x []int8) []int16) {
   628  	n := 32
   629  	t.Helper()
   630  	forSlice(t, int8s, n, func(x []int8) bool {
   631  		t.Helper()
   632  		a := archsimd.LoadInt8x32(x)
   633  		g := make([]int16, 32)
   634  		f(a).Store(g)
   635  		w := want(x)
   636  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   637  	})
   638  }
   639  
   640  // testInt32x8ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want.
   641  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   642  // (extended to at least 128 bits, or truncated to at most 512 bits).
   643  func testInt32x8ConvertToInt16(t *testing.T, f func(x archsimd.Int32x8) archsimd.Int16x8, want func(x []int32) []int16) {
   644  	n := 8
   645  	t.Helper()
   646  	forSlice(t, int32s, n, func(x []int32) bool {
   647  		t.Helper()
   648  		a := archsimd.LoadInt32x8(x)
   649  		g := make([]int16, 8)
   650  		f(a).Store(g)
   651  		w := want(x)
   652  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   653  	})
   654  }
   655  
   656  // testInt64x4ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want.
   657  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   658  // (extended to at least 128 bits, or truncated to at most 512 bits).
   659  func testInt64x4ConvertToInt16(t *testing.T, f func(x archsimd.Int64x4) archsimd.Int16x8, want func(x []int64) []int16) {
   660  	n := 4
   661  	t.Helper()
   662  	forSlice(t, int64s, n, func(x []int64) bool {
   663  		t.Helper()
   664  		a := archsimd.LoadInt64x4(x)
   665  		g := make([]int16, 8)
   666  		f(a).Store(g)
   667  		w := want(x)
   668  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   669  	})
   670  }
   671  
   672  // testUint8x32ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want.
   673  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   674  // (extended to at least 128 bits, or truncated to at most 512 bits).
   675  func testUint8x32ConvertToInt16(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Int16x32, want func(x []uint8) []int16) {
   676  	n := 32
   677  	t.Helper()
   678  	forSlice(t, uint8s, n, func(x []uint8) bool {
   679  		t.Helper()
   680  		a := archsimd.LoadUint8x32(x)
   681  		g := make([]int16, 32)
   682  		f(a).Store(g)
   683  		w := want(x)
   684  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   685  	})
   686  }
   687  
   688  // testUint16x16ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want.
   689  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   690  // (extended to at least 128 bits, or truncated to at most 512 bits).
   691  func testUint16x16ConvertToInt16(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Int16x16, want func(x []uint16) []int16) {
   692  	n := 16
   693  	t.Helper()
   694  	forSlice(t, uint16s, n, func(x []uint16) bool {
   695  		t.Helper()
   696  		a := archsimd.LoadUint16x16(x)
   697  		g := make([]int16, 16)
   698  		f(a).Store(g)
   699  		w := want(x)
   700  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   701  	})
   702  }
   703  
   704  // testUint32x8ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want.
   705  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   706  // (extended to at least 128 bits, or truncated to at most 512 bits).
   707  func testUint32x8ConvertToInt16(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Int16x8, want func(x []uint32) []int16) {
   708  	n := 8
   709  	t.Helper()
   710  	forSlice(t, uint32s, n, func(x []uint32) bool {
   711  		t.Helper()
   712  		a := archsimd.LoadUint32x8(x)
   713  		g := make([]int16, 8)
   714  		f(a).Store(g)
   715  		w := want(x)
   716  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   717  	})
   718  }
   719  
   720  // testUint64x4ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want.
   721  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   722  // (extended to at least 128 bits, or truncated to at most 512 bits).
   723  func testUint64x4ConvertToInt16(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Int16x8, want func(x []uint64) []int16) {
   724  	n := 4
   725  	t.Helper()
   726  	forSlice(t, uint64s, n, func(x []uint64) bool {
   727  		t.Helper()
   728  		a := archsimd.LoadUint64x4(x)
   729  		g := make([]int16, 8)
   730  		f(a).Store(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  // testFloat32x8ConvertToInt16 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  // (extended to at least 128 bits, or truncated to at most 512 bits).
   739  func testFloat32x8ConvertToInt16(t *testing.T, f func(x archsimd.Float32x8) archsimd.Int16x8, want func(x []float32) []int16) {
   740  	n := 8
   741  	t.Helper()
   742  	forSlice(t, float32s, n, func(x []float32) bool {
   743  		t.Helper()
   744  		a := archsimd.LoadFloat32x8(x)
   745  		g := make([]int16, 8)
   746  		f(a).Store(g)
   747  		w := want(x)
   748  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   749  	})
   750  }
   751  
   752  // testFloat64x4ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want.
   753  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   754  // (extended to at least 128 bits, or truncated to at most 512 bits).
   755  func testFloat64x4ConvertToInt16(t *testing.T, f func(x archsimd.Float64x4) archsimd.Int16x8, want func(x []float64) []int16) {
   756  	n := 4
   757  	t.Helper()
   758  	forSlice(t, float64s, n, func(x []float64) bool {
   759  		t.Helper()
   760  		a := archsimd.LoadFloat64x4(x)
   761  		g := make([]int16, 8)
   762  		f(a).Store(g)
   763  		w := want(x)
   764  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   765  	})
   766  }
   767  
   768  // testInt8x64ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want.
   769  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   770  // (extended to at least 128 bits, or truncated to at most 512 bits).
   771  func testInt8x64ConvertToInt16(t *testing.T, f func(x archsimd.Int8x64) archsimd.Int16x32, want func(x []int8) []int16) {
   772  	n := 64
   773  	t.Helper()
   774  	forSlice(t, int8s, n, func(x []int8) bool {
   775  		t.Helper()
   776  		a := archsimd.LoadInt8x64(x)
   777  		g := make([]int16, 32)
   778  		f(a).Store(g)
   779  		w := want(x)
   780  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   781  	})
   782  }
   783  
   784  // testInt32x16ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want.
   785  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   786  // (extended to at least 128 bits, or truncated to at most 512 bits).
   787  func testInt32x16ConvertToInt16(t *testing.T, f func(x archsimd.Int32x16) archsimd.Int16x16, want func(x []int32) []int16) {
   788  	n := 16
   789  	t.Helper()
   790  	forSlice(t, int32s, n, func(x []int32) bool {
   791  		t.Helper()
   792  		a := archsimd.LoadInt32x16(x)
   793  		g := make([]int16, 16)
   794  		f(a).Store(g)
   795  		w := want(x)
   796  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   797  	})
   798  }
   799  
   800  // testInt64x8ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want.
   801  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   802  // (extended to at least 128 bits, or truncated to at most 512 bits).
   803  func testInt64x8ConvertToInt16(t *testing.T, f func(x archsimd.Int64x8) archsimd.Int16x8, want func(x []int64) []int16) {
   804  	n := 8
   805  	t.Helper()
   806  	forSlice(t, int64s, n, func(x []int64) bool {
   807  		t.Helper()
   808  		a := archsimd.LoadInt64x8(x)
   809  		g := make([]int16, 8)
   810  		f(a).Store(g)
   811  		w := want(x)
   812  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   813  	})
   814  }
   815  
   816  // testUint8x64ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want.
   817  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   818  // (extended to at least 128 bits, or truncated to at most 512 bits).
   819  func testUint8x64ConvertToInt16(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Int16x32, want func(x []uint8) []int16) {
   820  	n := 64
   821  	t.Helper()
   822  	forSlice(t, uint8s, n, func(x []uint8) bool {
   823  		t.Helper()
   824  		a := archsimd.LoadUint8x64(x)
   825  		g := make([]int16, 32)
   826  		f(a).Store(g)
   827  		w := want(x)
   828  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   829  	})
   830  }
   831  
   832  // testUint16x32ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want.
   833  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   834  // (extended to at least 128 bits, or truncated to at most 512 bits).
   835  func testUint16x32ConvertToInt16(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Int16x32, want func(x []uint16) []int16) {
   836  	n := 32
   837  	t.Helper()
   838  	forSlice(t, uint16s, n, func(x []uint16) bool {
   839  		t.Helper()
   840  		a := archsimd.LoadUint16x32(x)
   841  		g := make([]int16, 32)
   842  		f(a).Store(g)
   843  		w := want(x)
   844  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   845  	})
   846  }
   847  
   848  // testUint32x16ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want.
   849  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   850  // (extended to at least 128 bits, or truncated to at most 512 bits).
   851  func testUint32x16ConvertToInt16(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Int16x16, want func(x []uint32) []int16) {
   852  	n := 16
   853  	t.Helper()
   854  	forSlice(t, uint32s, n, func(x []uint32) bool {
   855  		t.Helper()
   856  		a := archsimd.LoadUint32x16(x)
   857  		g := make([]int16, 16)
   858  		f(a).Store(g)
   859  		w := want(x)
   860  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   861  	})
   862  }
   863  
   864  // testUint64x8ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want.
   865  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   866  // (extended to at least 128 bits, or truncated to at most 512 bits).
   867  func testUint64x8ConvertToInt16(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Int16x8, want func(x []uint64) []int16) {
   868  	n := 8
   869  	t.Helper()
   870  	forSlice(t, uint64s, n, func(x []uint64) bool {
   871  		t.Helper()
   872  		a := archsimd.LoadUint64x8(x)
   873  		g := make([]int16, 8)
   874  		f(a).Store(g)
   875  		w := want(x)
   876  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   877  	})
   878  }
   879  
   880  // testFloat32x16ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want.
   881  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   882  // (extended to at least 128 bits, or truncated to at most 512 bits).
   883  func testFloat32x16ConvertToInt16(t *testing.T, f func(x archsimd.Float32x16) archsimd.Int16x16, want func(x []float32) []int16) {
   884  	n := 16
   885  	t.Helper()
   886  	forSlice(t, float32s, n, func(x []float32) bool {
   887  		t.Helper()
   888  		a := archsimd.LoadFloat32x16(x)
   889  		g := make([]int16, 16)
   890  		f(a).Store(g)
   891  		w := want(x)
   892  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   893  	})
   894  }
   895  
   896  // testFloat64x8ConvertToInt16 tests the simd conversion method f against the expected behavior generated by want.
   897  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   898  // (extended to at least 128 bits, or truncated to at most 512 bits).
   899  func testFloat64x8ConvertToInt16(t *testing.T, f func(x archsimd.Float64x8) archsimd.Int16x8, want func(x []float64) []int16) {
   900  	n := 8
   901  	t.Helper()
   902  	forSlice(t, float64s, n, func(x []float64) bool {
   903  		t.Helper()
   904  		a := archsimd.LoadFloat64x8(x)
   905  		g := make([]int16, 8)
   906  		f(a).Store(g)
   907  		w := want(x)
   908  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   909  	})
   910  }
   911  
   912  // testInt8x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want.
   913  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   914  // (extended to at least 128 bits, or truncated to at most 512 bits).
   915  func testInt8x16ConvertToUint16(t *testing.T, f func(x archsimd.Int8x16) archsimd.Uint16x16, want func(x []int8) []uint16) {
   916  	n := 16
   917  	t.Helper()
   918  	forSlice(t, int8s, n, func(x []int8) bool {
   919  		t.Helper()
   920  		a := archsimd.LoadInt8x16(x)
   921  		g := make([]uint16, 16)
   922  		f(a).Store(g)
   923  		w := want(x)
   924  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   925  	})
   926  }
   927  
   928  // testUint8x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want.
   929  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   930  // (extended to at least 128 bits, or truncated to at most 512 bits).
   931  func testUint8x16ConvertToUint16(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Uint16x16, want func(x []uint8) []uint16) {
   932  	n := 16
   933  	t.Helper()
   934  	forSlice(t, uint8s, n, func(x []uint8) bool {
   935  		t.Helper()
   936  		a := archsimd.LoadUint8x16(x)
   937  		g := make([]uint16, 16)
   938  		f(a).Store(g)
   939  		w := want(x)
   940  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   941  	})
   942  }
   943  
   944  // testInt8x32ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want.
   945  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   946  // (extended to at least 128 bits, or truncated to at most 512 bits).
   947  func testInt8x32ConvertToUint16(t *testing.T, f func(x archsimd.Int8x32) archsimd.Uint16x32, want func(x []int8) []uint16) {
   948  	n := 32
   949  	t.Helper()
   950  	forSlice(t, int8s, n, func(x []int8) bool {
   951  		t.Helper()
   952  		a := archsimd.LoadInt8x32(x)
   953  		g := make([]uint16, 32)
   954  		f(a).Store(g)
   955  		w := want(x)
   956  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   957  	})
   958  }
   959  
   960  // testInt16x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want.
   961  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   962  // (extended to at least 128 bits, or truncated to at most 512 bits).
   963  func testInt16x16ConvertToUint16(t *testing.T, f func(x archsimd.Int16x16) archsimd.Uint16x16, want func(x []int16) []uint16) {
   964  	n := 16
   965  	t.Helper()
   966  	forSlice(t, int16s, n, func(x []int16) bool {
   967  		t.Helper()
   968  		a := archsimd.LoadInt16x16(x)
   969  		g := make([]uint16, 16)
   970  		f(a).Store(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  // testInt32x8ConvertToUint16 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  // (extended to at least 128 bits, or truncated to at most 512 bits).
   979  func testInt32x8ConvertToUint16(t *testing.T, f func(x archsimd.Int32x8) archsimd.Uint16x8, want func(x []int32) []uint16) {
   980  	n := 8
   981  	t.Helper()
   982  	forSlice(t, int32s, n, func(x []int32) bool {
   983  		t.Helper()
   984  		a := archsimd.LoadInt32x8(x)
   985  		g := make([]uint16, 8)
   986  		f(a).Store(g)
   987  		w := want(x)
   988  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
   989  	})
   990  }
   991  
   992  // testInt64x4ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want.
   993  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
   994  // (extended to at least 128 bits, or truncated to at most 512 bits).
   995  func testInt64x4ConvertToUint16(t *testing.T, f func(x archsimd.Int64x4) archsimd.Uint16x8, want func(x []int64) []uint16) {
   996  	n := 4
   997  	t.Helper()
   998  	forSlice(t, int64s, n, func(x []int64) bool {
   999  		t.Helper()
  1000  		a := archsimd.LoadInt64x4(x)
  1001  		g := make([]uint16, 8)
  1002  		f(a).Store(g)
  1003  		w := want(x)
  1004  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1005  	})
  1006  }
  1007  
  1008  // testUint8x32ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want.
  1009  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1010  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1011  func testUint8x32ConvertToUint16(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Uint16x32, want func(x []uint8) []uint16) {
  1012  	n := 32
  1013  	t.Helper()
  1014  	forSlice(t, uint8s, n, func(x []uint8) bool {
  1015  		t.Helper()
  1016  		a := archsimd.LoadUint8x32(x)
  1017  		g := make([]uint16, 32)
  1018  		f(a).Store(g)
  1019  		w := want(x)
  1020  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1021  	})
  1022  }
  1023  
  1024  // testUint32x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want.
  1025  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1026  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1027  func testUint32x8ConvertToUint16(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Uint16x8, want func(x []uint32) []uint16) {
  1028  	n := 8
  1029  	t.Helper()
  1030  	forSlice(t, uint32s, n, func(x []uint32) bool {
  1031  		t.Helper()
  1032  		a := archsimd.LoadUint32x8(x)
  1033  		g := make([]uint16, 8)
  1034  		f(a).Store(g)
  1035  		w := want(x)
  1036  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1037  	})
  1038  }
  1039  
  1040  // testUint64x4ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want.
  1041  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1042  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1043  func testUint64x4ConvertToUint16(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Uint16x8, want func(x []uint64) []uint16) {
  1044  	n := 4
  1045  	t.Helper()
  1046  	forSlice(t, uint64s, n, func(x []uint64) bool {
  1047  		t.Helper()
  1048  		a := archsimd.LoadUint64x4(x)
  1049  		g := make([]uint16, 8)
  1050  		f(a).Store(g)
  1051  		w := want(x)
  1052  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1053  	})
  1054  }
  1055  
  1056  // testFloat32x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want.
  1057  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1058  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1059  func testFloat32x8ConvertToUint16(t *testing.T, f func(x archsimd.Float32x8) archsimd.Uint16x8, want func(x []float32) []uint16) {
  1060  	n := 8
  1061  	t.Helper()
  1062  	forSlice(t, float32s, n, func(x []float32) bool {
  1063  		t.Helper()
  1064  		a := archsimd.LoadFloat32x8(x)
  1065  		g := make([]uint16, 8)
  1066  		f(a).Store(g)
  1067  		w := want(x)
  1068  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1069  	})
  1070  }
  1071  
  1072  // testFloat64x4ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want.
  1073  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1074  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1075  func testFloat64x4ConvertToUint16(t *testing.T, f func(x archsimd.Float64x4) archsimd.Uint16x8, want func(x []float64) []uint16) {
  1076  	n := 4
  1077  	t.Helper()
  1078  	forSlice(t, float64s, n, func(x []float64) bool {
  1079  		t.Helper()
  1080  		a := archsimd.LoadFloat64x4(x)
  1081  		g := make([]uint16, 8)
  1082  		f(a).Store(g)
  1083  		w := want(x)
  1084  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1085  	})
  1086  }
  1087  
  1088  // testInt8x64ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want.
  1089  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1090  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1091  func testInt8x64ConvertToUint16(t *testing.T, f func(x archsimd.Int8x64) archsimd.Uint16x32, want func(x []int8) []uint16) {
  1092  	n := 64
  1093  	t.Helper()
  1094  	forSlice(t, int8s, n, func(x []int8) bool {
  1095  		t.Helper()
  1096  		a := archsimd.LoadInt8x64(x)
  1097  		g := make([]uint16, 32)
  1098  		f(a).Store(g)
  1099  		w := want(x)
  1100  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1101  	})
  1102  }
  1103  
  1104  // testInt16x32ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want.
  1105  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1106  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1107  func testInt16x32ConvertToUint16(t *testing.T, f func(x archsimd.Int16x32) archsimd.Uint16x32, want func(x []int16) []uint16) {
  1108  	n := 32
  1109  	t.Helper()
  1110  	forSlice(t, int16s, n, func(x []int16) bool {
  1111  		t.Helper()
  1112  		a := archsimd.LoadInt16x32(x)
  1113  		g := make([]uint16, 32)
  1114  		f(a).Store(g)
  1115  		w := want(x)
  1116  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1117  	})
  1118  }
  1119  
  1120  // testInt32x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want.
  1121  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1122  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1123  func testInt32x16ConvertToUint16(t *testing.T, f func(x archsimd.Int32x16) archsimd.Uint16x16, want func(x []int32) []uint16) {
  1124  	n := 16
  1125  	t.Helper()
  1126  	forSlice(t, int32s, n, func(x []int32) bool {
  1127  		t.Helper()
  1128  		a := archsimd.LoadInt32x16(x)
  1129  		g := make([]uint16, 16)
  1130  		f(a).Store(g)
  1131  		w := want(x)
  1132  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1133  	})
  1134  }
  1135  
  1136  // testInt64x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want.
  1137  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1138  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1139  func testInt64x8ConvertToUint16(t *testing.T, f func(x archsimd.Int64x8) archsimd.Uint16x8, want func(x []int64) []uint16) {
  1140  	n := 8
  1141  	t.Helper()
  1142  	forSlice(t, int64s, n, func(x []int64) bool {
  1143  		t.Helper()
  1144  		a := archsimd.LoadInt64x8(x)
  1145  		g := make([]uint16, 8)
  1146  		f(a).Store(g)
  1147  		w := want(x)
  1148  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1149  	})
  1150  }
  1151  
  1152  // testUint8x64ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want.
  1153  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1154  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1155  func testUint8x64ConvertToUint16(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Uint16x32, want func(x []uint8) []uint16) {
  1156  	n := 64
  1157  	t.Helper()
  1158  	forSlice(t, uint8s, n, func(x []uint8) bool {
  1159  		t.Helper()
  1160  		a := archsimd.LoadUint8x64(x)
  1161  		g := make([]uint16, 32)
  1162  		f(a).Store(g)
  1163  		w := want(x)
  1164  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1165  	})
  1166  }
  1167  
  1168  // testUint32x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want.
  1169  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1170  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1171  func testUint32x16ConvertToUint16(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Uint16x16, want func(x []uint32) []uint16) {
  1172  	n := 16
  1173  	t.Helper()
  1174  	forSlice(t, uint32s, n, func(x []uint32) bool {
  1175  		t.Helper()
  1176  		a := archsimd.LoadUint32x16(x)
  1177  		g := make([]uint16, 16)
  1178  		f(a).Store(g)
  1179  		w := want(x)
  1180  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1181  	})
  1182  }
  1183  
  1184  // testUint64x8ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want.
  1185  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1186  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1187  func testUint64x8ConvertToUint16(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Uint16x8, want func(x []uint64) []uint16) {
  1188  	n := 8
  1189  	t.Helper()
  1190  	forSlice(t, uint64s, n, func(x []uint64) bool {
  1191  		t.Helper()
  1192  		a := archsimd.LoadUint64x8(x)
  1193  		g := make([]uint16, 8)
  1194  		f(a).Store(g)
  1195  		w := want(x)
  1196  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1197  	})
  1198  }
  1199  
  1200  // testFloat32x16ConvertToUint16 tests the simd conversion method f against the expected behavior generated by want.
  1201  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1202  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1203  func testFloat32x16ConvertToUint16(t *testing.T, f func(x archsimd.Float32x16) archsimd.Uint16x16, want func(x []float32) []uint16) {
  1204  	n := 16
  1205  	t.Helper()
  1206  	forSlice(t, float32s, n, func(x []float32) bool {
  1207  		t.Helper()
  1208  		a := archsimd.LoadFloat32x16(x)
  1209  		g := make([]uint16, 16)
  1210  		f(a).Store(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  // testFloat64x8ConvertToUint16 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  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1219  func testFloat64x8ConvertToUint16(t *testing.T, f func(x archsimd.Float64x8) archsimd.Uint16x8, want func(x []float64) []uint16) {
  1220  	n := 8
  1221  	t.Helper()
  1222  	forSlice(t, float64s, n, func(x []float64) bool {
  1223  		t.Helper()
  1224  		a := archsimd.LoadFloat64x8(x)
  1225  		g := make([]uint16, 8)
  1226  		f(a).Store(g)
  1227  		w := want(x)
  1228  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1229  	})
  1230  }
  1231  
  1232  // testInt8x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want.
  1233  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1234  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1235  func testInt8x16ConvertToInt32(t *testing.T, f func(x archsimd.Int8x16) archsimd.Int32x16, want func(x []int8) []int32) {
  1236  	n := 16
  1237  	t.Helper()
  1238  	forSlice(t, int8s, n, func(x []int8) bool {
  1239  		t.Helper()
  1240  		a := archsimd.LoadInt8x16(x)
  1241  		g := make([]int32, 16)
  1242  		f(a).Store(g)
  1243  		w := want(x)
  1244  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1245  	})
  1246  }
  1247  
  1248  // testInt16x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want.
  1249  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1250  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1251  func testInt16x8ConvertToInt32(t *testing.T, f func(x archsimd.Int16x8) archsimd.Int32x8, want func(x []int16) []int32) {
  1252  	n := 8
  1253  	t.Helper()
  1254  	forSlice(t, int16s, n, func(x []int16) bool {
  1255  		t.Helper()
  1256  		a := archsimd.LoadInt16x8(x)
  1257  		g := make([]int32, 8)
  1258  		f(a).Store(g)
  1259  		w := want(x)
  1260  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1261  	})
  1262  }
  1263  
  1264  // testUint8x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want.
  1265  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1266  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1267  func testUint8x16ConvertToInt32(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Int32x16, want func(x []uint8) []int32) {
  1268  	n := 16
  1269  	t.Helper()
  1270  	forSlice(t, uint8s, n, func(x []uint8) bool {
  1271  		t.Helper()
  1272  		a := archsimd.LoadUint8x16(x)
  1273  		g := make([]int32, 16)
  1274  		f(a).Store(g)
  1275  		w := want(x)
  1276  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1277  	})
  1278  }
  1279  
  1280  // testUint16x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want.
  1281  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1282  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1283  func testUint16x8ConvertToInt32(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Int32x8, want func(x []uint16) []int32) {
  1284  	n := 8
  1285  	t.Helper()
  1286  	forSlice(t, uint16s, n, func(x []uint16) bool {
  1287  		t.Helper()
  1288  		a := archsimd.LoadUint16x8(x)
  1289  		g := make([]int32, 8)
  1290  		f(a).Store(g)
  1291  		w := want(x)
  1292  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1293  	})
  1294  }
  1295  
  1296  // testInt8x32ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want.
  1297  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1298  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1299  func testInt8x32ConvertToInt32(t *testing.T, f func(x archsimd.Int8x32) archsimd.Int32x16, want func(x []int8) []int32) {
  1300  	n := 32
  1301  	t.Helper()
  1302  	forSlice(t, int8s, n, func(x []int8) bool {
  1303  		t.Helper()
  1304  		a := archsimd.LoadInt8x32(x)
  1305  		g := make([]int32, 16)
  1306  		f(a).Store(g)
  1307  		w := want(x)
  1308  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1309  	})
  1310  }
  1311  
  1312  // testInt16x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want.
  1313  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1314  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1315  func testInt16x16ConvertToInt32(t *testing.T, f func(x archsimd.Int16x16) archsimd.Int32x16, want func(x []int16) []int32) {
  1316  	n := 16
  1317  	t.Helper()
  1318  	forSlice(t, int16s, n, func(x []int16) bool {
  1319  		t.Helper()
  1320  		a := archsimd.LoadInt16x16(x)
  1321  		g := make([]int32, 16)
  1322  		f(a).Store(g)
  1323  		w := want(x)
  1324  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1325  	})
  1326  }
  1327  
  1328  // testInt64x4ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want.
  1329  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1330  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1331  func testInt64x4ConvertToInt32(t *testing.T, f func(x archsimd.Int64x4) archsimd.Int32x4, want func(x []int64) []int32) {
  1332  	n := 4
  1333  	t.Helper()
  1334  	forSlice(t, int64s, n, func(x []int64) bool {
  1335  		t.Helper()
  1336  		a := archsimd.LoadInt64x4(x)
  1337  		g := make([]int32, 4)
  1338  		f(a).Store(g)
  1339  		w := want(x)
  1340  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1341  	})
  1342  }
  1343  
  1344  // testUint8x32ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want.
  1345  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1346  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1347  func testUint8x32ConvertToInt32(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Int32x16, want func(x []uint8) []int32) {
  1348  	n := 32
  1349  	t.Helper()
  1350  	forSlice(t, uint8s, n, func(x []uint8) bool {
  1351  		t.Helper()
  1352  		a := archsimd.LoadUint8x32(x)
  1353  		g := make([]int32, 16)
  1354  		f(a).Store(g)
  1355  		w := want(x)
  1356  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1357  	})
  1358  }
  1359  
  1360  // testUint16x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want.
  1361  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1362  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1363  func testUint16x16ConvertToInt32(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Int32x16, want func(x []uint16) []int32) {
  1364  	n := 16
  1365  	t.Helper()
  1366  	forSlice(t, uint16s, n, func(x []uint16) bool {
  1367  		t.Helper()
  1368  		a := archsimd.LoadUint16x16(x)
  1369  		g := make([]int32, 16)
  1370  		f(a).Store(g)
  1371  		w := want(x)
  1372  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1373  	})
  1374  }
  1375  
  1376  // testUint32x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want.
  1377  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1378  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1379  func testUint32x8ConvertToInt32(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Int32x8, want func(x []uint32) []int32) {
  1380  	n := 8
  1381  	t.Helper()
  1382  	forSlice(t, uint32s, n, func(x []uint32) bool {
  1383  		t.Helper()
  1384  		a := archsimd.LoadUint32x8(x)
  1385  		g := make([]int32, 8)
  1386  		f(a).Store(g)
  1387  		w := want(x)
  1388  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1389  	})
  1390  }
  1391  
  1392  // testUint64x4ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want.
  1393  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1394  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1395  func testUint64x4ConvertToInt32(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Int32x4, want func(x []uint64) []int32) {
  1396  	n := 4
  1397  	t.Helper()
  1398  	forSlice(t, uint64s, n, func(x []uint64) bool {
  1399  		t.Helper()
  1400  		a := archsimd.LoadUint64x4(x)
  1401  		g := make([]int32, 4)
  1402  		f(a).Store(g)
  1403  		w := want(x)
  1404  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1405  	})
  1406  }
  1407  
  1408  // testFloat32x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want.
  1409  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1410  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1411  func testFloat32x8ConvertToInt32(t *testing.T, f func(x archsimd.Float32x8) archsimd.Int32x8, want func(x []float32) []int32) {
  1412  	n := 8
  1413  	t.Helper()
  1414  	forSlice(t, float32s, n, func(x []float32) bool {
  1415  		t.Helper()
  1416  		a := archsimd.LoadFloat32x8(x)
  1417  		g := make([]int32, 8)
  1418  		f(a).Store(g)
  1419  		w := want(x)
  1420  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1421  	})
  1422  }
  1423  
  1424  // testFloat64x4ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want.
  1425  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1426  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1427  func testFloat64x4ConvertToInt32(t *testing.T, f func(x archsimd.Float64x4) archsimd.Int32x4, want func(x []float64) []int32) {
  1428  	n := 4
  1429  	t.Helper()
  1430  	forSlice(t, float64s, n, func(x []float64) bool {
  1431  		t.Helper()
  1432  		a := archsimd.LoadFloat64x4(x)
  1433  		g := make([]int32, 4)
  1434  		f(a).Store(g)
  1435  		w := want(x)
  1436  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1437  	})
  1438  }
  1439  
  1440  // testInt8x64ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want.
  1441  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1442  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1443  func testInt8x64ConvertToInt32(t *testing.T, f func(x archsimd.Int8x64) archsimd.Int32x16, want func(x []int8) []int32) {
  1444  	n := 64
  1445  	t.Helper()
  1446  	forSlice(t, int8s, n, func(x []int8) bool {
  1447  		t.Helper()
  1448  		a := archsimd.LoadInt8x64(x)
  1449  		g := make([]int32, 16)
  1450  		f(a).Store(g)
  1451  		w := want(x)
  1452  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1453  	})
  1454  }
  1455  
  1456  // testInt16x32ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want.
  1457  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1458  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1459  func testInt16x32ConvertToInt32(t *testing.T, f func(x archsimd.Int16x32) archsimd.Int32x16, want func(x []int16) []int32) {
  1460  	n := 32
  1461  	t.Helper()
  1462  	forSlice(t, int16s, n, func(x []int16) bool {
  1463  		t.Helper()
  1464  		a := archsimd.LoadInt16x32(x)
  1465  		g := make([]int32, 16)
  1466  		f(a).Store(g)
  1467  		w := want(x)
  1468  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1469  	})
  1470  }
  1471  
  1472  // testInt64x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want.
  1473  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1474  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1475  func testInt64x8ConvertToInt32(t *testing.T, f func(x archsimd.Int64x8) archsimd.Int32x8, want func(x []int64) []int32) {
  1476  	n := 8
  1477  	t.Helper()
  1478  	forSlice(t, int64s, n, func(x []int64) bool {
  1479  		t.Helper()
  1480  		a := archsimd.LoadInt64x8(x)
  1481  		g := make([]int32, 8)
  1482  		f(a).Store(g)
  1483  		w := want(x)
  1484  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1485  	})
  1486  }
  1487  
  1488  // testUint8x64ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want.
  1489  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1490  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1491  func testUint8x64ConvertToInt32(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Int32x16, want func(x []uint8) []int32) {
  1492  	n := 64
  1493  	t.Helper()
  1494  	forSlice(t, uint8s, n, func(x []uint8) bool {
  1495  		t.Helper()
  1496  		a := archsimd.LoadUint8x64(x)
  1497  		g := make([]int32, 16)
  1498  		f(a).Store(g)
  1499  		w := want(x)
  1500  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1501  	})
  1502  }
  1503  
  1504  // testUint16x32ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want.
  1505  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1506  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1507  func testUint16x32ConvertToInt32(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Int32x16, want func(x []uint16) []int32) {
  1508  	n := 32
  1509  	t.Helper()
  1510  	forSlice(t, uint16s, n, func(x []uint16) bool {
  1511  		t.Helper()
  1512  		a := archsimd.LoadUint16x32(x)
  1513  		g := make([]int32, 16)
  1514  		f(a).Store(g)
  1515  		w := want(x)
  1516  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1517  	})
  1518  }
  1519  
  1520  // testUint32x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want.
  1521  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1522  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1523  func testUint32x16ConvertToInt32(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Int32x16, want func(x []uint32) []int32) {
  1524  	n := 16
  1525  	t.Helper()
  1526  	forSlice(t, uint32s, n, func(x []uint32) bool {
  1527  		t.Helper()
  1528  		a := archsimd.LoadUint32x16(x)
  1529  		g := make([]int32, 16)
  1530  		f(a).Store(g)
  1531  		w := want(x)
  1532  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1533  	})
  1534  }
  1535  
  1536  // testUint64x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want.
  1537  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1538  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1539  func testUint64x8ConvertToInt32(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Int32x8, want func(x []uint64) []int32) {
  1540  	n := 8
  1541  	t.Helper()
  1542  	forSlice(t, uint64s, n, func(x []uint64) bool {
  1543  		t.Helper()
  1544  		a := archsimd.LoadUint64x8(x)
  1545  		g := make([]int32, 8)
  1546  		f(a).Store(g)
  1547  		w := want(x)
  1548  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1549  	})
  1550  }
  1551  
  1552  // testFloat32x16ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want.
  1553  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1554  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1555  func testFloat32x16ConvertToInt32(t *testing.T, f func(x archsimd.Float32x16) archsimd.Int32x16, want func(x []float32) []int32) {
  1556  	n := 16
  1557  	t.Helper()
  1558  	forSlice(t, float32s, n, func(x []float32) bool {
  1559  		t.Helper()
  1560  		a := archsimd.LoadFloat32x16(x)
  1561  		g := make([]int32, 16)
  1562  		f(a).Store(g)
  1563  		w := want(x)
  1564  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1565  	})
  1566  }
  1567  
  1568  // testFloat64x8ConvertToInt32 tests the simd conversion method f against the expected behavior generated by want.
  1569  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1570  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1571  func testFloat64x8ConvertToInt32(t *testing.T, f func(x archsimd.Float64x8) archsimd.Int32x8, want func(x []float64) []int32) {
  1572  	n := 8
  1573  	t.Helper()
  1574  	forSlice(t, float64s, n, func(x []float64) bool {
  1575  		t.Helper()
  1576  		a := archsimd.LoadFloat64x8(x)
  1577  		g := make([]int32, 8)
  1578  		f(a).Store(g)
  1579  		w := want(x)
  1580  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1581  	})
  1582  }
  1583  
  1584  // testInt8x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want.
  1585  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1586  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1587  func testInt8x16ConvertToUint32(t *testing.T, f func(x archsimd.Int8x16) archsimd.Uint32x16, want func(x []int8) []uint32) {
  1588  	n := 16
  1589  	t.Helper()
  1590  	forSlice(t, int8s, n, func(x []int8) bool {
  1591  		t.Helper()
  1592  		a := archsimd.LoadInt8x16(x)
  1593  		g := make([]uint32, 16)
  1594  		f(a).Store(g)
  1595  		w := want(x)
  1596  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1597  	})
  1598  }
  1599  
  1600  // testInt16x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want.
  1601  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1602  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1603  func testInt16x8ConvertToUint32(t *testing.T, f func(x archsimd.Int16x8) archsimd.Uint32x8, want func(x []int16) []uint32) {
  1604  	n := 8
  1605  	t.Helper()
  1606  	forSlice(t, int16s, n, func(x []int16) bool {
  1607  		t.Helper()
  1608  		a := archsimd.LoadInt16x8(x)
  1609  		g := make([]uint32, 8)
  1610  		f(a).Store(g)
  1611  		w := want(x)
  1612  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1613  	})
  1614  }
  1615  
  1616  // testUint8x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want.
  1617  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1618  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1619  func testUint8x16ConvertToUint32(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Uint32x16, want func(x []uint8) []uint32) {
  1620  	n := 16
  1621  	t.Helper()
  1622  	forSlice(t, uint8s, n, func(x []uint8) bool {
  1623  		t.Helper()
  1624  		a := archsimd.LoadUint8x16(x)
  1625  		g := make([]uint32, 16)
  1626  		f(a).Store(g)
  1627  		w := want(x)
  1628  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1629  	})
  1630  }
  1631  
  1632  // testUint16x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want.
  1633  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1634  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1635  func testUint16x8ConvertToUint32(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Uint32x8, want func(x []uint16) []uint32) {
  1636  	n := 8
  1637  	t.Helper()
  1638  	forSlice(t, uint16s, n, func(x []uint16) bool {
  1639  		t.Helper()
  1640  		a := archsimd.LoadUint16x8(x)
  1641  		g := make([]uint32, 8)
  1642  		f(a).Store(g)
  1643  		w := want(x)
  1644  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1645  	})
  1646  }
  1647  
  1648  // testInt8x32ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want.
  1649  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1650  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1651  func testInt8x32ConvertToUint32(t *testing.T, f func(x archsimd.Int8x32) archsimd.Uint32x16, want func(x []int8) []uint32) {
  1652  	n := 32
  1653  	t.Helper()
  1654  	forSlice(t, int8s, n, func(x []int8) bool {
  1655  		t.Helper()
  1656  		a := archsimd.LoadInt8x32(x)
  1657  		g := make([]uint32, 16)
  1658  		f(a).Store(g)
  1659  		w := want(x)
  1660  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1661  	})
  1662  }
  1663  
  1664  // testInt16x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want.
  1665  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1666  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1667  func testInt16x16ConvertToUint32(t *testing.T, f func(x archsimd.Int16x16) archsimd.Uint32x16, want func(x []int16) []uint32) {
  1668  	n := 16
  1669  	t.Helper()
  1670  	forSlice(t, int16s, n, func(x []int16) bool {
  1671  		t.Helper()
  1672  		a := archsimd.LoadInt16x16(x)
  1673  		g := make([]uint32, 16)
  1674  		f(a).Store(g)
  1675  		w := want(x)
  1676  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1677  	})
  1678  }
  1679  
  1680  // testInt32x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want.
  1681  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1682  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1683  func testInt32x8ConvertToUint32(t *testing.T, f func(x archsimd.Int32x8) archsimd.Uint32x8, want func(x []int32) []uint32) {
  1684  	n := 8
  1685  	t.Helper()
  1686  	forSlice(t, int32s, n, func(x []int32) bool {
  1687  		t.Helper()
  1688  		a := archsimd.LoadInt32x8(x)
  1689  		g := make([]uint32, 8)
  1690  		f(a).Store(g)
  1691  		w := want(x)
  1692  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1693  	})
  1694  }
  1695  
  1696  // testInt64x4ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want.
  1697  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1698  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1699  func testInt64x4ConvertToUint32(t *testing.T, f func(x archsimd.Int64x4) archsimd.Uint32x4, want func(x []int64) []uint32) {
  1700  	n := 4
  1701  	t.Helper()
  1702  	forSlice(t, int64s, n, func(x []int64) bool {
  1703  		t.Helper()
  1704  		a := archsimd.LoadInt64x4(x)
  1705  		g := make([]uint32, 4)
  1706  		f(a).Store(g)
  1707  		w := want(x)
  1708  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1709  	})
  1710  }
  1711  
  1712  // testUint8x32ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want.
  1713  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1714  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1715  func testUint8x32ConvertToUint32(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Uint32x16, want func(x []uint8) []uint32) {
  1716  	n := 32
  1717  	t.Helper()
  1718  	forSlice(t, uint8s, n, func(x []uint8) bool {
  1719  		t.Helper()
  1720  		a := archsimd.LoadUint8x32(x)
  1721  		g := make([]uint32, 16)
  1722  		f(a).Store(g)
  1723  		w := want(x)
  1724  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1725  	})
  1726  }
  1727  
  1728  // testUint16x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want.
  1729  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1730  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1731  func testUint16x16ConvertToUint32(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Uint32x16, want func(x []uint16) []uint32) {
  1732  	n := 16
  1733  	t.Helper()
  1734  	forSlice(t, uint16s, n, func(x []uint16) bool {
  1735  		t.Helper()
  1736  		a := archsimd.LoadUint16x16(x)
  1737  		g := make([]uint32, 16)
  1738  		f(a).Store(g)
  1739  		w := want(x)
  1740  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1741  	})
  1742  }
  1743  
  1744  // testUint64x4ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want.
  1745  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1746  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1747  func testUint64x4ConvertToUint32(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Uint32x4, want func(x []uint64) []uint32) {
  1748  	n := 4
  1749  	t.Helper()
  1750  	forSlice(t, uint64s, n, func(x []uint64) bool {
  1751  		t.Helper()
  1752  		a := archsimd.LoadUint64x4(x)
  1753  		g := make([]uint32, 4)
  1754  		f(a).Store(g)
  1755  		w := want(x)
  1756  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1757  	})
  1758  }
  1759  
  1760  // testFloat32x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want.
  1761  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1762  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1763  func testFloat32x8ConvertToUint32(t *testing.T, f func(x archsimd.Float32x8) archsimd.Uint32x8, want func(x []float32) []uint32) {
  1764  	n := 8
  1765  	t.Helper()
  1766  	forSlice(t, float32s, n, func(x []float32) bool {
  1767  		t.Helper()
  1768  		a := archsimd.LoadFloat32x8(x)
  1769  		g := make([]uint32, 8)
  1770  		f(a).Store(g)
  1771  		w := want(x)
  1772  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1773  	})
  1774  }
  1775  
  1776  // testFloat64x4ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want.
  1777  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1778  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1779  func testFloat64x4ConvertToUint32(t *testing.T, f func(x archsimd.Float64x4) archsimd.Uint32x4, want func(x []float64) []uint32) {
  1780  	n := 4
  1781  	t.Helper()
  1782  	forSlice(t, float64s, n, func(x []float64) bool {
  1783  		t.Helper()
  1784  		a := archsimd.LoadFloat64x4(x)
  1785  		g := make([]uint32, 4)
  1786  		f(a).Store(g)
  1787  		w := want(x)
  1788  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1789  	})
  1790  }
  1791  
  1792  // testInt8x64ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want.
  1793  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1794  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1795  func testInt8x64ConvertToUint32(t *testing.T, f func(x archsimd.Int8x64) archsimd.Uint32x16, want func(x []int8) []uint32) {
  1796  	n := 64
  1797  	t.Helper()
  1798  	forSlice(t, int8s, n, func(x []int8) bool {
  1799  		t.Helper()
  1800  		a := archsimd.LoadInt8x64(x)
  1801  		g := make([]uint32, 16)
  1802  		f(a).Store(g)
  1803  		w := want(x)
  1804  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1805  	})
  1806  }
  1807  
  1808  // testInt16x32ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want.
  1809  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1810  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1811  func testInt16x32ConvertToUint32(t *testing.T, f func(x archsimd.Int16x32) archsimd.Uint32x16, want func(x []int16) []uint32) {
  1812  	n := 32
  1813  	t.Helper()
  1814  	forSlice(t, int16s, n, func(x []int16) bool {
  1815  		t.Helper()
  1816  		a := archsimd.LoadInt16x32(x)
  1817  		g := make([]uint32, 16)
  1818  		f(a).Store(g)
  1819  		w := want(x)
  1820  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1821  	})
  1822  }
  1823  
  1824  // testInt32x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want.
  1825  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1826  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1827  func testInt32x16ConvertToUint32(t *testing.T, f func(x archsimd.Int32x16) archsimd.Uint32x16, want func(x []int32) []uint32) {
  1828  	n := 16
  1829  	t.Helper()
  1830  	forSlice(t, int32s, n, func(x []int32) bool {
  1831  		t.Helper()
  1832  		a := archsimd.LoadInt32x16(x)
  1833  		g := make([]uint32, 16)
  1834  		f(a).Store(g)
  1835  		w := want(x)
  1836  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1837  	})
  1838  }
  1839  
  1840  // testInt64x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want.
  1841  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1842  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1843  func testInt64x8ConvertToUint32(t *testing.T, f func(x archsimd.Int64x8) archsimd.Uint32x8, want func(x []int64) []uint32) {
  1844  	n := 8
  1845  	t.Helper()
  1846  	forSlice(t, int64s, n, func(x []int64) bool {
  1847  		t.Helper()
  1848  		a := archsimd.LoadInt64x8(x)
  1849  		g := make([]uint32, 8)
  1850  		f(a).Store(g)
  1851  		w := want(x)
  1852  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1853  	})
  1854  }
  1855  
  1856  // testUint8x64ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want.
  1857  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1858  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1859  func testUint8x64ConvertToUint32(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Uint32x16, want func(x []uint8) []uint32) {
  1860  	n := 64
  1861  	t.Helper()
  1862  	forSlice(t, uint8s, n, func(x []uint8) bool {
  1863  		t.Helper()
  1864  		a := archsimd.LoadUint8x64(x)
  1865  		g := make([]uint32, 16)
  1866  		f(a).Store(g)
  1867  		w := want(x)
  1868  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1869  	})
  1870  }
  1871  
  1872  // testUint16x32ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want.
  1873  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1874  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1875  func testUint16x32ConvertToUint32(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Uint32x16, want func(x []uint16) []uint32) {
  1876  	n := 32
  1877  	t.Helper()
  1878  	forSlice(t, uint16s, n, func(x []uint16) bool {
  1879  		t.Helper()
  1880  		a := archsimd.LoadUint16x32(x)
  1881  		g := make([]uint32, 16)
  1882  		f(a).Store(g)
  1883  		w := want(x)
  1884  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1885  	})
  1886  }
  1887  
  1888  // testUint64x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want.
  1889  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1890  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1891  func testUint64x8ConvertToUint32(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Uint32x8, want func(x []uint64) []uint32) {
  1892  	n := 8
  1893  	t.Helper()
  1894  	forSlice(t, uint64s, n, func(x []uint64) bool {
  1895  		t.Helper()
  1896  		a := archsimd.LoadUint64x8(x)
  1897  		g := make([]uint32, 8)
  1898  		f(a).Store(g)
  1899  		w := want(x)
  1900  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1901  	})
  1902  }
  1903  
  1904  // testFloat32x16ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want.
  1905  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1906  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1907  func testFloat32x16ConvertToUint32(t *testing.T, f func(x archsimd.Float32x16) archsimd.Uint32x16, want func(x []float32) []uint32) {
  1908  	n := 16
  1909  	t.Helper()
  1910  	forSlice(t, float32s, n, func(x []float32) bool {
  1911  		t.Helper()
  1912  		a := archsimd.LoadFloat32x16(x)
  1913  		g := make([]uint32, 16)
  1914  		f(a).Store(g)
  1915  		w := want(x)
  1916  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1917  	})
  1918  }
  1919  
  1920  // testFloat64x8ConvertToUint32 tests the simd conversion method f against the expected behavior generated by want.
  1921  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1922  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1923  func testFloat64x8ConvertToUint32(t *testing.T, f func(x archsimd.Float64x8) archsimd.Uint32x8, want func(x []float64) []uint32) {
  1924  	n := 8
  1925  	t.Helper()
  1926  	forSlice(t, float64s, n, func(x []float64) bool {
  1927  		t.Helper()
  1928  		a := archsimd.LoadFloat64x8(x)
  1929  		g := make([]uint32, 8)
  1930  		f(a).Store(g)
  1931  		w := want(x)
  1932  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1933  	})
  1934  }
  1935  
  1936  // testInt8x16ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  1937  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1938  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1939  func testInt8x16ConvertToInt64(t *testing.T, f func(x archsimd.Int8x16) archsimd.Int64x8, want func(x []int8) []int64) {
  1940  	n := 16
  1941  	t.Helper()
  1942  	forSlice(t, int8s, n, func(x []int8) bool {
  1943  		t.Helper()
  1944  		a := archsimd.LoadInt8x16(x)
  1945  		g := make([]int64, 8)
  1946  		f(a).Store(g)
  1947  		w := want(x)
  1948  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1949  	})
  1950  }
  1951  
  1952  // testInt16x8ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  1953  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1954  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1955  func testInt16x8ConvertToInt64(t *testing.T, f func(x archsimd.Int16x8) archsimd.Int64x8, want func(x []int16) []int64) {
  1956  	n := 8
  1957  	t.Helper()
  1958  	forSlice(t, int16s, n, func(x []int16) bool {
  1959  		t.Helper()
  1960  		a := archsimd.LoadInt16x8(x)
  1961  		g := make([]int64, 8)
  1962  		f(a).Store(g)
  1963  		w := want(x)
  1964  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1965  	})
  1966  }
  1967  
  1968  // testInt32x4ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  1969  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1970  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1971  func testInt32x4ConvertToInt64(t *testing.T, f func(x archsimd.Int32x4) archsimd.Int64x4, want func(x []int32) []int64) {
  1972  	n := 4
  1973  	t.Helper()
  1974  	forSlice(t, int32s, n, func(x []int32) bool {
  1975  		t.Helper()
  1976  		a := archsimd.LoadInt32x4(x)
  1977  		g := make([]int64, 4)
  1978  		f(a).Store(g)
  1979  		w := want(x)
  1980  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1981  	})
  1982  }
  1983  
  1984  // testUint8x16ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  1985  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  1986  // (extended to at least 128 bits, or truncated to at most 512 bits).
  1987  func testUint8x16ConvertToInt64(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Int64x8, want func(x []uint8) []int64) {
  1988  	n := 16
  1989  	t.Helper()
  1990  	forSlice(t, uint8s, n, func(x []uint8) bool {
  1991  		t.Helper()
  1992  		a := archsimd.LoadUint8x16(x)
  1993  		g := make([]int64, 8)
  1994  		f(a).Store(g)
  1995  		w := want(x)
  1996  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  1997  	})
  1998  }
  1999  
  2000  // testUint16x8ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  2001  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2002  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2003  func testUint16x8ConvertToInt64(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Int64x8, want func(x []uint16) []int64) {
  2004  	n := 8
  2005  	t.Helper()
  2006  	forSlice(t, uint16s, n, func(x []uint16) bool {
  2007  		t.Helper()
  2008  		a := archsimd.LoadUint16x8(x)
  2009  		g := make([]int64, 8)
  2010  		f(a).Store(g)
  2011  		w := want(x)
  2012  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2013  	})
  2014  }
  2015  
  2016  // testUint32x4ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  2017  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2018  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2019  func testUint32x4ConvertToInt64(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Int64x4, want func(x []uint32) []int64) {
  2020  	n := 4
  2021  	t.Helper()
  2022  	forSlice(t, uint32s, n, func(x []uint32) bool {
  2023  		t.Helper()
  2024  		a := archsimd.LoadUint32x4(x)
  2025  		g := make([]int64, 4)
  2026  		f(a).Store(g)
  2027  		w := want(x)
  2028  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2029  	})
  2030  }
  2031  
  2032  // testFloat32x4ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  2033  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2034  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2035  func testFloat32x4ConvertToInt64(t *testing.T, f func(x archsimd.Float32x4) archsimd.Int64x4, want func(x []float32) []int64) {
  2036  	n := 4
  2037  	t.Helper()
  2038  	forSlice(t, float32s, n, func(x []float32) bool {
  2039  		t.Helper()
  2040  		a := archsimd.LoadFloat32x4(x)
  2041  		g := make([]int64, 4)
  2042  		f(a).Store(g)
  2043  		w := want(x)
  2044  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2045  	})
  2046  }
  2047  
  2048  // testInt8x32ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  2049  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2050  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2051  func testInt8x32ConvertToInt64(t *testing.T, f func(x archsimd.Int8x32) archsimd.Int64x8, want func(x []int8) []int64) {
  2052  	n := 32
  2053  	t.Helper()
  2054  	forSlice(t, int8s, n, func(x []int8) bool {
  2055  		t.Helper()
  2056  		a := archsimd.LoadInt8x32(x)
  2057  		g := make([]int64, 8)
  2058  		f(a).Store(g)
  2059  		w := want(x)
  2060  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2061  	})
  2062  }
  2063  
  2064  // testInt16x16ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  2065  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2066  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2067  func testInt16x16ConvertToInt64(t *testing.T, f func(x archsimd.Int16x16) archsimd.Int64x8, want func(x []int16) []int64) {
  2068  	n := 16
  2069  	t.Helper()
  2070  	forSlice(t, int16s, n, func(x []int16) bool {
  2071  		t.Helper()
  2072  		a := archsimd.LoadInt16x16(x)
  2073  		g := make([]int64, 8)
  2074  		f(a).Store(g)
  2075  		w := want(x)
  2076  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2077  	})
  2078  }
  2079  
  2080  // testInt32x8ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  2081  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2082  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2083  func testInt32x8ConvertToInt64(t *testing.T, f func(x archsimd.Int32x8) archsimd.Int64x8, want func(x []int32) []int64) {
  2084  	n := 8
  2085  	t.Helper()
  2086  	forSlice(t, int32s, n, func(x []int32) bool {
  2087  		t.Helper()
  2088  		a := archsimd.LoadInt32x8(x)
  2089  		g := make([]int64, 8)
  2090  		f(a).Store(g)
  2091  		w := want(x)
  2092  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2093  	})
  2094  }
  2095  
  2096  // testUint8x32ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  2097  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2098  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2099  func testUint8x32ConvertToInt64(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Int64x8, want func(x []uint8) []int64) {
  2100  	n := 32
  2101  	t.Helper()
  2102  	forSlice(t, uint8s, n, func(x []uint8) bool {
  2103  		t.Helper()
  2104  		a := archsimd.LoadUint8x32(x)
  2105  		g := make([]int64, 8)
  2106  		f(a).Store(g)
  2107  		w := want(x)
  2108  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2109  	})
  2110  }
  2111  
  2112  // testUint16x16ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  2113  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2114  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2115  func testUint16x16ConvertToInt64(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Int64x8, want func(x []uint16) []int64) {
  2116  	n := 16
  2117  	t.Helper()
  2118  	forSlice(t, uint16s, n, func(x []uint16) bool {
  2119  		t.Helper()
  2120  		a := archsimd.LoadUint16x16(x)
  2121  		g := make([]int64, 8)
  2122  		f(a).Store(g)
  2123  		w := want(x)
  2124  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2125  	})
  2126  }
  2127  
  2128  // testUint32x8ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  2129  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2130  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2131  func testUint32x8ConvertToInt64(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Int64x8, want func(x []uint32) []int64) {
  2132  	n := 8
  2133  	t.Helper()
  2134  	forSlice(t, uint32s, n, func(x []uint32) bool {
  2135  		t.Helper()
  2136  		a := archsimd.LoadUint32x8(x)
  2137  		g := make([]int64, 8)
  2138  		f(a).Store(g)
  2139  		w := want(x)
  2140  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2141  	})
  2142  }
  2143  
  2144  // testUint64x4ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  2145  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2146  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2147  func testUint64x4ConvertToInt64(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Int64x4, want func(x []uint64) []int64) {
  2148  	n := 4
  2149  	t.Helper()
  2150  	forSlice(t, uint64s, n, func(x []uint64) bool {
  2151  		t.Helper()
  2152  		a := archsimd.LoadUint64x4(x)
  2153  		g := make([]int64, 4)
  2154  		f(a).Store(g)
  2155  		w := want(x)
  2156  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2157  	})
  2158  }
  2159  
  2160  // testFloat32x8ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  2161  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2162  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2163  func testFloat32x8ConvertToInt64(t *testing.T, f func(x archsimd.Float32x8) archsimd.Int64x8, want func(x []float32) []int64) {
  2164  	n := 8
  2165  	t.Helper()
  2166  	forSlice(t, float32s, n, func(x []float32) bool {
  2167  		t.Helper()
  2168  		a := archsimd.LoadFloat32x8(x)
  2169  		g := make([]int64, 8)
  2170  		f(a).Store(g)
  2171  		w := want(x)
  2172  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2173  	})
  2174  }
  2175  
  2176  // testFloat64x4ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  2177  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2178  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2179  func testFloat64x4ConvertToInt64(t *testing.T, f func(x archsimd.Float64x4) archsimd.Int64x4, want func(x []float64) []int64) {
  2180  	n := 4
  2181  	t.Helper()
  2182  	forSlice(t, float64s, n, func(x []float64) bool {
  2183  		t.Helper()
  2184  		a := archsimd.LoadFloat64x4(x)
  2185  		g := make([]int64, 4)
  2186  		f(a).Store(g)
  2187  		w := want(x)
  2188  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2189  	})
  2190  }
  2191  
  2192  // testInt8x64ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  2193  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2194  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2195  func testInt8x64ConvertToInt64(t *testing.T, f func(x archsimd.Int8x64) archsimd.Int64x8, want func(x []int8) []int64) {
  2196  	n := 64
  2197  	t.Helper()
  2198  	forSlice(t, int8s, n, func(x []int8) bool {
  2199  		t.Helper()
  2200  		a := archsimd.LoadInt8x64(x)
  2201  		g := make([]int64, 8)
  2202  		f(a).Store(g)
  2203  		w := want(x)
  2204  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2205  	})
  2206  }
  2207  
  2208  // testInt16x32ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  2209  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2210  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2211  func testInt16x32ConvertToInt64(t *testing.T, f func(x archsimd.Int16x32) archsimd.Int64x8, want func(x []int16) []int64) {
  2212  	n := 32
  2213  	t.Helper()
  2214  	forSlice(t, int16s, n, func(x []int16) bool {
  2215  		t.Helper()
  2216  		a := archsimd.LoadInt16x32(x)
  2217  		g := make([]int64, 8)
  2218  		f(a).Store(g)
  2219  		w := want(x)
  2220  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2221  	})
  2222  }
  2223  
  2224  // testInt32x16ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  2225  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2226  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2227  func testInt32x16ConvertToInt64(t *testing.T, f func(x archsimd.Int32x16) archsimd.Int64x8, want func(x []int32) []int64) {
  2228  	n := 16
  2229  	t.Helper()
  2230  	forSlice(t, int32s, n, func(x []int32) bool {
  2231  		t.Helper()
  2232  		a := archsimd.LoadInt32x16(x)
  2233  		g := make([]int64, 8)
  2234  		f(a).Store(g)
  2235  		w := want(x)
  2236  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2237  	})
  2238  }
  2239  
  2240  // testUint8x64ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  2241  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2242  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2243  func testUint8x64ConvertToInt64(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Int64x8, want func(x []uint8) []int64) {
  2244  	n := 64
  2245  	t.Helper()
  2246  	forSlice(t, uint8s, n, func(x []uint8) bool {
  2247  		t.Helper()
  2248  		a := archsimd.LoadUint8x64(x)
  2249  		g := make([]int64, 8)
  2250  		f(a).Store(g)
  2251  		w := want(x)
  2252  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2253  	})
  2254  }
  2255  
  2256  // testUint16x32ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  2257  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2258  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2259  func testUint16x32ConvertToInt64(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Int64x8, want func(x []uint16) []int64) {
  2260  	n := 32
  2261  	t.Helper()
  2262  	forSlice(t, uint16s, n, func(x []uint16) bool {
  2263  		t.Helper()
  2264  		a := archsimd.LoadUint16x32(x)
  2265  		g := make([]int64, 8)
  2266  		f(a).Store(g)
  2267  		w := want(x)
  2268  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2269  	})
  2270  }
  2271  
  2272  // testUint32x16ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  2273  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2274  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2275  func testUint32x16ConvertToInt64(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Int64x8, want func(x []uint32) []int64) {
  2276  	n := 16
  2277  	t.Helper()
  2278  	forSlice(t, uint32s, n, func(x []uint32) bool {
  2279  		t.Helper()
  2280  		a := archsimd.LoadUint32x16(x)
  2281  		g := make([]int64, 8)
  2282  		f(a).Store(g)
  2283  		w := want(x)
  2284  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2285  	})
  2286  }
  2287  
  2288  // testUint64x8ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  2289  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2290  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2291  func testUint64x8ConvertToInt64(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Int64x8, want func(x []uint64) []int64) {
  2292  	n := 8
  2293  	t.Helper()
  2294  	forSlice(t, uint64s, n, func(x []uint64) bool {
  2295  		t.Helper()
  2296  		a := archsimd.LoadUint64x8(x)
  2297  		g := make([]int64, 8)
  2298  		f(a).Store(g)
  2299  		w := want(x)
  2300  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2301  	})
  2302  }
  2303  
  2304  // testFloat32x16ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  2305  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2306  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2307  func testFloat32x16ConvertToInt64(t *testing.T, f func(x archsimd.Float32x16) archsimd.Int64x8, want func(x []float32) []int64) {
  2308  	n := 16
  2309  	t.Helper()
  2310  	forSlice(t, float32s, n, func(x []float32) bool {
  2311  		t.Helper()
  2312  		a := archsimd.LoadFloat32x16(x)
  2313  		g := make([]int64, 8)
  2314  		f(a).Store(g)
  2315  		w := want(x)
  2316  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2317  	})
  2318  }
  2319  
  2320  // testFloat64x8ConvertToInt64 tests the simd conversion method f against the expected behavior generated by want.
  2321  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2322  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2323  func testFloat64x8ConvertToInt64(t *testing.T, f func(x archsimd.Float64x8) archsimd.Int64x8, want func(x []float64) []int64) {
  2324  	n := 8
  2325  	t.Helper()
  2326  	forSlice(t, float64s, n, func(x []float64) bool {
  2327  		t.Helper()
  2328  		a := archsimd.LoadFloat64x8(x)
  2329  		g := make([]int64, 8)
  2330  		f(a).Store(g)
  2331  		w := want(x)
  2332  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2333  	})
  2334  }
  2335  
  2336  // testInt8x16ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2337  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2338  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2339  func testInt8x16ConvertToUint64(t *testing.T, f func(x archsimd.Int8x16) archsimd.Uint64x8, want func(x []int8) []uint64) {
  2340  	n := 16
  2341  	t.Helper()
  2342  	forSlice(t, int8s, n, func(x []int8) bool {
  2343  		t.Helper()
  2344  		a := archsimd.LoadInt8x16(x)
  2345  		g := make([]uint64, 8)
  2346  		f(a).Store(g)
  2347  		w := want(x)
  2348  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2349  	})
  2350  }
  2351  
  2352  // testInt16x8ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2353  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2354  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2355  func testInt16x8ConvertToUint64(t *testing.T, f func(x archsimd.Int16x8) archsimd.Uint64x8, want func(x []int16) []uint64) {
  2356  	n := 8
  2357  	t.Helper()
  2358  	forSlice(t, int16s, n, func(x []int16) bool {
  2359  		t.Helper()
  2360  		a := archsimd.LoadInt16x8(x)
  2361  		g := make([]uint64, 8)
  2362  		f(a).Store(g)
  2363  		w := want(x)
  2364  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2365  	})
  2366  }
  2367  
  2368  // testInt32x4ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2369  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2370  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2371  func testInt32x4ConvertToUint64(t *testing.T, f func(x archsimd.Int32x4) archsimd.Uint64x4, want func(x []int32) []uint64) {
  2372  	n := 4
  2373  	t.Helper()
  2374  	forSlice(t, int32s, n, func(x []int32) bool {
  2375  		t.Helper()
  2376  		a := archsimd.LoadInt32x4(x)
  2377  		g := make([]uint64, 4)
  2378  		f(a).Store(g)
  2379  		w := want(x)
  2380  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2381  	})
  2382  }
  2383  
  2384  // testUint8x16ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2385  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2386  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2387  func testUint8x16ConvertToUint64(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Uint64x8, want func(x []uint8) []uint64) {
  2388  	n := 16
  2389  	t.Helper()
  2390  	forSlice(t, uint8s, n, func(x []uint8) bool {
  2391  		t.Helper()
  2392  		a := archsimd.LoadUint8x16(x)
  2393  		g := make([]uint64, 8)
  2394  		f(a).Store(g)
  2395  		w := want(x)
  2396  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2397  	})
  2398  }
  2399  
  2400  // testUint16x8ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2401  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2402  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2403  func testUint16x8ConvertToUint64(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Uint64x8, want func(x []uint16) []uint64) {
  2404  	n := 8
  2405  	t.Helper()
  2406  	forSlice(t, uint16s, n, func(x []uint16) bool {
  2407  		t.Helper()
  2408  		a := archsimd.LoadUint16x8(x)
  2409  		g := make([]uint64, 8)
  2410  		f(a).Store(g)
  2411  		w := want(x)
  2412  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2413  	})
  2414  }
  2415  
  2416  // testUint32x4ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2417  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2418  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2419  func testUint32x4ConvertToUint64(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Uint64x4, want func(x []uint32) []uint64) {
  2420  	n := 4
  2421  	t.Helper()
  2422  	forSlice(t, uint32s, n, func(x []uint32) bool {
  2423  		t.Helper()
  2424  		a := archsimd.LoadUint32x4(x)
  2425  		g := make([]uint64, 4)
  2426  		f(a).Store(g)
  2427  		w := want(x)
  2428  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2429  	})
  2430  }
  2431  
  2432  // testFloat32x4ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2433  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2434  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2435  func testFloat32x4ConvertToUint64(t *testing.T, f func(x archsimd.Float32x4) archsimd.Uint64x4, want func(x []float32) []uint64) {
  2436  	n := 4
  2437  	t.Helper()
  2438  	forSlice(t, float32s, n, func(x []float32) bool {
  2439  		t.Helper()
  2440  		a := archsimd.LoadFloat32x4(x)
  2441  		g := make([]uint64, 4)
  2442  		f(a).Store(g)
  2443  		w := want(x)
  2444  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2445  	})
  2446  }
  2447  
  2448  // testInt8x32ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2449  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2450  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2451  func testInt8x32ConvertToUint64(t *testing.T, f func(x archsimd.Int8x32) archsimd.Uint64x8, want func(x []int8) []uint64) {
  2452  	n := 32
  2453  	t.Helper()
  2454  	forSlice(t, int8s, n, func(x []int8) bool {
  2455  		t.Helper()
  2456  		a := archsimd.LoadInt8x32(x)
  2457  		g := make([]uint64, 8)
  2458  		f(a).Store(g)
  2459  		w := want(x)
  2460  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2461  	})
  2462  }
  2463  
  2464  // testInt16x16ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2465  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2466  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2467  func testInt16x16ConvertToUint64(t *testing.T, f func(x archsimd.Int16x16) archsimd.Uint64x8, want func(x []int16) []uint64) {
  2468  	n := 16
  2469  	t.Helper()
  2470  	forSlice(t, int16s, n, func(x []int16) bool {
  2471  		t.Helper()
  2472  		a := archsimd.LoadInt16x16(x)
  2473  		g := make([]uint64, 8)
  2474  		f(a).Store(g)
  2475  		w := want(x)
  2476  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2477  	})
  2478  }
  2479  
  2480  // testInt32x8ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2481  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2482  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2483  func testInt32x8ConvertToUint64(t *testing.T, f func(x archsimd.Int32x8) archsimd.Uint64x8, want func(x []int32) []uint64) {
  2484  	n := 8
  2485  	t.Helper()
  2486  	forSlice(t, int32s, n, func(x []int32) bool {
  2487  		t.Helper()
  2488  		a := archsimd.LoadInt32x8(x)
  2489  		g := make([]uint64, 8)
  2490  		f(a).Store(g)
  2491  		w := want(x)
  2492  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2493  	})
  2494  }
  2495  
  2496  // testInt64x4ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2497  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2498  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2499  func testInt64x4ConvertToUint64(t *testing.T, f func(x archsimd.Int64x4) archsimd.Uint64x4, want func(x []int64) []uint64) {
  2500  	n := 4
  2501  	t.Helper()
  2502  	forSlice(t, int64s, n, func(x []int64) bool {
  2503  		t.Helper()
  2504  		a := archsimd.LoadInt64x4(x)
  2505  		g := make([]uint64, 4)
  2506  		f(a).Store(g)
  2507  		w := want(x)
  2508  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2509  	})
  2510  }
  2511  
  2512  // testUint8x32ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2513  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2514  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2515  func testUint8x32ConvertToUint64(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Uint64x8, want func(x []uint8) []uint64) {
  2516  	n := 32
  2517  	t.Helper()
  2518  	forSlice(t, uint8s, n, func(x []uint8) bool {
  2519  		t.Helper()
  2520  		a := archsimd.LoadUint8x32(x)
  2521  		g := make([]uint64, 8)
  2522  		f(a).Store(g)
  2523  		w := want(x)
  2524  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2525  	})
  2526  }
  2527  
  2528  // testUint16x16ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2529  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2530  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2531  func testUint16x16ConvertToUint64(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Uint64x8, want func(x []uint16) []uint64) {
  2532  	n := 16
  2533  	t.Helper()
  2534  	forSlice(t, uint16s, n, func(x []uint16) bool {
  2535  		t.Helper()
  2536  		a := archsimd.LoadUint16x16(x)
  2537  		g := make([]uint64, 8)
  2538  		f(a).Store(g)
  2539  		w := want(x)
  2540  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2541  	})
  2542  }
  2543  
  2544  // testUint32x8ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2545  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2546  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2547  func testUint32x8ConvertToUint64(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Uint64x8, want func(x []uint32) []uint64) {
  2548  	n := 8
  2549  	t.Helper()
  2550  	forSlice(t, uint32s, n, func(x []uint32) bool {
  2551  		t.Helper()
  2552  		a := archsimd.LoadUint32x8(x)
  2553  		g := make([]uint64, 8)
  2554  		f(a).Store(g)
  2555  		w := want(x)
  2556  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2557  	})
  2558  }
  2559  
  2560  // testFloat32x8ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2561  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2562  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2563  func testFloat32x8ConvertToUint64(t *testing.T, f func(x archsimd.Float32x8) archsimd.Uint64x8, want func(x []float32) []uint64) {
  2564  	n := 8
  2565  	t.Helper()
  2566  	forSlice(t, float32s, n, func(x []float32) bool {
  2567  		t.Helper()
  2568  		a := archsimd.LoadFloat32x8(x)
  2569  		g := make([]uint64, 8)
  2570  		f(a).Store(g)
  2571  		w := want(x)
  2572  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2573  	})
  2574  }
  2575  
  2576  // testFloat64x4ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2577  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2578  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2579  func testFloat64x4ConvertToUint64(t *testing.T, f func(x archsimd.Float64x4) archsimd.Uint64x4, want func(x []float64) []uint64) {
  2580  	n := 4
  2581  	t.Helper()
  2582  	forSlice(t, float64s, n, func(x []float64) bool {
  2583  		t.Helper()
  2584  		a := archsimd.LoadFloat64x4(x)
  2585  		g := make([]uint64, 4)
  2586  		f(a).Store(g)
  2587  		w := want(x)
  2588  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2589  	})
  2590  }
  2591  
  2592  // testInt8x64ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2593  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2594  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2595  func testInt8x64ConvertToUint64(t *testing.T, f func(x archsimd.Int8x64) archsimd.Uint64x8, want func(x []int8) []uint64) {
  2596  	n := 64
  2597  	t.Helper()
  2598  	forSlice(t, int8s, n, func(x []int8) bool {
  2599  		t.Helper()
  2600  		a := archsimd.LoadInt8x64(x)
  2601  		g := make([]uint64, 8)
  2602  		f(a).Store(g)
  2603  		w := want(x)
  2604  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2605  	})
  2606  }
  2607  
  2608  // testInt16x32ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2609  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2610  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2611  func testInt16x32ConvertToUint64(t *testing.T, f func(x archsimd.Int16x32) archsimd.Uint64x8, want func(x []int16) []uint64) {
  2612  	n := 32
  2613  	t.Helper()
  2614  	forSlice(t, int16s, n, func(x []int16) bool {
  2615  		t.Helper()
  2616  		a := archsimd.LoadInt16x32(x)
  2617  		g := make([]uint64, 8)
  2618  		f(a).Store(g)
  2619  		w := want(x)
  2620  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2621  	})
  2622  }
  2623  
  2624  // testInt32x16ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2625  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2626  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2627  func testInt32x16ConvertToUint64(t *testing.T, f func(x archsimd.Int32x16) archsimd.Uint64x8, want func(x []int32) []uint64) {
  2628  	n := 16
  2629  	t.Helper()
  2630  	forSlice(t, int32s, n, func(x []int32) bool {
  2631  		t.Helper()
  2632  		a := archsimd.LoadInt32x16(x)
  2633  		g := make([]uint64, 8)
  2634  		f(a).Store(g)
  2635  		w := want(x)
  2636  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2637  	})
  2638  }
  2639  
  2640  // testInt64x8ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2641  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2642  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2643  func testInt64x8ConvertToUint64(t *testing.T, f func(x archsimd.Int64x8) archsimd.Uint64x8, want func(x []int64) []uint64) {
  2644  	n := 8
  2645  	t.Helper()
  2646  	forSlice(t, int64s, n, func(x []int64) bool {
  2647  		t.Helper()
  2648  		a := archsimd.LoadInt64x8(x)
  2649  		g := make([]uint64, 8)
  2650  		f(a).Store(g)
  2651  		w := want(x)
  2652  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2653  	})
  2654  }
  2655  
  2656  // testUint8x64ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2657  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2658  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2659  func testUint8x64ConvertToUint64(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Uint64x8, want func(x []uint8) []uint64) {
  2660  	n := 64
  2661  	t.Helper()
  2662  	forSlice(t, uint8s, n, func(x []uint8) bool {
  2663  		t.Helper()
  2664  		a := archsimd.LoadUint8x64(x)
  2665  		g := make([]uint64, 8)
  2666  		f(a).Store(g)
  2667  		w := want(x)
  2668  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2669  	})
  2670  }
  2671  
  2672  // testUint16x32ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2673  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2674  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2675  func testUint16x32ConvertToUint64(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Uint64x8, want func(x []uint16) []uint64) {
  2676  	n := 32
  2677  	t.Helper()
  2678  	forSlice(t, uint16s, n, func(x []uint16) bool {
  2679  		t.Helper()
  2680  		a := archsimd.LoadUint16x32(x)
  2681  		g := make([]uint64, 8)
  2682  		f(a).Store(g)
  2683  		w := want(x)
  2684  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2685  	})
  2686  }
  2687  
  2688  // testUint32x16ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2689  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2690  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2691  func testUint32x16ConvertToUint64(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Uint64x8, want func(x []uint32) []uint64) {
  2692  	n := 16
  2693  	t.Helper()
  2694  	forSlice(t, uint32s, n, func(x []uint32) bool {
  2695  		t.Helper()
  2696  		a := archsimd.LoadUint32x16(x)
  2697  		g := make([]uint64, 8)
  2698  		f(a).Store(g)
  2699  		w := want(x)
  2700  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2701  	})
  2702  }
  2703  
  2704  // testFloat32x16ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2705  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2706  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2707  func testFloat32x16ConvertToUint64(t *testing.T, f func(x archsimd.Float32x16) archsimd.Uint64x8, want func(x []float32) []uint64) {
  2708  	n := 16
  2709  	t.Helper()
  2710  	forSlice(t, float32s, n, func(x []float32) bool {
  2711  		t.Helper()
  2712  		a := archsimd.LoadFloat32x16(x)
  2713  		g := make([]uint64, 8)
  2714  		f(a).Store(g)
  2715  		w := want(x)
  2716  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2717  	})
  2718  }
  2719  
  2720  // testFloat64x8ConvertToUint64 tests the simd conversion method f against the expected behavior generated by want.
  2721  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2722  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2723  func testFloat64x8ConvertToUint64(t *testing.T, f func(x archsimd.Float64x8) archsimd.Uint64x8, want func(x []float64) []uint64) {
  2724  	n := 8
  2725  	t.Helper()
  2726  	forSlice(t, float64s, n, func(x []float64) bool {
  2727  		t.Helper()
  2728  		a := archsimd.LoadFloat64x8(x)
  2729  		g := make([]uint64, 8)
  2730  		f(a).Store(g)
  2731  		w := want(x)
  2732  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2733  	})
  2734  }
  2735  
  2736  // testInt8x16ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want.
  2737  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2738  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2739  func testInt8x16ConvertToFloat32(t *testing.T, f func(x archsimd.Int8x16) archsimd.Float32x16, want func(x []int8) []float32) {
  2740  	n := 16
  2741  	t.Helper()
  2742  	forSlice(t, int8s, n, func(x []int8) bool {
  2743  		t.Helper()
  2744  		a := archsimd.LoadInt8x16(x)
  2745  		g := make([]float32, 16)
  2746  		f(a).Store(g)
  2747  		w := want(x)
  2748  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2749  	})
  2750  }
  2751  
  2752  // testInt16x8ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want.
  2753  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2754  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2755  func testInt16x8ConvertToFloat32(t *testing.T, f func(x archsimd.Int16x8) archsimd.Float32x8, want func(x []int16) []float32) {
  2756  	n := 8
  2757  	t.Helper()
  2758  	forSlice(t, int16s, n, func(x []int16) bool {
  2759  		t.Helper()
  2760  		a := archsimd.LoadInt16x8(x)
  2761  		g := make([]float32, 8)
  2762  		f(a).Store(g)
  2763  		w := want(x)
  2764  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2765  	})
  2766  }
  2767  
  2768  // testUint8x16ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want.
  2769  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2770  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2771  func testUint8x16ConvertToFloat32(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Float32x16, want func(x []uint8) []float32) {
  2772  	n := 16
  2773  	t.Helper()
  2774  	forSlice(t, uint8s, n, func(x []uint8) bool {
  2775  		t.Helper()
  2776  		a := archsimd.LoadUint8x16(x)
  2777  		g := make([]float32, 16)
  2778  		f(a).Store(g)
  2779  		w := want(x)
  2780  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2781  	})
  2782  }
  2783  
  2784  // testUint16x8ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want.
  2785  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2786  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2787  func testUint16x8ConvertToFloat32(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Float32x8, want func(x []uint16) []float32) {
  2788  	n := 8
  2789  	t.Helper()
  2790  	forSlice(t, uint16s, n, func(x []uint16) bool {
  2791  		t.Helper()
  2792  		a := archsimd.LoadUint16x8(x)
  2793  		g := make([]float32, 8)
  2794  		f(a).Store(g)
  2795  		w := want(x)
  2796  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2797  	})
  2798  }
  2799  
  2800  // testInt8x32ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want.
  2801  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2802  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2803  func testInt8x32ConvertToFloat32(t *testing.T, f func(x archsimd.Int8x32) archsimd.Float32x16, want func(x []int8) []float32) {
  2804  	n := 32
  2805  	t.Helper()
  2806  	forSlice(t, int8s, n, func(x []int8) bool {
  2807  		t.Helper()
  2808  		a := archsimd.LoadInt8x32(x)
  2809  		g := make([]float32, 16)
  2810  		f(a).Store(g)
  2811  		w := want(x)
  2812  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2813  	})
  2814  }
  2815  
  2816  // testInt16x16ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want.
  2817  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2818  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2819  func testInt16x16ConvertToFloat32(t *testing.T, f func(x archsimd.Int16x16) archsimd.Float32x16, want func(x []int16) []float32) {
  2820  	n := 16
  2821  	t.Helper()
  2822  	forSlice(t, int16s, n, func(x []int16) bool {
  2823  		t.Helper()
  2824  		a := archsimd.LoadInt16x16(x)
  2825  		g := make([]float32, 16)
  2826  		f(a).Store(g)
  2827  		w := want(x)
  2828  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2829  	})
  2830  }
  2831  
  2832  // testInt32x8ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want.
  2833  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2834  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2835  func testInt32x8ConvertToFloat32(t *testing.T, f func(x archsimd.Int32x8) archsimd.Float32x8, want func(x []int32) []float32) {
  2836  	n := 8
  2837  	t.Helper()
  2838  	forSlice(t, int32s, n, func(x []int32) bool {
  2839  		t.Helper()
  2840  		a := archsimd.LoadInt32x8(x)
  2841  		g := make([]float32, 8)
  2842  		f(a).Store(g)
  2843  		w := want(x)
  2844  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2845  	})
  2846  }
  2847  
  2848  // testInt64x4ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want.
  2849  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2850  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2851  func testInt64x4ConvertToFloat32(t *testing.T, f func(x archsimd.Int64x4) archsimd.Float32x4, want func(x []int64) []float32) {
  2852  	n := 4
  2853  	t.Helper()
  2854  	forSlice(t, int64s, n, func(x []int64) bool {
  2855  		t.Helper()
  2856  		a := archsimd.LoadInt64x4(x)
  2857  		g := make([]float32, 4)
  2858  		f(a).Store(g)
  2859  		w := want(x)
  2860  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2861  	})
  2862  }
  2863  
  2864  // testUint8x32ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want.
  2865  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2866  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2867  func testUint8x32ConvertToFloat32(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Float32x16, want func(x []uint8) []float32) {
  2868  	n := 32
  2869  	t.Helper()
  2870  	forSlice(t, uint8s, n, func(x []uint8) bool {
  2871  		t.Helper()
  2872  		a := archsimd.LoadUint8x32(x)
  2873  		g := make([]float32, 16)
  2874  		f(a).Store(g)
  2875  		w := want(x)
  2876  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2877  	})
  2878  }
  2879  
  2880  // testUint16x16ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want.
  2881  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2882  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2883  func testUint16x16ConvertToFloat32(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Float32x16, want func(x []uint16) []float32) {
  2884  	n := 16
  2885  	t.Helper()
  2886  	forSlice(t, uint16s, n, func(x []uint16) bool {
  2887  		t.Helper()
  2888  		a := archsimd.LoadUint16x16(x)
  2889  		g := make([]float32, 16)
  2890  		f(a).Store(g)
  2891  		w := want(x)
  2892  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2893  	})
  2894  }
  2895  
  2896  // testUint32x8ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want.
  2897  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2898  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2899  func testUint32x8ConvertToFloat32(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Float32x8, want func(x []uint32) []float32) {
  2900  	n := 8
  2901  	t.Helper()
  2902  	forSlice(t, uint32s, n, func(x []uint32) bool {
  2903  		t.Helper()
  2904  		a := archsimd.LoadUint32x8(x)
  2905  		g := make([]float32, 8)
  2906  		f(a).Store(g)
  2907  		w := want(x)
  2908  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2909  	})
  2910  }
  2911  
  2912  // testUint64x4ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want.
  2913  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2914  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2915  func testUint64x4ConvertToFloat32(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Float32x4, want func(x []uint64) []float32) {
  2916  	n := 4
  2917  	t.Helper()
  2918  	forSlice(t, uint64s, n, func(x []uint64) bool {
  2919  		t.Helper()
  2920  		a := archsimd.LoadUint64x4(x)
  2921  		g := make([]float32, 4)
  2922  		f(a).Store(g)
  2923  		w := want(x)
  2924  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2925  	})
  2926  }
  2927  
  2928  // testFloat64x4ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want.
  2929  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2930  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2931  func testFloat64x4ConvertToFloat32(t *testing.T, f func(x archsimd.Float64x4) archsimd.Float32x4, want func(x []float64) []float32) {
  2932  	n := 4
  2933  	t.Helper()
  2934  	forSlice(t, float64s, n, func(x []float64) bool {
  2935  		t.Helper()
  2936  		a := archsimd.LoadFloat64x4(x)
  2937  		g := make([]float32, 4)
  2938  		f(a).Store(g)
  2939  		w := want(x)
  2940  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2941  	})
  2942  }
  2943  
  2944  // testInt8x64ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want.
  2945  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2946  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2947  func testInt8x64ConvertToFloat32(t *testing.T, f func(x archsimd.Int8x64) archsimd.Float32x16, want func(x []int8) []float32) {
  2948  	n := 64
  2949  	t.Helper()
  2950  	forSlice(t, int8s, n, func(x []int8) bool {
  2951  		t.Helper()
  2952  		a := archsimd.LoadInt8x64(x)
  2953  		g := make([]float32, 16)
  2954  		f(a).Store(g)
  2955  		w := want(x)
  2956  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2957  	})
  2958  }
  2959  
  2960  // testInt16x32ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want.
  2961  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2962  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2963  func testInt16x32ConvertToFloat32(t *testing.T, f func(x archsimd.Int16x32) archsimd.Float32x16, want func(x []int16) []float32) {
  2964  	n := 32
  2965  	t.Helper()
  2966  	forSlice(t, int16s, n, func(x []int16) bool {
  2967  		t.Helper()
  2968  		a := archsimd.LoadInt16x32(x)
  2969  		g := make([]float32, 16)
  2970  		f(a).Store(g)
  2971  		w := want(x)
  2972  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2973  	})
  2974  }
  2975  
  2976  // testInt32x16ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want.
  2977  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2978  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2979  func testInt32x16ConvertToFloat32(t *testing.T, f func(x archsimd.Int32x16) archsimd.Float32x16, want func(x []int32) []float32) {
  2980  	n := 16
  2981  	t.Helper()
  2982  	forSlice(t, int32s, n, func(x []int32) bool {
  2983  		t.Helper()
  2984  		a := archsimd.LoadInt32x16(x)
  2985  		g := make([]float32, 16)
  2986  		f(a).Store(g)
  2987  		w := want(x)
  2988  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  2989  	})
  2990  }
  2991  
  2992  // testInt64x8ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want.
  2993  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  2994  // (extended to at least 128 bits, or truncated to at most 512 bits).
  2995  func testInt64x8ConvertToFloat32(t *testing.T, f func(x archsimd.Int64x8) archsimd.Float32x8, want func(x []int64) []float32) {
  2996  	n := 8
  2997  	t.Helper()
  2998  	forSlice(t, int64s, n, func(x []int64) bool {
  2999  		t.Helper()
  3000  		a := archsimd.LoadInt64x8(x)
  3001  		g := make([]float32, 8)
  3002  		f(a).Store(g)
  3003  		w := want(x)
  3004  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3005  	})
  3006  }
  3007  
  3008  // testUint8x64ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want.
  3009  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3010  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3011  func testUint8x64ConvertToFloat32(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Float32x16, want func(x []uint8) []float32) {
  3012  	n := 64
  3013  	t.Helper()
  3014  	forSlice(t, uint8s, n, func(x []uint8) bool {
  3015  		t.Helper()
  3016  		a := archsimd.LoadUint8x64(x)
  3017  		g := make([]float32, 16)
  3018  		f(a).Store(g)
  3019  		w := want(x)
  3020  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3021  	})
  3022  }
  3023  
  3024  // testUint16x32ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want.
  3025  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3026  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3027  func testUint16x32ConvertToFloat32(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Float32x16, want func(x []uint16) []float32) {
  3028  	n := 32
  3029  	t.Helper()
  3030  	forSlice(t, uint16s, n, func(x []uint16) bool {
  3031  		t.Helper()
  3032  		a := archsimd.LoadUint16x32(x)
  3033  		g := make([]float32, 16)
  3034  		f(a).Store(g)
  3035  		w := want(x)
  3036  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3037  	})
  3038  }
  3039  
  3040  // testUint32x16ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want.
  3041  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3042  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3043  func testUint32x16ConvertToFloat32(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Float32x16, want func(x []uint32) []float32) {
  3044  	n := 16
  3045  	t.Helper()
  3046  	forSlice(t, uint32s, n, func(x []uint32) bool {
  3047  		t.Helper()
  3048  		a := archsimd.LoadUint32x16(x)
  3049  		g := make([]float32, 16)
  3050  		f(a).Store(g)
  3051  		w := want(x)
  3052  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3053  	})
  3054  }
  3055  
  3056  // testUint64x8ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want.
  3057  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3058  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3059  func testUint64x8ConvertToFloat32(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Float32x8, want func(x []uint64) []float32) {
  3060  	n := 8
  3061  	t.Helper()
  3062  	forSlice(t, uint64s, n, func(x []uint64) bool {
  3063  		t.Helper()
  3064  		a := archsimd.LoadUint64x8(x)
  3065  		g := make([]float32, 8)
  3066  		f(a).Store(g)
  3067  		w := want(x)
  3068  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3069  	})
  3070  }
  3071  
  3072  // testFloat64x8ConvertToFloat32 tests the simd conversion method f against the expected behavior generated by want.
  3073  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3074  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3075  func testFloat64x8ConvertToFloat32(t *testing.T, f func(x archsimd.Float64x8) archsimd.Float32x8, want func(x []float64) []float32) {
  3076  	n := 8
  3077  	t.Helper()
  3078  	forSlice(t, float64s, n, func(x []float64) bool {
  3079  		t.Helper()
  3080  		a := archsimd.LoadFloat64x8(x)
  3081  		g := make([]float32, 8)
  3082  		f(a).Store(g)
  3083  		w := want(x)
  3084  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3085  	})
  3086  }
  3087  
  3088  // testInt8x16ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3089  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3090  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3091  func testInt8x16ConvertToFloat64(t *testing.T, f func(x archsimd.Int8x16) archsimd.Float64x8, want func(x []int8) []float64) {
  3092  	n := 16
  3093  	t.Helper()
  3094  	forSlice(t, int8s, n, func(x []int8) bool {
  3095  		t.Helper()
  3096  		a := archsimd.LoadInt8x16(x)
  3097  		g := make([]float64, 8)
  3098  		f(a).Store(g)
  3099  		w := want(x)
  3100  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3101  	})
  3102  }
  3103  
  3104  // testInt16x8ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3105  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3106  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3107  func testInt16x8ConvertToFloat64(t *testing.T, f func(x archsimd.Int16x8) archsimd.Float64x8, want func(x []int16) []float64) {
  3108  	n := 8
  3109  	t.Helper()
  3110  	forSlice(t, int16s, n, func(x []int16) bool {
  3111  		t.Helper()
  3112  		a := archsimd.LoadInt16x8(x)
  3113  		g := make([]float64, 8)
  3114  		f(a).Store(g)
  3115  		w := want(x)
  3116  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3117  	})
  3118  }
  3119  
  3120  // testInt32x4ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3121  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3122  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3123  func testInt32x4ConvertToFloat64(t *testing.T, f func(x archsimd.Int32x4) archsimd.Float64x4, want func(x []int32) []float64) {
  3124  	n := 4
  3125  	t.Helper()
  3126  	forSlice(t, int32s, n, func(x []int32) bool {
  3127  		t.Helper()
  3128  		a := archsimd.LoadInt32x4(x)
  3129  		g := make([]float64, 4)
  3130  		f(a).Store(g)
  3131  		w := want(x)
  3132  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3133  	})
  3134  }
  3135  
  3136  // testUint8x16ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3137  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3138  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3139  func testUint8x16ConvertToFloat64(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Float64x8, want func(x []uint8) []float64) {
  3140  	n := 16
  3141  	t.Helper()
  3142  	forSlice(t, uint8s, n, func(x []uint8) bool {
  3143  		t.Helper()
  3144  		a := archsimd.LoadUint8x16(x)
  3145  		g := make([]float64, 8)
  3146  		f(a).Store(g)
  3147  		w := want(x)
  3148  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3149  	})
  3150  }
  3151  
  3152  // testUint16x8ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3153  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3154  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3155  func testUint16x8ConvertToFloat64(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Float64x8, want func(x []uint16) []float64) {
  3156  	n := 8
  3157  	t.Helper()
  3158  	forSlice(t, uint16s, n, func(x []uint16) bool {
  3159  		t.Helper()
  3160  		a := archsimd.LoadUint16x8(x)
  3161  		g := make([]float64, 8)
  3162  		f(a).Store(g)
  3163  		w := want(x)
  3164  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3165  	})
  3166  }
  3167  
  3168  // testUint32x4ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3169  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3170  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3171  func testUint32x4ConvertToFloat64(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Float64x4, want func(x []uint32) []float64) {
  3172  	n := 4
  3173  	t.Helper()
  3174  	forSlice(t, uint32s, n, func(x []uint32) bool {
  3175  		t.Helper()
  3176  		a := archsimd.LoadUint32x4(x)
  3177  		g := make([]float64, 4)
  3178  		f(a).Store(g)
  3179  		w := want(x)
  3180  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3181  	})
  3182  }
  3183  
  3184  // testFloat32x4ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3185  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3186  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3187  func testFloat32x4ConvertToFloat64(t *testing.T, f func(x archsimd.Float32x4) archsimd.Float64x4, want func(x []float32) []float64) {
  3188  	n := 4
  3189  	t.Helper()
  3190  	forSlice(t, float32s, n, func(x []float32) bool {
  3191  		t.Helper()
  3192  		a := archsimd.LoadFloat32x4(x)
  3193  		g := make([]float64, 4)
  3194  		f(a).Store(g)
  3195  		w := want(x)
  3196  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3197  	})
  3198  }
  3199  
  3200  // testInt8x32ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3201  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3202  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3203  func testInt8x32ConvertToFloat64(t *testing.T, f func(x archsimd.Int8x32) archsimd.Float64x8, want func(x []int8) []float64) {
  3204  	n := 32
  3205  	t.Helper()
  3206  	forSlice(t, int8s, n, func(x []int8) bool {
  3207  		t.Helper()
  3208  		a := archsimd.LoadInt8x32(x)
  3209  		g := make([]float64, 8)
  3210  		f(a).Store(g)
  3211  		w := want(x)
  3212  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3213  	})
  3214  }
  3215  
  3216  // testInt16x16ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3217  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3218  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3219  func testInt16x16ConvertToFloat64(t *testing.T, f func(x archsimd.Int16x16) archsimd.Float64x8, want func(x []int16) []float64) {
  3220  	n := 16
  3221  	t.Helper()
  3222  	forSlice(t, int16s, n, func(x []int16) bool {
  3223  		t.Helper()
  3224  		a := archsimd.LoadInt16x16(x)
  3225  		g := make([]float64, 8)
  3226  		f(a).Store(g)
  3227  		w := want(x)
  3228  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3229  	})
  3230  }
  3231  
  3232  // testInt32x8ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3233  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3234  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3235  func testInt32x8ConvertToFloat64(t *testing.T, f func(x archsimd.Int32x8) archsimd.Float64x8, want func(x []int32) []float64) {
  3236  	n := 8
  3237  	t.Helper()
  3238  	forSlice(t, int32s, n, func(x []int32) bool {
  3239  		t.Helper()
  3240  		a := archsimd.LoadInt32x8(x)
  3241  		g := make([]float64, 8)
  3242  		f(a).Store(g)
  3243  		w := want(x)
  3244  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3245  	})
  3246  }
  3247  
  3248  // testInt64x4ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3249  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3250  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3251  func testInt64x4ConvertToFloat64(t *testing.T, f func(x archsimd.Int64x4) archsimd.Float64x4, want func(x []int64) []float64) {
  3252  	n := 4
  3253  	t.Helper()
  3254  	forSlice(t, int64s, n, func(x []int64) bool {
  3255  		t.Helper()
  3256  		a := archsimd.LoadInt64x4(x)
  3257  		g := make([]float64, 4)
  3258  		f(a).Store(g)
  3259  		w := want(x)
  3260  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3261  	})
  3262  }
  3263  
  3264  // testUint8x32ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3265  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3266  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3267  func testUint8x32ConvertToFloat64(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Float64x8, want func(x []uint8) []float64) {
  3268  	n := 32
  3269  	t.Helper()
  3270  	forSlice(t, uint8s, n, func(x []uint8) bool {
  3271  		t.Helper()
  3272  		a := archsimd.LoadUint8x32(x)
  3273  		g := make([]float64, 8)
  3274  		f(a).Store(g)
  3275  		w := want(x)
  3276  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3277  	})
  3278  }
  3279  
  3280  // testUint16x16ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3281  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3282  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3283  func testUint16x16ConvertToFloat64(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Float64x8, want func(x []uint16) []float64) {
  3284  	n := 16
  3285  	t.Helper()
  3286  	forSlice(t, uint16s, n, func(x []uint16) bool {
  3287  		t.Helper()
  3288  		a := archsimd.LoadUint16x16(x)
  3289  		g := make([]float64, 8)
  3290  		f(a).Store(g)
  3291  		w := want(x)
  3292  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3293  	})
  3294  }
  3295  
  3296  // testUint32x8ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3297  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3298  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3299  func testUint32x8ConvertToFloat64(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Float64x8, want func(x []uint32) []float64) {
  3300  	n := 8
  3301  	t.Helper()
  3302  	forSlice(t, uint32s, n, func(x []uint32) bool {
  3303  		t.Helper()
  3304  		a := archsimd.LoadUint32x8(x)
  3305  		g := make([]float64, 8)
  3306  		f(a).Store(g)
  3307  		w := want(x)
  3308  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3309  	})
  3310  }
  3311  
  3312  // testUint64x4ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3313  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3314  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3315  func testUint64x4ConvertToFloat64(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Float64x4, want func(x []uint64) []float64) {
  3316  	n := 4
  3317  	t.Helper()
  3318  	forSlice(t, uint64s, n, func(x []uint64) bool {
  3319  		t.Helper()
  3320  		a := archsimd.LoadUint64x4(x)
  3321  		g := make([]float64, 4)
  3322  		f(a).Store(g)
  3323  		w := want(x)
  3324  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3325  	})
  3326  }
  3327  
  3328  // testFloat32x8ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3329  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3330  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3331  func testFloat32x8ConvertToFloat64(t *testing.T, f func(x archsimd.Float32x8) archsimd.Float64x8, want func(x []float32) []float64) {
  3332  	n := 8
  3333  	t.Helper()
  3334  	forSlice(t, float32s, n, func(x []float32) bool {
  3335  		t.Helper()
  3336  		a := archsimd.LoadFloat32x8(x)
  3337  		g := make([]float64, 8)
  3338  		f(a).Store(g)
  3339  		w := want(x)
  3340  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3341  	})
  3342  }
  3343  
  3344  // testInt8x64ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3345  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3346  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3347  func testInt8x64ConvertToFloat64(t *testing.T, f func(x archsimd.Int8x64) archsimd.Float64x8, want func(x []int8) []float64) {
  3348  	n := 64
  3349  	t.Helper()
  3350  	forSlice(t, int8s, n, func(x []int8) bool {
  3351  		t.Helper()
  3352  		a := archsimd.LoadInt8x64(x)
  3353  		g := make([]float64, 8)
  3354  		f(a).Store(g)
  3355  		w := want(x)
  3356  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3357  	})
  3358  }
  3359  
  3360  // testInt16x32ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3361  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3362  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3363  func testInt16x32ConvertToFloat64(t *testing.T, f func(x archsimd.Int16x32) archsimd.Float64x8, want func(x []int16) []float64) {
  3364  	n := 32
  3365  	t.Helper()
  3366  	forSlice(t, int16s, n, func(x []int16) bool {
  3367  		t.Helper()
  3368  		a := archsimd.LoadInt16x32(x)
  3369  		g := make([]float64, 8)
  3370  		f(a).Store(g)
  3371  		w := want(x)
  3372  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3373  	})
  3374  }
  3375  
  3376  // testInt32x16ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3377  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3378  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3379  func testInt32x16ConvertToFloat64(t *testing.T, f func(x archsimd.Int32x16) archsimd.Float64x8, want func(x []int32) []float64) {
  3380  	n := 16
  3381  	t.Helper()
  3382  	forSlice(t, int32s, n, func(x []int32) bool {
  3383  		t.Helper()
  3384  		a := archsimd.LoadInt32x16(x)
  3385  		g := make([]float64, 8)
  3386  		f(a).Store(g)
  3387  		w := want(x)
  3388  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3389  	})
  3390  }
  3391  
  3392  // testInt64x8ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3393  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3394  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3395  func testInt64x8ConvertToFloat64(t *testing.T, f func(x archsimd.Int64x8) archsimd.Float64x8, want func(x []int64) []float64) {
  3396  	n := 8
  3397  	t.Helper()
  3398  	forSlice(t, int64s, n, func(x []int64) bool {
  3399  		t.Helper()
  3400  		a := archsimd.LoadInt64x8(x)
  3401  		g := make([]float64, 8)
  3402  		f(a).Store(g)
  3403  		w := want(x)
  3404  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3405  	})
  3406  }
  3407  
  3408  // testUint8x64ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3409  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3410  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3411  func testUint8x64ConvertToFloat64(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Float64x8, want func(x []uint8) []float64) {
  3412  	n := 64
  3413  	t.Helper()
  3414  	forSlice(t, uint8s, n, func(x []uint8) bool {
  3415  		t.Helper()
  3416  		a := archsimd.LoadUint8x64(x)
  3417  		g := make([]float64, 8)
  3418  		f(a).Store(g)
  3419  		w := want(x)
  3420  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3421  	})
  3422  }
  3423  
  3424  // testUint16x32ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3425  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3426  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3427  func testUint16x32ConvertToFloat64(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Float64x8, want func(x []uint16) []float64) {
  3428  	n := 32
  3429  	t.Helper()
  3430  	forSlice(t, uint16s, n, func(x []uint16) bool {
  3431  		t.Helper()
  3432  		a := archsimd.LoadUint16x32(x)
  3433  		g := make([]float64, 8)
  3434  		f(a).Store(g)
  3435  		w := want(x)
  3436  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3437  	})
  3438  }
  3439  
  3440  // testUint32x16ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3441  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3442  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3443  func testUint32x16ConvertToFloat64(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Float64x8, want func(x []uint32) []float64) {
  3444  	n := 16
  3445  	t.Helper()
  3446  	forSlice(t, uint32s, n, func(x []uint32) bool {
  3447  		t.Helper()
  3448  		a := archsimd.LoadUint32x16(x)
  3449  		g := make([]float64, 8)
  3450  		f(a).Store(g)
  3451  		w := want(x)
  3452  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3453  	})
  3454  }
  3455  
  3456  // testUint64x8ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3457  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3458  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3459  func testUint64x8ConvertToFloat64(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Float64x8, want func(x []uint64) []float64) {
  3460  	n := 8
  3461  	t.Helper()
  3462  	forSlice(t, uint64s, n, func(x []uint64) bool {
  3463  		t.Helper()
  3464  		a := archsimd.LoadUint64x8(x)
  3465  		g := make([]float64, 8)
  3466  		f(a).Store(g)
  3467  		w := want(x)
  3468  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3469  	})
  3470  }
  3471  
  3472  // testFloat32x16ConvertToFloat64 tests the simd conversion method f against the expected behavior generated by want.
  3473  // This is for count-preserving conversions, so if there is a change in size, then there is a change in vector width,
  3474  // (extended to at least 128 bits, or truncated to at most 512 bits).
  3475  func testFloat32x16ConvertToFloat64(t *testing.T, f func(x archsimd.Float32x16) archsimd.Float64x8, want func(x []float32) []float64) {
  3476  	n := 16
  3477  	t.Helper()
  3478  	forSlice(t, float32s, n, func(x []float32) bool {
  3479  		t.Helper()
  3480  		a := archsimd.LoadFloat32x16(x)
  3481  		g := make([]float64, 8)
  3482  		f(a).Store(g)
  3483  		w := want(x)
  3484  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3485  	})
  3486  }
  3487  
  3488  // testInt8x32ConvertLoToInt64x2 tests the simd conversion method f against the expected behavior generated by want.
  3489  // This converts only the low 2 elements.
  3490  func testInt8x32ConvertLoToInt64x2(t *testing.T, f func(x archsimd.Int8x32) archsimd.Int64x2, want func(x []int8) []int64) {
  3491  	n := 32
  3492  	t.Helper()
  3493  	forSlice(t, int8s, n, func(x []int8) bool {
  3494  		t.Helper()
  3495  		a := archsimd.LoadInt8x32(x)
  3496  		g := make([]int64, 2)
  3497  		f(a).Store(g)
  3498  		w := want(x)
  3499  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3500  	})
  3501  }
  3502  
  3503  // testInt16x16ConvertLoToInt64x2 tests the simd conversion method f against the expected behavior generated by want.
  3504  // This converts only the low 2 elements.
  3505  func testInt16x16ConvertLoToInt64x2(t *testing.T, f func(x archsimd.Int16x16) archsimd.Int64x2, want func(x []int16) []int64) {
  3506  	n := 16
  3507  	t.Helper()
  3508  	forSlice(t, int16s, n, func(x []int16) bool {
  3509  		t.Helper()
  3510  		a := archsimd.LoadInt16x16(x)
  3511  		g := make([]int64, 2)
  3512  		f(a).Store(g)
  3513  		w := want(x)
  3514  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3515  	})
  3516  }
  3517  
  3518  // testInt32x8ConvertLoToInt64x2 tests the simd conversion method f against the expected behavior generated by want.
  3519  // This converts only the low 2 elements.
  3520  func testInt32x8ConvertLoToInt64x2(t *testing.T, f func(x archsimd.Int32x8) archsimd.Int64x2, want func(x []int32) []int64) {
  3521  	n := 8
  3522  	t.Helper()
  3523  	forSlice(t, int32s, n, func(x []int32) bool {
  3524  		t.Helper()
  3525  		a := archsimd.LoadInt32x8(x)
  3526  		g := make([]int64, 2)
  3527  		f(a).Store(g)
  3528  		w := want(x)
  3529  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3530  	})
  3531  }
  3532  
  3533  // testInt64x4ConvertLoToInt64x2 tests the simd conversion method f against the expected behavior generated by want.
  3534  // This converts only the low 2 elements.
  3535  func testInt64x4ConvertLoToInt64x2(t *testing.T, f func(x archsimd.Int64x4) archsimd.Int64x2, want func(x []int64) []int64) {
  3536  	n := 4
  3537  	t.Helper()
  3538  	forSlice(t, int64s, n, func(x []int64) bool {
  3539  		t.Helper()
  3540  		a := archsimd.LoadInt64x4(x)
  3541  		g := make([]int64, 2)
  3542  		f(a).Store(g)
  3543  		w := want(x)
  3544  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3545  	})
  3546  }
  3547  
  3548  // testUint8x32ConvertLoToInt64x2 tests the simd conversion method f against the expected behavior generated by want.
  3549  // This converts only the low 2 elements.
  3550  func testUint8x32ConvertLoToInt64x2(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Int64x2, want func(x []uint8) []int64) {
  3551  	n := 32
  3552  	t.Helper()
  3553  	forSlice(t, uint8s, n, func(x []uint8) bool {
  3554  		t.Helper()
  3555  		a := archsimd.LoadUint8x32(x)
  3556  		g := make([]int64, 2)
  3557  		f(a).Store(g)
  3558  		w := want(x)
  3559  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3560  	})
  3561  }
  3562  
  3563  // testUint16x16ConvertLoToInt64x2 tests the simd conversion method f against the expected behavior generated by want.
  3564  // This converts only the low 2 elements.
  3565  func testUint16x16ConvertLoToInt64x2(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Int64x2, want func(x []uint16) []int64) {
  3566  	n := 16
  3567  	t.Helper()
  3568  	forSlice(t, uint16s, n, func(x []uint16) bool {
  3569  		t.Helper()
  3570  		a := archsimd.LoadUint16x16(x)
  3571  		g := make([]int64, 2)
  3572  		f(a).Store(g)
  3573  		w := want(x)
  3574  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3575  	})
  3576  }
  3577  
  3578  // testUint32x8ConvertLoToInt64x2 tests the simd conversion method f against the expected behavior generated by want.
  3579  // This converts only the low 2 elements.
  3580  func testUint32x8ConvertLoToInt64x2(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Int64x2, want func(x []uint32) []int64) {
  3581  	n := 8
  3582  	t.Helper()
  3583  	forSlice(t, uint32s, n, func(x []uint32) bool {
  3584  		t.Helper()
  3585  		a := archsimd.LoadUint32x8(x)
  3586  		g := make([]int64, 2)
  3587  		f(a).Store(g)
  3588  		w := want(x)
  3589  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3590  	})
  3591  }
  3592  
  3593  // testUint64x4ConvertLoToInt64x2 tests the simd conversion method f against the expected behavior generated by want.
  3594  // This converts only the low 2 elements.
  3595  func testUint64x4ConvertLoToInt64x2(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Int64x2, want func(x []uint64) []int64) {
  3596  	n := 4
  3597  	t.Helper()
  3598  	forSlice(t, uint64s, n, func(x []uint64) bool {
  3599  		t.Helper()
  3600  		a := archsimd.LoadUint64x4(x)
  3601  		g := make([]int64, 2)
  3602  		f(a).Store(g)
  3603  		w := want(x)
  3604  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3605  	})
  3606  }
  3607  
  3608  // testFloat32x8ConvertLoToInt64x2 tests the simd conversion method f against the expected behavior generated by want.
  3609  // This converts only the low 2 elements.
  3610  func testFloat32x8ConvertLoToInt64x2(t *testing.T, f func(x archsimd.Float32x8) archsimd.Int64x2, want func(x []float32) []int64) {
  3611  	n := 8
  3612  	t.Helper()
  3613  	forSlice(t, float32s, n, func(x []float32) bool {
  3614  		t.Helper()
  3615  		a := archsimd.LoadFloat32x8(x)
  3616  		g := make([]int64, 2)
  3617  		f(a).Store(g)
  3618  		w := want(x)
  3619  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3620  	})
  3621  }
  3622  
  3623  // testFloat64x4ConvertLoToInt64x2 tests the simd conversion method f against the expected behavior generated by want.
  3624  // This converts only the low 2 elements.
  3625  func testFloat64x4ConvertLoToInt64x2(t *testing.T, f func(x archsimd.Float64x4) archsimd.Int64x2, want func(x []float64) []int64) {
  3626  	n := 4
  3627  	t.Helper()
  3628  	forSlice(t, float64s, n, func(x []float64) bool {
  3629  		t.Helper()
  3630  		a := archsimd.LoadFloat64x4(x)
  3631  		g := make([]int64, 2)
  3632  		f(a).Store(g)
  3633  		w := want(x)
  3634  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3635  	})
  3636  }
  3637  
  3638  // testInt8x64ConvertLoToInt64x2 tests the simd conversion method f against the expected behavior generated by want.
  3639  // This converts only the low 2 elements.
  3640  func testInt8x64ConvertLoToInt64x2(t *testing.T, f func(x archsimd.Int8x64) archsimd.Int64x2, want func(x []int8) []int64) {
  3641  	n := 64
  3642  	t.Helper()
  3643  	forSlice(t, int8s, n, func(x []int8) bool {
  3644  		t.Helper()
  3645  		a := archsimd.LoadInt8x64(x)
  3646  		g := make([]int64, 2)
  3647  		f(a).Store(g)
  3648  		w := want(x)
  3649  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3650  	})
  3651  }
  3652  
  3653  // testInt16x32ConvertLoToInt64x2 tests the simd conversion method f against the expected behavior generated by want.
  3654  // This converts only the low 2 elements.
  3655  func testInt16x32ConvertLoToInt64x2(t *testing.T, f func(x archsimd.Int16x32) archsimd.Int64x2, want func(x []int16) []int64) {
  3656  	n := 32
  3657  	t.Helper()
  3658  	forSlice(t, int16s, n, func(x []int16) bool {
  3659  		t.Helper()
  3660  		a := archsimd.LoadInt16x32(x)
  3661  		g := make([]int64, 2)
  3662  		f(a).Store(g)
  3663  		w := want(x)
  3664  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3665  	})
  3666  }
  3667  
  3668  // testInt32x16ConvertLoToInt64x2 tests the simd conversion method f against the expected behavior generated by want.
  3669  // This converts only the low 2 elements.
  3670  func testInt32x16ConvertLoToInt64x2(t *testing.T, f func(x archsimd.Int32x16) archsimd.Int64x2, want func(x []int32) []int64) {
  3671  	n := 16
  3672  	t.Helper()
  3673  	forSlice(t, int32s, n, func(x []int32) bool {
  3674  		t.Helper()
  3675  		a := archsimd.LoadInt32x16(x)
  3676  		g := make([]int64, 2)
  3677  		f(a).Store(g)
  3678  		w := want(x)
  3679  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3680  	})
  3681  }
  3682  
  3683  // testInt64x8ConvertLoToInt64x2 tests the simd conversion method f against the expected behavior generated by want.
  3684  // This converts only the low 2 elements.
  3685  func testInt64x8ConvertLoToInt64x2(t *testing.T, f func(x archsimd.Int64x8) archsimd.Int64x2, want func(x []int64) []int64) {
  3686  	n := 8
  3687  	t.Helper()
  3688  	forSlice(t, int64s, n, func(x []int64) bool {
  3689  		t.Helper()
  3690  		a := archsimd.LoadInt64x8(x)
  3691  		g := make([]int64, 2)
  3692  		f(a).Store(g)
  3693  		w := want(x)
  3694  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3695  	})
  3696  }
  3697  
  3698  // testUint8x64ConvertLoToInt64x2 tests the simd conversion method f against the expected behavior generated by want.
  3699  // This converts only the low 2 elements.
  3700  func testUint8x64ConvertLoToInt64x2(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Int64x2, want func(x []uint8) []int64) {
  3701  	n := 64
  3702  	t.Helper()
  3703  	forSlice(t, uint8s, n, func(x []uint8) bool {
  3704  		t.Helper()
  3705  		a := archsimd.LoadUint8x64(x)
  3706  		g := make([]int64, 2)
  3707  		f(a).Store(g)
  3708  		w := want(x)
  3709  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3710  	})
  3711  }
  3712  
  3713  // testUint16x32ConvertLoToInt64x2 tests the simd conversion method f against the expected behavior generated by want.
  3714  // This converts only the low 2 elements.
  3715  func testUint16x32ConvertLoToInt64x2(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Int64x2, want func(x []uint16) []int64) {
  3716  	n := 32
  3717  	t.Helper()
  3718  	forSlice(t, uint16s, n, func(x []uint16) bool {
  3719  		t.Helper()
  3720  		a := archsimd.LoadUint16x32(x)
  3721  		g := make([]int64, 2)
  3722  		f(a).Store(g)
  3723  		w := want(x)
  3724  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3725  	})
  3726  }
  3727  
  3728  // testUint32x16ConvertLoToInt64x2 tests the simd conversion method f against the expected behavior generated by want.
  3729  // This converts only the low 2 elements.
  3730  func testUint32x16ConvertLoToInt64x2(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Int64x2, want func(x []uint32) []int64) {
  3731  	n := 16
  3732  	t.Helper()
  3733  	forSlice(t, uint32s, n, func(x []uint32) bool {
  3734  		t.Helper()
  3735  		a := archsimd.LoadUint32x16(x)
  3736  		g := make([]int64, 2)
  3737  		f(a).Store(g)
  3738  		w := want(x)
  3739  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3740  	})
  3741  }
  3742  
  3743  // testUint64x8ConvertLoToInt64x2 tests the simd conversion method f against the expected behavior generated by want.
  3744  // This converts only the low 2 elements.
  3745  func testUint64x8ConvertLoToInt64x2(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Int64x2, want func(x []uint64) []int64) {
  3746  	n := 8
  3747  	t.Helper()
  3748  	forSlice(t, uint64s, n, func(x []uint64) bool {
  3749  		t.Helper()
  3750  		a := archsimd.LoadUint64x8(x)
  3751  		g := make([]int64, 2)
  3752  		f(a).Store(g)
  3753  		w := want(x)
  3754  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3755  	})
  3756  }
  3757  
  3758  // testFloat32x16ConvertLoToInt64x2 tests the simd conversion method f against the expected behavior generated by want.
  3759  // This converts only the low 2 elements.
  3760  func testFloat32x16ConvertLoToInt64x2(t *testing.T, f func(x archsimd.Float32x16) archsimd.Int64x2, want func(x []float32) []int64) {
  3761  	n := 16
  3762  	t.Helper()
  3763  	forSlice(t, float32s, n, func(x []float32) bool {
  3764  		t.Helper()
  3765  		a := archsimd.LoadFloat32x16(x)
  3766  		g := make([]int64, 2)
  3767  		f(a).Store(g)
  3768  		w := want(x)
  3769  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3770  	})
  3771  }
  3772  
  3773  // testFloat64x8ConvertLoToInt64x2 tests the simd conversion method f against the expected behavior generated by want.
  3774  // This converts only the low 2 elements.
  3775  func testFloat64x8ConvertLoToInt64x2(t *testing.T, f func(x archsimd.Float64x8) archsimd.Int64x2, want func(x []float64) []int64) {
  3776  	n := 8
  3777  	t.Helper()
  3778  	forSlice(t, float64s, n, func(x []float64) bool {
  3779  		t.Helper()
  3780  		a := archsimd.LoadFloat64x8(x)
  3781  		g := make([]int64, 2)
  3782  		f(a).Store(g)
  3783  		w := want(x)
  3784  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3785  	})
  3786  }
  3787  
  3788  // testInt8x16ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  3789  // This converts only the low 4 elements.
  3790  func testInt8x16ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Int8x16) archsimd.Int64x4, want func(x []int8) []int64) {
  3791  	n := 16
  3792  	t.Helper()
  3793  	forSlice(t, int8s, n, func(x []int8) bool {
  3794  		t.Helper()
  3795  		a := archsimd.LoadInt8x16(x)
  3796  		g := make([]int64, 4)
  3797  		f(a).Store(g)
  3798  		w := want(x)
  3799  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3800  	})
  3801  }
  3802  
  3803  // testInt16x8ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  3804  // This converts only the low 4 elements.
  3805  func testInt16x8ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Int16x8) archsimd.Int64x4, want func(x []int16) []int64) {
  3806  	n := 8
  3807  	t.Helper()
  3808  	forSlice(t, int16s, n, func(x []int16) bool {
  3809  		t.Helper()
  3810  		a := archsimd.LoadInt16x8(x)
  3811  		g := make([]int64, 4)
  3812  		f(a).Store(g)
  3813  		w := want(x)
  3814  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3815  	})
  3816  }
  3817  
  3818  // testInt32x4ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  3819  // This converts only the low 4 elements.
  3820  func testInt32x4ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Int32x4) archsimd.Int64x4, want func(x []int32) []int64) {
  3821  	n := 4
  3822  	t.Helper()
  3823  	forSlice(t, int32s, n, func(x []int32) bool {
  3824  		t.Helper()
  3825  		a := archsimd.LoadInt32x4(x)
  3826  		g := make([]int64, 4)
  3827  		f(a).Store(g)
  3828  		w := want(x)
  3829  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3830  	})
  3831  }
  3832  
  3833  // testInt64x2ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  3834  // This converts only the low 4 elements.
  3835  func testInt64x2ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Int64x2) archsimd.Int64x4, want func(x []int64) []int64) {
  3836  	n := 2
  3837  	t.Helper()
  3838  	forSlice(t, int64s, n, func(x []int64) bool {
  3839  		t.Helper()
  3840  		a := archsimd.LoadInt64x2(x)
  3841  		g := make([]int64, 4)
  3842  		f(a).Store(g)
  3843  		w := want(x)
  3844  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3845  	})
  3846  }
  3847  
  3848  // testUint8x16ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  3849  // This converts only the low 4 elements.
  3850  func testUint8x16ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Int64x4, want func(x []uint8) []int64) {
  3851  	n := 16
  3852  	t.Helper()
  3853  	forSlice(t, uint8s, n, func(x []uint8) bool {
  3854  		t.Helper()
  3855  		a := archsimd.LoadUint8x16(x)
  3856  		g := make([]int64, 4)
  3857  		f(a).Store(g)
  3858  		w := want(x)
  3859  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3860  	})
  3861  }
  3862  
  3863  // testUint16x8ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  3864  // This converts only the low 4 elements.
  3865  func testUint16x8ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Int64x4, want func(x []uint16) []int64) {
  3866  	n := 8
  3867  	t.Helper()
  3868  	forSlice(t, uint16s, n, func(x []uint16) bool {
  3869  		t.Helper()
  3870  		a := archsimd.LoadUint16x8(x)
  3871  		g := make([]int64, 4)
  3872  		f(a).Store(g)
  3873  		w := want(x)
  3874  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3875  	})
  3876  }
  3877  
  3878  // testUint32x4ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  3879  // This converts only the low 4 elements.
  3880  func testUint32x4ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Int64x4, want func(x []uint32) []int64) {
  3881  	n := 4
  3882  	t.Helper()
  3883  	forSlice(t, uint32s, n, func(x []uint32) bool {
  3884  		t.Helper()
  3885  		a := archsimd.LoadUint32x4(x)
  3886  		g := make([]int64, 4)
  3887  		f(a).Store(g)
  3888  		w := want(x)
  3889  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3890  	})
  3891  }
  3892  
  3893  // testUint64x2ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  3894  // This converts only the low 4 elements.
  3895  func testUint64x2ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Int64x4, want func(x []uint64) []int64) {
  3896  	n := 2
  3897  	t.Helper()
  3898  	forSlice(t, uint64s, n, func(x []uint64) bool {
  3899  		t.Helper()
  3900  		a := archsimd.LoadUint64x2(x)
  3901  		g := make([]int64, 4)
  3902  		f(a).Store(g)
  3903  		w := want(x)
  3904  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3905  	})
  3906  }
  3907  
  3908  // testFloat32x4ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  3909  // This converts only the low 4 elements.
  3910  func testFloat32x4ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Float32x4) archsimd.Int64x4, want func(x []float32) []int64) {
  3911  	n := 4
  3912  	t.Helper()
  3913  	forSlice(t, float32s, n, func(x []float32) bool {
  3914  		t.Helper()
  3915  		a := archsimd.LoadFloat32x4(x)
  3916  		g := make([]int64, 4)
  3917  		f(a).Store(g)
  3918  		w := want(x)
  3919  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3920  	})
  3921  }
  3922  
  3923  // testFloat64x2ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  3924  // This converts only the low 4 elements.
  3925  func testFloat64x2ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Float64x2) archsimd.Int64x4, want func(x []float64) []int64) {
  3926  	n := 2
  3927  	t.Helper()
  3928  	forSlice(t, float64s, n, func(x []float64) bool {
  3929  		t.Helper()
  3930  		a := archsimd.LoadFloat64x2(x)
  3931  		g := make([]int64, 4)
  3932  		f(a).Store(g)
  3933  		w := want(x)
  3934  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3935  	})
  3936  }
  3937  
  3938  // testInt8x32ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  3939  // This converts only the low 4 elements.
  3940  func testInt8x32ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Int8x32) archsimd.Int64x4, want func(x []int8) []int64) {
  3941  	n := 32
  3942  	t.Helper()
  3943  	forSlice(t, int8s, n, func(x []int8) bool {
  3944  		t.Helper()
  3945  		a := archsimd.LoadInt8x32(x)
  3946  		g := make([]int64, 4)
  3947  		f(a).Store(g)
  3948  		w := want(x)
  3949  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3950  	})
  3951  }
  3952  
  3953  // testInt16x16ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  3954  // This converts only the low 4 elements.
  3955  func testInt16x16ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Int16x16) archsimd.Int64x4, want func(x []int16) []int64) {
  3956  	n := 16
  3957  	t.Helper()
  3958  	forSlice(t, int16s, n, func(x []int16) bool {
  3959  		t.Helper()
  3960  		a := archsimd.LoadInt16x16(x)
  3961  		g := make([]int64, 4)
  3962  		f(a).Store(g)
  3963  		w := want(x)
  3964  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3965  	})
  3966  }
  3967  
  3968  // testInt32x8ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  3969  // This converts only the low 4 elements.
  3970  func testInt32x8ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Int32x8) archsimd.Int64x4, want func(x []int32) []int64) {
  3971  	n := 8
  3972  	t.Helper()
  3973  	forSlice(t, int32s, n, func(x []int32) bool {
  3974  		t.Helper()
  3975  		a := archsimd.LoadInt32x8(x)
  3976  		g := make([]int64, 4)
  3977  		f(a).Store(g)
  3978  		w := want(x)
  3979  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3980  	})
  3981  }
  3982  
  3983  // testInt64x4ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  3984  // This converts only the low 4 elements.
  3985  func testInt64x4ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Int64x4) archsimd.Int64x4, want func(x []int64) []int64) {
  3986  	n := 4
  3987  	t.Helper()
  3988  	forSlice(t, int64s, n, func(x []int64) bool {
  3989  		t.Helper()
  3990  		a := archsimd.LoadInt64x4(x)
  3991  		g := make([]int64, 4)
  3992  		f(a).Store(g)
  3993  		w := want(x)
  3994  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  3995  	})
  3996  }
  3997  
  3998  // testUint8x32ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  3999  // This converts only the low 4 elements.
  4000  func testUint8x32ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Int64x4, want func(x []uint8) []int64) {
  4001  	n := 32
  4002  	t.Helper()
  4003  	forSlice(t, uint8s, n, func(x []uint8) bool {
  4004  		t.Helper()
  4005  		a := archsimd.LoadUint8x32(x)
  4006  		g := make([]int64, 4)
  4007  		f(a).Store(g)
  4008  		w := want(x)
  4009  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4010  	})
  4011  }
  4012  
  4013  // testUint16x16ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  4014  // This converts only the low 4 elements.
  4015  func testUint16x16ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Int64x4, want func(x []uint16) []int64) {
  4016  	n := 16
  4017  	t.Helper()
  4018  	forSlice(t, uint16s, n, func(x []uint16) bool {
  4019  		t.Helper()
  4020  		a := archsimd.LoadUint16x16(x)
  4021  		g := make([]int64, 4)
  4022  		f(a).Store(g)
  4023  		w := want(x)
  4024  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4025  	})
  4026  }
  4027  
  4028  // testUint32x8ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  4029  // This converts only the low 4 elements.
  4030  func testUint32x8ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Int64x4, want func(x []uint32) []int64) {
  4031  	n := 8
  4032  	t.Helper()
  4033  	forSlice(t, uint32s, n, func(x []uint32) bool {
  4034  		t.Helper()
  4035  		a := archsimd.LoadUint32x8(x)
  4036  		g := make([]int64, 4)
  4037  		f(a).Store(g)
  4038  		w := want(x)
  4039  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4040  	})
  4041  }
  4042  
  4043  // testUint64x4ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  4044  // This converts only the low 4 elements.
  4045  func testUint64x4ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Int64x4, want func(x []uint64) []int64) {
  4046  	n := 4
  4047  	t.Helper()
  4048  	forSlice(t, uint64s, n, func(x []uint64) bool {
  4049  		t.Helper()
  4050  		a := archsimd.LoadUint64x4(x)
  4051  		g := make([]int64, 4)
  4052  		f(a).Store(g)
  4053  		w := want(x)
  4054  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4055  	})
  4056  }
  4057  
  4058  // testFloat32x8ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  4059  // This converts only the low 4 elements.
  4060  func testFloat32x8ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Float32x8) archsimd.Int64x4, want func(x []float32) []int64) {
  4061  	n := 8
  4062  	t.Helper()
  4063  	forSlice(t, float32s, n, func(x []float32) bool {
  4064  		t.Helper()
  4065  		a := archsimd.LoadFloat32x8(x)
  4066  		g := make([]int64, 4)
  4067  		f(a).Store(g)
  4068  		w := want(x)
  4069  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4070  	})
  4071  }
  4072  
  4073  // testFloat64x4ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  4074  // This converts only the low 4 elements.
  4075  func testFloat64x4ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Float64x4) archsimd.Int64x4, want func(x []float64) []int64) {
  4076  	n := 4
  4077  	t.Helper()
  4078  	forSlice(t, float64s, n, func(x []float64) bool {
  4079  		t.Helper()
  4080  		a := archsimd.LoadFloat64x4(x)
  4081  		g := make([]int64, 4)
  4082  		f(a).Store(g)
  4083  		w := want(x)
  4084  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4085  	})
  4086  }
  4087  
  4088  // testInt8x64ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  4089  // This converts only the low 4 elements.
  4090  func testInt8x64ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Int8x64) archsimd.Int64x4, want func(x []int8) []int64) {
  4091  	n := 64
  4092  	t.Helper()
  4093  	forSlice(t, int8s, n, func(x []int8) bool {
  4094  		t.Helper()
  4095  		a := archsimd.LoadInt8x64(x)
  4096  		g := make([]int64, 4)
  4097  		f(a).Store(g)
  4098  		w := want(x)
  4099  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4100  	})
  4101  }
  4102  
  4103  // testInt16x32ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  4104  // This converts only the low 4 elements.
  4105  func testInt16x32ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Int16x32) archsimd.Int64x4, want func(x []int16) []int64) {
  4106  	n := 32
  4107  	t.Helper()
  4108  	forSlice(t, int16s, n, func(x []int16) bool {
  4109  		t.Helper()
  4110  		a := archsimd.LoadInt16x32(x)
  4111  		g := make([]int64, 4)
  4112  		f(a).Store(g)
  4113  		w := want(x)
  4114  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4115  	})
  4116  }
  4117  
  4118  // testInt32x16ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  4119  // This converts only the low 4 elements.
  4120  func testInt32x16ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Int32x16) archsimd.Int64x4, want func(x []int32) []int64) {
  4121  	n := 16
  4122  	t.Helper()
  4123  	forSlice(t, int32s, n, func(x []int32) bool {
  4124  		t.Helper()
  4125  		a := archsimd.LoadInt32x16(x)
  4126  		g := make([]int64, 4)
  4127  		f(a).Store(g)
  4128  		w := want(x)
  4129  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4130  	})
  4131  }
  4132  
  4133  // testInt64x8ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  4134  // This converts only the low 4 elements.
  4135  func testInt64x8ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Int64x8) archsimd.Int64x4, want func(x []int64) []int64) {
  4136  	n := 8
  4137  	t.Helper()
  4138  	forSlice(t, int64s, n, func(x []int64) bool {
  4139  		t.Helper()
  4140  		a := archsimd.LoadInt64x8(x)
  4141  		g := make([]int64, 4)
  4142  		f(a).Store(g)
  4143  		w := want(x)
  4144  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4145  	})
  4146  }
  4147  
  4148  // testUint8x64ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  4149  // This converts only the low 4 elements.
  4150  func testUint8x64ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Int64x4, want func(x []uint8) []int64) {
  4151  	n := 64
  4152  	t.Helper()
  4153  	forSlice(t, uint8s, n, func(x []uint8) bool {
  4154  		t.Helper()
  4155  		a := archsimd.LoadUint8x64(x)
  4156  		g := make([]int64, 4)
  4157  		f(a).Store(g)
  4158  		w := want(x)
  4159  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4160  	})
  4161  }
  4162  
  4163  // testUint16x32ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  4164  // This converts only the low 4 elements.
  4165  func testUint16x32ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Int64x4, want func(x []uint16) []int64) {
  4166  	n := 32
  4167  	t.Helper()
  4168  	forSlice(t, uint16s, n, func(x []uint16) bool {
  4169  		t.Helper()
  4170  		a := archsimd.LoadUint16x32(x)
  4171  		g := make([]int64, 4)
  4172  		f(a).Store(g)
  4173  		w := want(x)
  4174  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4175  	})
  4176  }
  4177  
  4178  // testUint32x16ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  4179  // This converts only the low 4 elements.
  4180  func testUint32x16ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Int64x4, want func(x []uint32) []int64) {
  4181  	n := 16
  4182  	t.Helper()
  4183  	forSlice(t, uint32s, n, func(x []uint32) bool {
  4184  		t.Helper()
  4185  		a := archsimd.LoadUint32x16(x)
  4186  		g := make([]int64, 4)
  4187  		f(a).Store(g)
  4188  		w := want(x)
  4189  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4190  	})
  4191  }
  4192  
  4193  // testUint64x8ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  4194  // This converts only the low 4 elements.
  4195  func testUint64x8ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Int64x4, want func(x []uint64) []int64) {
  4196  	n := 8
  4197  	t.Helper()
  4198  	forSlice(t, uint64s, n, func(x []uint64) bool {
  4199  		t.Helper()
  4200  		a := archsimd.LoadUint64x8(x)
  4201  		g := make([]int64, 4)
  4202  		f(a).Store(g)
  4203  		w := want(x)
  4204  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4205  	})
  4206  }
  4207  
  4208  // testFloat32x16ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  4209  // This converts only the low 4 elements.
  4210  func testFloat32x16ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Float32x16) archsimd.Int64x4, want func(x []float32) []int64) {
  4211  	n := 16
  4212  	t.Helper()
  4213  	forSlice(t, float32s, n, func(x []float32) bool {
  4214  		t.Helper()
  4215  		a := archsimd.LoadFloat32x16(x)
  4216  		g := make([]int64, 4)
  4217  		f(a).Store(g)
  4218  		w := want(x)
  4219  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4220  	})
  4221  }
  4222  
  4223  // testFloat64x8ConvertLoToInt64x4 tests the simd conversion method f against the expected behavior generated by want.
  4224  // This converts only the low 4 elements.
  4225  func testFloat64x8ConvertLoToInt64x4(t *testing.T, f func(x archsimd.Float64x8) archsimd.Int64x4, want func(x []float64) []int64) {
  4226  	n := 8
  4227  	t.Helper()
  4228  	forSlice(t, float64s, n, func(x []float64) bool {
  4229  		t.Helper()
  4230  		a := archsimd.LoadFloat64x8(x)
  4231  		g := make([]int64, 4)
  4232  		f(a).Store(g)
  4233  		w := want(x)
  4234  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4235  	})
  4236  }
  4237  
  4238  // testInt8x32ConvertLoToUint64x2 tests the simd conversion method f against the expected behavior generated by want.
  4239  // This converts only the low 2 elements.
  4240  func testInt8x32ConvertLoToUint64x2(t *testing.T, f func(x archsimd.Int8x32) archsimd.Uint64x2, want func(x []int8) []uint64) {
  4241  	n := 32
  4242  	t.Helper()
  4243  	forSlice(t, int8s, n, func(x []int8) bool {
  4244  		t.Helper()
  4245  		a := archsimd.LoadInt8x32(x)
  4246  		g := make([]uint64, 2)
  4247  		f(a).Store(g)
  4248  		w := want(x)
  4249  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4250  	})
  4251  }
  4252  
  4253  // testInt16x16ConvertLoToUint64x2 tests the simd conversion method f against the expected behavior generated by want.
  4254  // This converts only the low 2 elements.
  4255  func testInt16x16ConvertLoToUint64x2(t *testing.T, f func(x archsimd.Int16x16) archsimd.Uint64x2, want func(x []int16) []uint64) {
  4256  	n := 16
  4257  	t.Helper()
  4258  	forSlice(t, int16s, n, func(x []int16) bool {
  4259  		t.Helper()
  4260  		a := archsimd.LoadInt16x16(x)
  4261  		g := make([]uint64, 2)
  4262  		f(a).Store(g)
  4263  		w := want(x)
  4264  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4265  	})
  4266  }
  4267  
  4268  // testInt32x8ConvertLoToUint64x2 tests the simd conversion method f against the expected behavior generated by want.
  4269  // This converts only the low 2 elements.
  4270  func testInt32x8ConvertLoToUint64x2(t *testing.T, f func(x archsimd.Int32x8) archsimd.Uint64x2, want func(x []int32) []uint64) {
  4271  	n := 8
  4272  	t.Helper()
  4273  	forSlice(t, int32s, n, func(x []int32) bool {
  4274  		t.Helper()
  4275  		a := archsimd.LoadInt32x8(x)
  4276  		g := make([]uint64, 2)
  4277  		f(a).Store(g)
  4278  		w := want(x)
  4279  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4280  	})
  4281  }
  4282  
  4283  // testInt64x4ConvertLoToUint64x2 tests the simd conversion method f against the expected behavior generated by want.
  4284  // This converts only the low 2 elements.
  4285  func testInt64x4ConvertLoToUint64x2(t *testing.T, f func(x archsimd.Int64x4) archsimd.Uint64x2, want func(x []int64) []uint64) {
  4286  	n := 4
  4287  	t.Helper()
  4288  	forSlice(t, int64s, n, func(x []int64) bool {
  4289  		t.Helper()
  4290  		a := archsimd.LoadInt64x4(x)
  4291  		g := make([]uint64, 2)
  4292  		f(a).Store(g)
  4293  		w := want(x)
  4294  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4295  	})
  4296  }
  4297  
  4298  // testUint8x32ConvertLoToUint64x2 tests the simd conversion method f against the expected behavior generated by want.
  4299  // This converts only the low 2 elements.
  4300  func testUint8x32ConvertLoToUint64x2(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Uint64x2, want func(x []uint8) []uint64) {
  4301  	n := 32
  4302  	t.Helper()
  4303  	forSlice(t, uint8s, n, func(x []uint8) bool {
  4304  		t.Helper()
  4305  		a := archsimd.LoadUint8x32(x)
  4306  		g := make([]uint64, 2)
  4307  		f(a).Store(g)
  4308  		w := want(x)
  4309  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4310  	})
  4311  }
  4312  
  4313  // testUint16x16ConvertLoToUint64x2 tests the simd conversion method f against the expected behavior generated by want.
  4314  // This converts only the low 2 elements.
  4315  func testUint16x16ConvertLoToUint64x2(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Uint64x2, want func(x []uint16) []uint64) {
  4316  	n := 16
  4317  	t.Helper()
  4318  	forSlice(t, uint16s, n, func(x []uint16) bool {
  4319  		t.Helper()
  4320  		a := archsimd.LoadUint16x16(x)
  4321  		g := make([]uint64, 2)
  4322  		f(a).Store(g)
  4323  		w := want(x)
  4324  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4325  	})
  4326  }
  4327  
  4328  // testUint32x8ConvertLoToUint64x2 tests the simd conversion method f against the expected behavior generated by want.
  4329  // This converts only the low 2 elements.
  4330  func testUint32x8ConvertLoToUint64x2(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Uint64x2, want func(x []uint32) []uint64) {
  4331  	n := 8
  4332  	t.Helper()
  4333  	forSlice(t, uint32s, n, func(x []uint32) bool {
  4334  		t.Helper()
  4335  		a := archsimd.LoadUint32x8(x)
  4336  		g := make([]uint64, 2)
  4337  		f(a).Store(g)
  4338  		w := want(x)
  4339  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4340  	})
  4341  }
  4342  
  4343  // testUint64x4ConvertLoToUint64x2 tests the simd conversion method f against the expected behavior generated by want.
  4344  // This converts only the low 2 elements.
  4345  func testUint64x4ConvertLoToUint64x2(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Uint64x2, want func(x []uint64) []uint64) {
  4346  	n := 4
  4347  	t.Helper()
  4348  	forSlice(t, uint64s, n, func(x []uint64) bool {
  4349  		t.Helper()
  4350  		a := archsimd.LoadUint64x4(x)
  4351  		g := make([]uint64, 2)
  4352  		f(a).Store(g)
  4353  		w := want(x)
  4354  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4355  	})
  4356  }
  4357  
  4358  // testFloat32x8ConvertLoToUint64x2 tests the simd conversion method f against the expected behavior generated by want.
  4359  // This converts only the low 2 elements.
  4360  func testFloat32x8ConvertLoToUint64x2(t *testing.T, f func(x archsimd.Float32x8) archsimd.Uint64x2, want func(x []float32) []uint64) {
  4361  	n := 8
  4362  	t.Helper()
  4363  	forSlice(t, float32s, n, func(x []float32) bool {
  4364  		t.Helper()
  4365  		a := archsimd.LoadFloat32x8(x)
  4366  		g := make([]uint64, 2)
  4367  		f(a).Store(g)
  4368  		w := want(x)
  4369  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4370  	})
  4371  }
  4372  
  4373  // testFloat64x4ConvertLoToUint64x2 tests the simd conversion method f against the expected behavior generated by want.
  4374  // This converts only the low 2 elements.
  4375  func testFloat64x4ConvertLoToUint64x2(t *testing.T, f func(x archsimd.Float64x4) archsimd.Uint64x2, want func(x []float64) []uint64) {
  4376  	n := 4
  4377  	t.Helper()
  4378  	forSlice(t, float64s, n, func(x []float64) bool {
  4379  		t.Helper()
  4380  		a := archsimd.LoadFloat64x4(x)
  4381  		g := make([]uint64, 2)
  4382  		f(a).Store(g)
  4383  		w := want(x)
  4384  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4385  	})
  4386  }
  4387  
  4388  // testInt8x64ConvertLoToUint64x2 tests the simd conversion method f against the expected behavior generated by want.
  4389  // This converts only the low 2 elements.
  4390  func testInt8x64ConvertLoToUint64x2(t *testing.T, f func(x archsimd.Int8x64) archsimd.Uint64x2, want func(x []int8) []uint64) {
  4391  	n := 64
  4392  	t.Helper()
  4393  	forSlice(t, int8s, n, func(x []int8) bool {
  4394  		t.Helper()
  4395  		a := archsimd.LoadInt8x64(x)
  4396  		g := make([]uint64, 2)
  4397  		f(a).Store(g)
  4398  		w := want(x)
  4399  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4400  	})
  4401  }
  4402  
  4403  // testInt16x32ConvertLoToUint64x2 tests the simd conversion method f against the expected behavior generated by want.
  4404  // This converts only the low 2 elements.
  4405  func testInt16x32ConvertLoToUint64x2(t *testing.T, f func(x archsimd.Int16x32) archsimd.Uint64x2, want func(x []int16) []uint64) {
  4406  	n := 32
  4407  	t.Helper()
  4408  	forSlice(t, int16s, n, func(x []int16) bool {
  4409  		t.Helper()
  4410  		a := archsimd.LoadInt16x32(x)
  4411  		g := make([]uint64, 2)
  4412  		f(a).Store(g)
  4413  		w := want(x)
  4414  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4415  	})
  4416  }
  4417  
  4418  // testInt32x16ConvertLoToUint64x2 tests the simd conversion method f against the expected behavior generated by want.
  4419  // This converts only the low 2 elements.
  4420  func testInt32x16ConvertLoToUint64x2(t *testing.T, f func(x archsimd.Int32x16) archsimd.Uint64x2, want func(x []int32) []uint64) {
  4421  	n := 16
  4422  	t.Helper()
  4423  	forSlice(t, int32s, n, func(x []int32) bool {
  4424  		t.Helper()
  4425  		a := archsimd.LoadInt32x16(x)
  4426  		g := make([]uint64, 2)
  4427  		f(a).Store(g)
  4428  		w := want(x)
  4429  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4430  	})
  4431  }
  4432  
  4433  // testInt64x8ConvertLoToUint64x2 tests the simd conversion method f against the expected behavior generated by want.
  4434  // This converts only the low 2 elements.
  4435  func testInt64x8ConvertLoToUint64x2(t *testing.T, f func(x archsimd.Int64x8) archsimd.Uint64x2, want func(x []int64) []uint64) {
  4436  	n := 8
  4437  	t.Helper()
  4438  	forSlice(t, int64s, n, func(x []int64) bool {
  4439  		t.Helper()
  4440  		a := archsimd.LoadInt64x8(x)
  4441  		g := make([]uint64, 2)
  4442  		f(a).Store(g)
  4443  		w := want(x)
  4444  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4445  	})
  4446  }
  4447  
  4448  // testUint8x64ConvertLoToUint64x2 tests the simd conversion method f against the expected behavior generated by want.
  4449  // This converts only the low 2 elements.
  4450  func testUint8x64ConvertLoToUint64x2(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Uint64x2, want func(x []uint8) []uint64) {
  4451  	n := 64
  4452  	t.Helper()
  4453  	forSlice(t, uint8s, n, func(x []uint8) bool {
  4454  		t.Helper()
  4455  		a := archsimd.LoadUint8x64(x)
  4456  		g := make([]uint64, 2)
  4457  		f(a).Store(g)
  4458  		w := want(x)
  4459  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4460  	})
  4461  }
  4462  
  4463  // testUint16x32ConvertLoToUint64x2 tests the simd conversion method f against the expected behavior generated by want.
  4464  // This converts only the low 2 elements.
  4465  func testUint16x32ConvertLoToUint64x2(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Uint64x2, want func(x []uint16) []uint64) {
  4466  	n := 32
  4467  	t.Helper()
  4468  	forSlice(t, uint16s, n, func(x []uint16) bool {
  4469  		t.Helper()
  4470  		a := archsimd.LoadUint16x32(x)
  4471  		g := make([]uint64, 2)
  4472  		f(a).Store(g)
  4473  		w := want(x)
  4474  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4475  	})
  4476  }
  4477  
  4478  // testUint32x16ConvertLoToUint64x2 tests the simd conversion method f against the expected behavior generated by want.
  4479  // This converts only the low 2 elements.
  4480  func testUint32x16ConvertLoToUint64x2(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Uint64x2, want func(x []uint32) []uint64) {
  4481  	n := 16
  4482  	t.Helper()
  4483  	forSlice(t, uint32s, n, func(x []uint32) bool {
  4484  		t.Helper()
  4485  		a := archsimd.LoadUint32x16(x)
  4486  		g := make([]uint64, 2)
  4487  		f(a).Store(g)
  4488  		w := want(x)
  4489  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4490  	})
  4491  }
  4492  
  4493  // testUint64x8ConvertLoToUint64x2 tests the simd conversion method f against the expected behavior generated by want.
  4494  // This converts only the low 2 elements.
  4495  func testUint64x8ConvertLoToUint64x2(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Uint64x2, want func(x []uint64) []uint64) {
  4496  	n := 8
  4497  	t.Helper()
  4498  	forSlice(t, uint64s, n, func(x []uint64) bool {
  4499  		t.Helper()
  4500  		a := archsimd.LoadUint64x8(x)
  4501  		g := make([]uint64, 2)
  4502  		f(a).Store(g)
  4503  		w := want(x)
  4504  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4505  	})
  4506  }
  4507  
  4508  // testFloat32x16ConvertLoToUint64x2 tests the simd conversion method f against the expected behavior generated by want.
  4509  // This converts only the low 2 elements.
  4510  func testFloat32x16ConvertLoToUint64x2(t *testing.T, f func(x archsimd.Float32x16) archsimd.Uint64x2, want func(x []float32) []uint64) {
  4511  	n := 16
  4512  	t.Helper()
  4513  	forSlice(t, float32s, n, func(x []float32) bool {
  4514  		t.Helper()
  4515  		a := archsimd.LoadFloat32x16(x)
  4516  		g := make([]uint64, 2)
  4517  		f(a).Store(g)
  4518  		w := want(x)
  4519  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4520  	})
  4521  }
  4522  
  4523  // testFloat64x8ConvertLoToUint64x2 tests the simd conversion method f against the expected behavior generated by want.
  4524  // This converts only the low 2 elements.
  4525  func testFloat64x8ConvertLoToUint64x2(t *testing.T, f func(x archsimd.Float64x8) archsimd.Uint64x2, want func(x []float64) []uint64) {
  4526  	n := 8
  4527  	t.Helper()
  4528  	forSlice(t, float64s, n, func(x []float64) bool {
  4529  		t.Helper()
  4530  		a := archsimd.LoadFloat64x8(x)
  4531  		g := make([]uint64, 2)
  4532  		f(a).Store(g)
  4533  		w := want(x)
  4534  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4535  	})
  4536  }
  4537  
  4538  // testInt8x16ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4539  // This converts only the low 4 elements.
  4540  func testInt8x16ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Int8x16) archsimd.Uint64x4, want func(x []int8) []uint64) {
  4541  	n := 16
  4542  	t.Helper()
  4543  	forSlice(t, int8s, n, func(x []int8) bool {
  4544  		t.Helper()
  4545  		a := archsimd.LoadInt8x16(x)
  4546  		g := make([]uint64, 4)
  4547  		f(a).Store(g)
  4548  		w := want(x)
  4549  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4550  	})
  4551  }
  4552  
  4553  // testInt16x8ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4554  // This converts only the low 4 elements.
  4555  func testInt16x8ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Int16x8) archsimd.Uint64x4, want func(x []int16) []uint64) {
  4556  	n := 8
  4557  	t.Helper()
  4558  	forSlice(t, int16s, n, func(x []int16) bool {
  4559  		t.Helper()
  4560  		a := archsimd.LoadInt16x8(x)
  4561  		g := make([]uint64, 4)
  4562  		f(a).Store(g)
  4563  		w := want(x)
  4564  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4565  	})
  4566  }
  4567  
  4568  // testInt32x4ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4569  // This converts only the low 4 elements.
  4570  func testInt32x4ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Int32x4) archsimd.Uint64x4, want func(x []int32) []uint64) {
  4571  	n := 4
  4572  	t.Helper()
  4573  	forSlice(t, int32s, n, func(x []int32) bool {
  4574  		t.Helper()
  4575  		a := archsimd.LoadInt32x4(x)
  4576  		g := make([]uint64, 4)
  4577  		f(a).Store(g)
  4578  		w := want(x)
  4579  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4580  	})
  4581  }
  4582  
  4583  // testInt64x2ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4584  // This converts only the low 4 elements.
  4585  func testInt64x2ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Int64x2) archsimd.Uint64x4, want func(x []int64) []uint64) {
  4586  	n := 2
  4587  	t.Helper()
  4588  	forSlice(t, int64s, n, func(x []int64) bool {
  4589  		t.Helper()
  4590  		a := archsimd.LoadInt64x2(x)
  4591  		g := make([]uint64, 4)
  4592  		f(a).Store(g)
  4593  		w := want(x)
  4594  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4595  	})
  4596  }
  4597  
  4598  // testUint8x16ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4599  // This converts only the low 4 elements.
  4600  func testUint8x16ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Uint64x4, want func(x []uint8) []uint64) {
  4601  	n := 16
  4602  	t.Helper()
  4603  	forSlice(t, uint8s, n, func(x []uint8) bool {
  4604  		t.Helper()
  4605  		a := archsimd.LoadUint8x16(x)
  4606  		g := make([]uint64, 4)
  4607  		f(a).Store(g)
  4608  		w := want(x)
  4609  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4610  	})
  4611  }
  4612  
  4613  // testUint16x8ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4614  // This converts only the low 4 elements.
  4615  func testUint16x8ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Uint64x4, want func(x []uint16) []uint64) {
  4616  	n := 8
  4617  	t.Helper()
  4618  	forSlice(t, uint16s, n, func(x []uint16) bool {
  4619  		t.Helper()
  4620  		a := archsimd.LoadUint16x8(x)
  4621  		g := make([]uint64, 4)
  4622  		f(a).Store(g)
  4623  		w := want(x)
  4624  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4625  	})
  4626  }
  4627  
  4628  // testUint32x4ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4629  // This converts only the low 4 elements.
  4630  func testUint32x4ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Uint64x4, want func(x []uint32) []uint64) {
  4631  	n := 4
  4632  	t.Helper()
  4633  	forSlice(t, uint32s, n, func(x []uint32) bool {
  4634  		t.Helper()
  4635  		a := archsimd.LoadUint32x4(x)
  4636  		g := make([]uint64, 4)
  4637  		f(a).Store(g)
  4638  		w := want(x)
  4639  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4640  	})
  4641  }
  4642  
  4643  // testUint64x2ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4644  // This converts only the low 4 elements.
  4645  func testUint64x2ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Uint64x4, want func(x []uint64) []uint64) {
  4646  	n := 2
  4647  	t.Helper()
  4648  	forSlice(t, uint64s, n, func(x []uint64) bool {
  4649  		t.Helper()
  4650  		a := archsimd.LoadUint64x2(x)
  4651  		g := make([]uint64, 4)
  4652  		f(a).Store(g)
  4653  		w := want(x)
  4654  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4655  	})
  4656  }
  4657  
  4658  // testFloat32x4ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4659  // This converts only the low 4 elements.
  4660  func testFloat32x4ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Float32x4) archsimd.Uint64x4, want func(x []float32) []uint64) {
  4661  	n := 4
  4662  	t.Helper()
  4663  	forSlice(t, float32s, n, func(x []float32) bool {
  4664  		t.Helper()
  4665  		a := archsimd.LoadFloat32x4(x)
  4666  		g := make([]uint64, 4)
  4667  		f(a).Store(g)
  4668  		w := want(x)
  4669  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4670  	})
  4671  }
  4672  
  4673  // testFloat64x2ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4674  // This converts only the low 4 elements.
  4675  func testFloat64x2ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Float64x2) archsimd.Uint64x4, want func(x []float64) []uint64) {
  4676  	n := 2
  4677  	t.Helper()
  4678  	forSlice(t, float64s, n, func(x []float64) bool {
  4679  		t.Helper()
  4680  		a := archsimd.LoadFloat64x2(x)
  4681  		g := make([]uint64, 4)
  4682  		f(a).Store(g)
  4683  		w := want(x)
  4684  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4685  	})
  4686  }
  4687  
  4688  // testInt8x32ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4689  // This converts only the low 4 elements.
  4690  func testInt8x32ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Int8x32) archsimd.Uint64x4, want func(x []int8) []uint64) {
  4691  	n := 32
  4692  	t.Helper()
  4693  	forSlice(t, int8s, n, func(x []int8) bool {
  4694  		t.Helper()
  4695  		a := archsimd.LoadInt8x32(x)
  4696  		g := make([]uint64, 4)
  4697  		f(a).Store(g)
  4698  		w := want(x)
  4699  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4700  	})
  4701  }
  4702  
  4703  // testInt16x16ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4704  // This converts only the low 4 elements.
  4705  func testInt16x16ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Int16x16) archsimd.Uint64x4, want func(x []int16) []uint64) {
  4706  	n := 16
  4707  	t.Helper()
  4708  	forSlice(t, int16s, n, func(x []int16) bool {
  4709  		t.Helper()
  4710  		a := archsimd.LoadInt16x16(x)
  4711  		g := make([]uint64, 4)
  4712  		f(a).Store(g)
  4713  		w := want(x)
  4714  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4715  	})
  4716  }
  4717  
  4718  // testInt32x8ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4719  // This converts only the low 4 elements.
  4720  func testInt32x8ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Int32x8) archsimd.Uint64x4, want func(x []int32) []uint64) {
  4721  	n := 8
  4722  	t.Helper()
  4723  	forSlice(t, int32s, n, func(x []int32) bool {
  4724  		t.Helper()
  4725  		a := archsimd.LoadInt32x8(x)
  4726  		g := make([]uint64, 4)
  4727  		f(a).Store(g)
  4728  		w := want(x)
  4729  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4730  	})
  4731  }
  4732  
  4733  // testInt64x4ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4734  // This converts only the low 4 elements.
  4735  func testInt64x4ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Int64x4) archsimd.Uint64x4, want func(x []int64) []uint64) {
  4736  	n := 4
  4737  	t.Helper()
  4738  	forSlice(t, int64s, n, func(x []int64) bool {
  4739  		t.Helper()
  4740  		a := archsimd.LoadInt64x4(x)
  4741  		g := make([]uint64, 4)
  4742  		f(a).Store(g)
  4743  		w := want(x)
  4744  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4745  	})
  4746  }
  4747  
  4748  // testUint8x32ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4749  // This converts only the low 4 elements.
  4750  func testUint8x32ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Uint64x4, want func(x []uint8) []uint64) {
  4751  	n := 32
  4752  	t.Helper()
  4753  	forSlice(t, uint8s, n, func(x []uint8) bool {
  4754  		t.Helper()
  4755  		a := archsimd.LoadUint8x32(x)
  4756  		g := make([]uint64, 4)
  4757  		f(a).Store(g)
  4758  		w := want(x)
  4759  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4760  	})
  4761  }
  4762  
  4763  // testUint16x16ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4764  // This converts only the low 4 elements.
  4765  func testUint16x16ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Uint64x4, want func(x []uint16) []uint64) {
  4766  	n := 16
  4767  	t.Helper()
  4768  	forSlice(t, uint16s, n, func(x []uint16) bool {
  4769  		t.Helper()
  4770  		a := archsimd.LoadUint16x16(x)
  4771  		g := make([]uint64, 4)
  4772  		f(a).Store(g)
  4773  		w := want(x)
  4774  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4775  	})
  4776  }
  4777  
  4778  // testUint32x8ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4779  // This converts only the low 4 elements.
  4780  func testUint32x8ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Uint64x4, want func(x []uint32) []uint64) {
  4781  	n := 8
  4782  	t.Helper()
  4783  	forSlice(t, uint32s, n, func(x []uint32) bool {
  4784  		t.Helper()
  4785  		a := archsimd.LoadUint32x8(x)
  4786  		g := make([]uint64, 4)
  4787  		f(a).Store(g)
  4788  		w := want(x)
  4789  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4790  	})
  4791  }
  4792  
  4793  // testUint64x4ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4794  // This converts only the low 4 elements.
  4795  func testUint64x4ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Uint64x4, want func(x []uint64) []uint64) {
  4796  	n := 4
  4797  	t.Helper()
  4798  	forSlice(t, uint64s, n, func(x []uint64) bool {
  4799  		t.Helper()
  4800  		a := archsimd.LoadUint64x4(x)
  4801  		g := make([]uint64, 4)
  4802  		f(a).Store(g)
  4803  		w := want(x)
  4804  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4805  	})
  4806  }
  4807  
  4808  // testFloat32x8ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4809  // This converts only the low 4 elements.
  4810  func testFloat32x8ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Float32x8) archsimd.Uint64x4, want func(x []float32) []uint64) {
  4811  	n := 8
  4812  	t.Helper()
  4813  	forSlice(t, float32s, n, func(x []float32) bool {
  4814  		t.Helper()
  4815  		a := archsimd.LoadFloat32x8(x)
  4816  		g := make([]uint64, 4)
  4817  		f(a).Store(g)
  4818  		w := want(x)
  4819  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4820  	})
  4821  }
  4822  
  4823  // testFloat64x4ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4824  // This converts only the low 4 elements.
  4825  func testFloat64x4ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Float64x4) archsimd.Uint64x4, want func(x []float64) []uint64) {
  4826  	n := 4
  4827  	t.Helper()
  4828  	forSlice(t, float64s, n, func(x []float64) bool {
  4829  		t.Helper()
  4830  		a := archsimd.LoadFloat64x4(x)
  4831  		g := make([]uint64, 4)
  4832  		f(a).Store(g)
  4833  		w := want(x)
  4834  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4835  	})
  4836  }
  4837  
  4838  // testInt8x64ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4839  // This converts only the low 4 elements.
  4840  func testInt8x64ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Int8x64) archsimd.Uint64x4, want func(x []int8) []uint64) {
  4841  	n := 64
  4842  	t.Helper()
  4843  	forSlice(t, int8s, n, func(x []int8) bool {
  4844  		t.Helper()
  4845  		a := archsimd.LoadInt8x64(x)
  4846  		g := make([]uint64, 4)
  4847  		f(a).Store(g)
  4848  		w := want(x)
  4849  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4850  	})
  4851  }
  4852  
  4853  // testInt16x32ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4854  // This converts only the low 4 elements.
  4855  func testInt16x32ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Int16x32) archsimd.Uint64x4, want func(x []int16) []uint64) {
  4856  	n := 32
  4857  	t.Helper()
  4858  	forSlice(t, int16s, n, func(x []int16) bool {
  4859  		t.Helper()
  4860  		a := archsimd.LoadInt16x32(x)
  4861  		g := make([]uint64, 4)
  4862  		f(a).Store(g)
  4863  		w := want(x)
  4864  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4865  	})
  4866  }
  4867  
  4868  // testInt32x16ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4869  // This converts only the low 4 elements.
  4870  func testInt32x16ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Int32x16) archsimd.Uint64x4, want func(x []int32) []uint64) {
  4871  	n := 16
  4872  	t.Helper()
  4873  	forSlice(t, int32s, n, func(x []int32) bool {
  4874  		t.Helper()
  4875  		a := archsimd.LoadInt32x16(x)
  4876  		g := make([]uint64, 4)
  4877  		f(a).Store(g)
  4878  		w := want(x)
  4879  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4880  	})
  4881  }
  4882  
  4883  // testInt64x8ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4884  // This converts only the low 4 elements.
  4885  func testInt64x8ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Int64x8) archsimd.Uint64x4, want func(x []int64) []uint64) {
  4886  	n := 8
  4887  	t.Helper()
  4888  	forSlice(t, int64s, n, func(x []int64) bool {
  4889  		t.Helper()
  4890  		a := archsimd.LoadInt64x8(x)
  4891  		g := make([]uint64, 4)
  4892  		f(a).Store(g)
  4893  		w := want(x)
  4894  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4895  	})
  4896  }
  4897  
  4898  // testUint8x64ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4899  // This converts only the low 4 elements.
  4900  func testUint8x64ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Uint64x4, want func(x []uint8) []uint64) {
  4901  	n := 64
  4902  	t.Helper()
  4903  	forSlice(t, uint8s, n, func(x []uint8) bool {
  4904  		t.Helper()
  4905  		a := archsimd.LoadUint8x64(x)
  4906  		g := make([]uint64, 4)
  4907  		f(a).Store(g)
  4908  		w := want(x)
  4909  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4910  	})
  4911  }
  4912  
  4913  // testUint16x32ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4914  // This converts only the low 4 elements.
  4915  func testUint16x32ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Uint64x4, want func(x []uint16) []uint64) {
  4916  	n := 32
  4917  	t.Helper()
  4918  	forSlice(t, uint16s, n, func(x []uint16) bool {
  4919  		t.Helper()
  4920  		a := archsimd.LoadUint16x32(x)
  4921  		g := make([]uint64, 4)
  4922  		f(a).Store(g)
  4923  		w := want(x)
  4924  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4925  	})
  4926  }
  4927  
  4928  // testUint32x16ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4929  // This converts only the low 4 elements.
  4930  func testUint32x16ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Uint64x4, want func(x []uint32) []uint64) {
  4931  	n := 16
  4932  	t.Helper()
  4933  	forSlice(t, uint32s, n, func(x []uint32) bool {
  4934  		t.Helper()
  4935  		a := archsimd.LoadUint32x16(x)
  4936  		g := make([]uint64, 4)
  4937  		f(a).Store(g)
  4938  		w := want(x)
  4939  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4940  	})
  4941  }
  4942  
  4943  // testUint64x8ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4944  // This converts only the low 4 elements.
  4945  func testUint64x8ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Uint64x4, want func(x []uint64) []uint64) {
  4946  	n := 8
  4947  	t.Helper()
  4948  	forSlice(t, uint64s, n, func(x []uint64) bool {
  4949  		t.Helper()
  4950  		a := archsimd.LoadUint64x8(x)
  4951  		g := make([]uint64, 4)
  4952  		f(a).Store(g)
  4953  		w := want(x)
  4954  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4955  	})
  4956  }
  4957  
  4958  // testFloat32x16ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4959  // This converts only the low 4 elements.
  4960  func testFloat32x16ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Float32x16) archsimd.Uint64x4, want func(x []float32) []uint64) {
  4961  	n := 16
  4962  	t.Helper()
  4963  	forSlice(t, float32s, n, func(x []float32) bool {
  4964  		t.Helper()
  4965  		a := archsimd.LoadFloat32x16(x)
  4966  		g := make([]uint64, 4)
  4967  		f(a).Store(g)
  4968  		w := want(x)
  4969  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4970  	})
  4971  }
  4972  
  4973  // testFloat64x8ConvertLoToUint64x4 tests the simd conversion method f against the expected behavior generated by want.
  4974  // This converts only the low 4 elements.
  4975  func testFloat64x8ConvertLoToUint64x4(t *testing.T, f func(x archsimd.Float64x8) archsimd.Uint64x4, want func(x []float64) []uint64) {
  4976  	n := 8
  4977  	t.Helper()
  4978  	forSlice(t, float64s, n, func(x []float64) bool {
  4979  		t.Helper()
  4980  		a := archsimd.LoadFloat64x8(x)
  4981  		g := make([]uint64, 4)
  4982  		f(a).Store(g)
  4983  		w := want(x)
  4984  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  4985  	})
  4986  }
  4987  
  4988  // testInt8x32ConvertLoToInt32x4 tests the simd conversion method f against the expected behavior generated by want.
  4989  // This converts only the low 4 elements.
  4990  func testInt8x32ConvertLoToInt32x4(t *testing.T, f func(x archsimd.Int8x32) archsimd.Int32x4, want func(x []int8) []int32) {
  4991  	n := 32
  4992  	t.Helper()
  4993  	forSlice(t, int8s, n, func(x []int8) bool {
  4994  		t.Helper()
  4995  		a := archsimd.LoadInt8x32(x)
  4996  		g := make([]int32, 4)
  4997  		f(a).Store(g)
  4998  		w := want(x)
  4999  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5000  	})
  5001  }
  5002  
  5003  // testInt16x16ConvertLoToInt32x4 tests the simd conversion method f against the expected behavior generated by want.
  5004  // This converts only the low 4 elements.
  5005  func testInt16x16ConvertLoToInt32x4(t *testing.T, f func(x archsimd.Int16x16) archsimd.Int32x4, want func(x []int16) []int32) {
  5006  	n := 16
  5007  	t.Helper()
  5008  	forSlice(t, int16s, n, func(x []int16) bool {
  5009  		t.Helper()
  5010  		a := archsimd.LoadInt16x16(x)
  5011  		g := make([]int32, 4)
  5012  		f(a).Store(g)
  5013  		w := want(x)
  5014  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5015  	})
  5016  }
  5017  
  5018  // testInt32x8ConvertLoToInt32x4 tests the simd conversion method f against the expected behavior generated by want.
  5019  // This converts only the low 4 elements.
  5020  func testInt32x8ConvertLoToInt32x4(t *testing.T, f func(x archsimd.Int32x8) archsimd.Int32x4, want func(x []int32) []int32) {
  5021  	n := 8
  5022  	t.Helper()
  5023  	forSlice(t, int32s, n, func(x []int32) bool {
  5024  		t.Helper()
  5025  		a := archsimd.LoadInt32x8(x)
  5026  		g := make([]int32, 4)
  5027  		f(a).Store(g)
  5028  		w := want(x)
  5029  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5030  	})
  5031  }
  5032  
  5033  // testInt64x4ConvertLoToInt32x4 tests the simd conversion method f against the expected behavior generated by want.
  5034  // This converts only the low 4 elements.
  5035  func testInt64x4ConvertLoToInt32x4(t *testing.T, f func(x archsimd.Int64x4) archsimd.Int32x4, want func(x []int64) []int32) {
  5036  	n := 4
  5037  	t.Helper()
  5038  	forSlice(t, int64s, n, func(x []int64) bool {
  5039  		t.Helper()
  5040  		a := archsimd.LoadInt64x4(x)
  5041  		g := make([]int32, 4)
  5042  		f(a).Store(g)
  5043  		w := want(x)
  5044  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5045  	})
  5046  }
  5047  
  5048  // testUint8x32ConvertLoToInt32x4 tests the simd conversion method f against the expected behavior generated by want.
  5049  // This converts only the low 4 elements.
  5050  func testUint8x32ConvertLoToInt32x4(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Int32x4, want func(x []uint8) []int32) {
  5051  	n := 32
  5052  	t.Helper()
  5053  	forSlice(t, uint8s, n, func(x []uint8) bool {
  5054  		t.Helper()
  5055  		a := archsimd.LoadUint8x32(x)
  5056  		g := make([]int32, 4)
  5057  		f(a).Store(g)
  5058  		w := want(x)
  5059  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5060  	})
  5061  }
  5062  
  5063  // testUint16x16ConvertLoToInt32x4 tests the simd conversion method f against the expected behavior generated by want.
  5064  // This converts only the low 4 elements.
  5065  func testUint16x16ConvertLoToInt32x4(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Int32x4, want func(x []uint16) []int32) {
  5066  	n := 16
  5067  	t.Helper()
  5068  	forSlice(t, uint16s, n, func(x []uint16) bool {
  5069  		t.Helper()
  5070  		a := archsimd.LoadUint16x16(x)
  5071  		g := make([]int32, 4)
  5072  		f(a).Store(g)
  5073  		w := want(x)
  5074  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5075  	})
  5076  }
  5077  
  5078  // testUint32x8ConvertLoToInt32x4 tests the simd conversion method f against the expected behavior generated by want.
  5079  // This converts only the low 4 elements.
  5080  func testUint32x8ConvertLoToInt32x4(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Int32x4, want func(x []uint32) []int32) {
  5081  	n := 8
  5082  	t.Helper()
  5083  	forSlice(t, uint32s, n, func(x []uint32) bool {
  5084  		t.Helper()
  5085  		a := archsimd.LoadUint32x8(x)
  5086  		g := make([]int32, 4)
  5087  		f(a).Store(g)
  5088  		w := want(x)
  5089  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5090  	})
  5091  }
  5092  
  5093  // testUint64x4ConvertLoToInt32x4 tests the simd conversion method f against the expected behavior generated by want.
  5094  // This converts only the low 4 elements.
  5095  func testUint64x4ConvertLoToInt32x4(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Int32x4, want func(x []uint64) []int32) {
  5096  	n := 4
  5097  	t.Helper()
  5098  	forSlice(t, uint64s, n, func(x []uint64) bool {
  5099  		t.Helper()
  5100  		a := archsimd.LoadUint64x4(x)
  5101  		g := make([]int32, 4)
  5102  		f(a).Store(g)
  5103  		w := want(x)
  5104  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5105  	})
  5106  }
  5107  
  5108  // testFloat32x8ConvertLoToInt32x4 tests the simd conversion method f against the expected behavior generated by want.
  5109  // This converts only the low 4 elements.
  5110  func testFloat32x8ConvertLoToInt32x4(t *testing.T, f func(x archsimd.Float32x8) archsimd.Int32x4, want func(x []float32) []int32) {
  5111  	n := 8
  5112  	t.Helper()
  5113  	forSlice(t, float32s, n, func(x []float32) bool {
  5114  		t.Helper()
  5115  		a := archsimd.LoadFloat32x8(x)
  5116  		g := make([]int32, 4)
  5117  		f(a).Store(g)
  5118  		w := want(x)
  5119  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5120  	})
  5121  }
  5122  
  5123  // testFloat64x4ConvertLoToInt32x4 tests the simd conversion method f against the expected behavior generated by want.
  5124  // This converts only the low 4 elements.
  5125  func testFloat64x4ConvertLoToInt32x4(t *testing.T, f func(x archsimd.Float64x4) archsimd.Int32x4, want func(x []float64) []int32) {
  5126  	n := 4
  5127  	t.Helper()
  5128  	forSlice(t, float64s, n, func(x []float64) bool {
  5129  		t.Helper()
  5130  		a := archsimd.LoadFloat64x4(x)
  5131  		g := make([]int32, 4)
  5132  		f(a).Store(g)
  5133  		w := want(x)
  5134  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5135  	})
  5136  }
  5137  
  5138  // testInt8x64ConvertLoToInt32x4 tests the simd conversion method f against the expected behavior generated by want.
  5139  // This converts only the low 4 elements.
  5140  func testInt8x64ConvertLoToInt32x4(t *testing.T, f func(x archsimd.Int8x64) archsimd.Int32x4, want func(x []int8) []int32) {
  5141  	n := 64
  5142  	t.Helper()
  5143  	forSlice(t, int8s, n, func(x []int8) bool {
  5144  		t.Helper()
  5145  		a := archsimd.LoadInt8x64(x)
  5146  		g := make([]int32, 4)
  5147  		f(a).Store(g)
  5148  		w := want(x)
  5149  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5150  	})
  5151  }
  5152  
  5153  // testInt16x32ConvertLoToInt32x4 tests the simd conversion method f against the expected behavior generated by want.
  5154  // This converts only the low 4 elements.
  5155  func testInt16x32ConvertLoToInt32x4(t *testing.T, f func(x archsimd.Int16x32) archsimd.Int32x4, want func(x []int16) []int32) {
  5156  	n := 32
  5157  	t.Helper()
  5158  	forSlice(t, int16s, n, func(x []int16) bool {
  5159  		t.Helper()
  5160  		a := archsimd.LoadInt16x32(x)
  5161  		g := make([]int32, 4)
  5162  		f(a).Store(g)
  5163  		w := want(x)
  5164  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5165  	})
  5166  }
  5167  
  5168  // testInt32x16ConvertLoToInt32x4 tests the simd conversion method f against the expected behavior generated by want.
  5169  // This converts only the low 4 elements.
  5170  func testInt32x16ConvertLoToInt32x4(t *testing.T, f func(x archsimd.Int32x16) archsimd.Int32x4, want func(x []int32) []int32) {
  5171  	n := 16
  5172  	t.Helper()
  5173  	forSlice(t, int32s, n, func(x []int32) bool {
  5174  		t.Helper()
  5175  		a := archsimd.LoadInt32x16(x)
  5176  		g := make([]int32, 4)
  5177  		f(a).Store(g)
  5178  		w := want(x)
  5179  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5180  	})
  5181  }
  5182  
  5183  // testInt64x8ConvertLoToInt32x4 tests the simd conversion method f against the expected behavior generated by want.
  5184  // This converts only the low 4 elements.
  5185  func testInt64x8ConvertLoToInt32x4(t *testing.T, f func(x archsimd.Int64x8) archsimd.Int32x4, want func(x []int64) []int32) {
  5186  	n := 8
  5187  	t.Helper()
  5188  	forSlice(t, int64s, n, func(x []int64) bool {
  5189  		t.Helper()
  5190  		a := archsimd.LoadInt64x8(x)
  5191  		g := make([]int32, 4)
  5192  		f(a).Store(g)
  5193  		w := want(x)
  5194  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5195  	})
  5196  }
  5197  
  5198  // testUint8x64ConvertLoToInt32x4 tests the simd conversion method f against the expected behavior generated by want.
  5199  // This converts only the low 4 elements.
  5200  func testUint8x64ConvertLoToInt32x4(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Int32x4, want func(x []uint8) []int32) {
  5201  	n := 64
  5202  	t.Helper()
  5203  	forSlice(t, uint8s, n, func(x []uint8) bool {
  5204  		t.Helper()
  5205  		a := archsimd.LoadUint8x64(x)
  5206  		g := make([]int32, 4)
  5207  		f(a).Store(g)
  5208  		w := want(x)
  5209  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5210  	})
  5211  }
  5212  
  5213  // testUint16x32ConvertLoToInt32x4 tests the simd conversion method f against the expected behavior generated by want.
  5214  // This converts only the low 4 elements.
  5215  func testUint16x32ConvertLoToInt32x4(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Int32x4, want func(x []uint16) []int32) {
  5216  	n := 32
  5217  	t.Helper()
  5218  	forSlice(t, uint16s, n, func(x []uint16) bool {
  5219  		t.Helper()
  5220  		a := archsimd.LoadUint16x32(x)
  5221  		g := make([]int32, 4)
  5222  		f(a).Store(g)
  5223  		w := want(x)
  5224  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5225  	})
  5226  }
  5227  
  5228  // testUint32x16ConvertLoToInt32x4 tests the simd conversion method f against the expected behavior generated by want.
  5229  // This converts only the low 4 elements.
  5230  func testUint32x16ConvertLoToInt32x4(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Int32x4, want func(x []uint32) []int32) {
  5231  	n := 16
  5232  	t.Helper()
  5233  	forSlice(t, uint32s, n, func(x []uint32) bool {
  5234  		t.Helper()
  5235  		a := archsimd.LoadUint32x16(x)
  5236  		g := make([]int32, 4)
  5237  		f(a).Store(g)
  5238  		w := want(x)
  5239  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5240  	})
  5241  }
  5242  
  5243  // testUint64x8ConvertLoToInt32x4 tests the simd conversion method f against the expected behavior generated by want.
  5244  // This converts only the low 4 elements.
  5245  func testUint64x8ConvertLoToInt32x4(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Int32x4, want func(x []uint64) []int32) {
  5246  	n := 8
  5247  	t.Helper()
  5248  	forSlice(t, uint64s, n, func(x []uint64) bool {
  5249  		t.Helper()
  5250  		a := archsimd.LoadUint64x8(x)
  5251  		g := make([]int32, 4)
  5252  		f(a).Store(g)
  5253  		w := want(x)
  5254  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5255  	})
  5256  }
  5257  
  5258  // testFloat32x16ConvertLoToInt32x4 tests the simd conversion method f against the expected behavior generated by want.
  5259  // This converts only the low 4 elements.
  5260  func testFloat32x16ConvertLoToInt32x4(t *testing.T, f func(x archsimd.Float32x16) archsimd.Int32x4, want func(x []float32) []int32) {
  5261  	n := 16
  5262  	t.Helper()
  5263  	forSlice(t, float32s, n, func(x []float32) bool {
  5264  		t.Helper()
  5265  		a := archsimd.LoadFloat32x16(x)
  5266  		g := make([]int32, 4)
  5267  		f(a).Store(g)
  5268  		w := want(x)
  5269  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5270  	})
  5271  }
  5272  
  5273  // testFloat64x8ConvertLoToInt32x4 tests the simd conversion method f against the expected behavior generated by want.
  5274  // This converts only the low 4 elements.
  5275  func testFloat64x8ConvertLoToInt32x4(t *testing.T, f func(x archsimd.Float64x8) archsimd.Int32x4, want func(x []float64) []int32) {
  5276  	n := 8
  5277  	t.Helper()
  5278  	forSlice(t, float64s, n, func(x []float64) bool {
  5279  		t.Helper()
  5280  		a := archsimd.LoadFloat64x8(x)
  5281  		g := make([]int32, 4)
  5282  		f(a).Store(g)
  5283  		w := want(x)
  5284  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5285  	})
  5286  }
  5287  
  5288  // testInt8x16ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5289  // This converts only the low 8 elements.
  5290  func testInt8x16ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Int8x16) archsimd.Int32x8, want func(x []int8) []int32) {
  5291  	n := 16
  5292  	t.Helper()
  5293  	forSlice(t, int8s, n, func(x []int8) bool {
  5294  		t.Helper()
  5295  		a := archsimd.LoadInt8x16(x)
  5296  		g := make([]int32, 8)
  5297  		f(a).Store(g)
  5298  		w := want(x)
  5299  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5300  	})
  5301  }
  5302  
  5303  // testInt16x8ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5304  // This converts only the low 8 elements.
  5305  func testInt16x8ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Int16x8) archsimd.Int32x8, want func(x []int16) []int32) {
  5306  	n := 8
  5307  	t.Helper()
  5308  	forSlice(t, int16s, n, func(x []int16) bool {
  5309  		t.Helper()
  5310  		a := archsimd.LoadInt16x8(x)
  5311  		g := make([]int32, 8)
  5312  		f(a).Store(g)
  5313  		w := want(x)
  5314  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5315  	})
  5316  }
  5317  
  5318  // testInt32x4ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5319  // This converts only the low 8 elements.
  5320  func testInt32x4ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Int32x4) archsimd.Int32x8, want func(x []int32) []int32) {
  5321  	n := 4
  5322  	t.Helper()
  5323  	forSlice(t, int32s, n, func(x []int32) bool {
  5324  		t.Helper()
  5325  		a := archsimd.LoadInt32x4(x)
  5326  		g := make([]int32, 8)
  5327  		f(a).Store(g)
  5328  		w := want(x)
  5329  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5330  	})
  5331  }
  5332  
  5333  // testInt64x2ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5334  // This converts only the low 8 elements.
  5335  func testInt64x2ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Int64x2) archsimd.Int32x8, want func(x []int64) []int32) {
  5336  	n := 2
  5337  	t.Helper()
  5338  	forSlice(t, int64s, n, func(x []int64) bool {
  5339  		t.Helper()
  5340  		a := archsimd.LoadInt64x2(x)
  5341  		g := make([]int32, 8)
  5342  		f(a).Store(g)
  5343  		w := want(x)
  5344  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5345  	})
  5346  }
  5347  
  5348  // testUint8x16ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5349  // This converts only the low 8 elements.
  5350  func testUint8x16ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Int32x8, want func(x []uint8) []int32) {
  5351  	n := 16
  5352  	t.Helper()
  5353  	forSlice(t, uint8s, n, func(x []uint8) bool {
  5354  		t.Helper()
  5355  		a := archsimd.LoadUint8x16(x)
  5356  		g := make([]int32, 8)
  5357  		f(a).Store(g)
  5358  		w := want(x)
  5359  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5360  	})
  5361  }
  5362  
  5363  // testUint16x8ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5364  // This converts only the low 8 elements.
  5365  func testUint16x8ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Int32x8, want func(x []uint16) []int32) {
  5366  	n := 8
  5367  	t.Helper()
  5368  	forSlice(t, uint16s, n, func(x []uint16) bool {
  5369  		t.Helper()
  5370  		a := archsimd.LoadUint16x8(x)
  5371  		g := make([]int32, 8)
  5372  		f(a).Store(g)
  5373  		w := want(x)
  5374  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5375  	})
  5376  }
  5377  
  5378  // testUint32x4ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5379  // This converts only the low 8 elements.
  5380  func testUint32x4ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Int32x8, want func(x []uint32) []int32) {
  5381  	n := 4
  5382  	t.Helper()
  5383  	forSlice(t, uint32s, n, func(x []uint32) bool {
  5384  		t.Helper()
  5385  		a := archsimd.LoadUint32x4(x)
  5386  		g := make([]int32, 8)
  5387  		f(a).Store(g)
  5388  		w := want(x)
  5389  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5390  	})
  5391  }
  5392  
  5393  // testUint64x2ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5394  // This converts only the low 8 elements.
  5395  func testUint64x2ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Int32x8, want func(x []uint64) []int32) {
  5396  	n := 2
  5397  	t.Helper()
  5398  	forSlice(t, uint64s, n, func(x []uint64) bool {
  5399  		t.Helper()
  5400  		a := archsimd.LoadUint64x2(x)
  5401  		g := make([]int32, 8)
  5402  		f(a).Store(g)
  5403  		w := want(x)
  5404  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5405  	})
  5406  }
  5407  
  5408  // testFloat32x4ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5409  // This converts only the low 8 elements.
  5410  func testFloat32x4ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Float32x4) archsimd.Int32x8, want func(x []float32) []int32) {
  5411  	n := 4
  5412  	t.Helper()
  5413  	forSlice(t, float32s, n, func(x []float32) bool {
  5414  		t.Helper()
  5415  		a := archsimd.LoadFloat32x4(x)
  5416  		g := make([]int32, 8)
  5417  		f(a).Store(g)
  5418  		w := want(x)
  5419  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5420  	})
  5421  }
  5422  
  5423  // testFloat64x2ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5424  // This converts only the low 8 elements.
  5425  func testFloat64x2ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Float64x2) archsimd.Int32x8, want func(x []float64) []int32) {
  5426  	n := 2
  5427  	t.Helper()
  5428  	forSlice(t, float64s, n, func(x []float64) bool {
  5429  		t.Helper()
  5430  		a := archsimd.LoadFloat64x2(x)
  5431  		g := make([]int32, 8)
  5432  		f(a).Store(g)
  5433  		w := want(x)
  5434  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5435  	})
  5436  }
  5437  
  5438  // testInt8x32ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5439  // This converts only the low 8 elements.
  5440  func testInt8x32ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Int8x32) archsimd.Int32x8, want func(x []int8) []int32) {
  5441  	n := 32
  5442  	t.Helper()
  5443  	forSlice(t, int8s, n, func(x []int8) bool {
  5444  		t.Helper()
  5445  		a := archsimd.LoadInt8x32(x)
  5446  		g := make([]int32, 8)
  5447  		f(a).Store(g)
  5448  		w := want(x)
  5449  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5450  	})
  5451  }
  5452  
  5453  // testInt16x16ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5454  // This converts only the low 8 elements.
  5455  func testInt16x16ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Int16x16) archsimd.Int32x8, want func(x []int16) []int32) {
  5456  	n := 16
  5457  	t.Helper()
  5458  	forSlice(t, int16s, n, func(x []int16) bool {
  5459  		t.Helper()
  5460  		a := archsimd.LoadInt16x16(x)
  5461  		g := make([]int32, 8)
  5462  		f(a).Store(g)
  5463  		w := want(x)
  5464  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5465  	})
  5466  }
  5467  
  5468  // testInt32x8ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5469  // This converts only the low 8 elements.
  5470  func testInt32x8ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Int32x8) archsimd.Int32x8, want func(x []int32) []int32) {
  5471  	n := 8
  5472  	t.Helper()
  5473  	forSlice(t, int32s, n, func(x []int32) bool {
  5474  		t.Helper()
  5475  		a := archsimd.LoadInt32x8(x)
  5476  		g := make([]int32, 8)
  5477  		f(a).Store(g)
  5478  		w := want(x)
  5479  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5480  	})
  5481  }
  5482  
  5483  // testInt64x4ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5484  // This converts only the low 8 elements.
  5485  func testInt64x4ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Int64x4) archsimd.Int32x8, want func(x []int64) []int32) {
  5486  	n := 4
  5487  	t.Helper()
  5488  	forSlice(t, int64s, n, func(x []int64) bool {
  5489  		t.Helper()
  5490  		a := archsimd.LoadInt64x4(x)
  5491  		g := make([]int32, 8)
  5492  		f(a).Store(g)
  5493  		w := want(x)
  5494  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5495  	})
  5496  }
  5497  
  5498  // testUint8x32ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5499  // This converts only the low 8 elements.
  5500  func testUint8x32ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Int32x8, want func(x []uint8) []int32) {
  5501  	n := 32
  5502  	t.Helper()
  5503  	forSlice(t, uint8s, n, func(x []uint8) bool {
  5504  		t.Helper()
  5505  		a := archsimd.LoadUint8x32(x)
  5506  		g := make([]int32, 8)
  5507  		f(a).Store(g)
  5508  		w := want(x)
  5509  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5510  	})
  5511  }
  5512  
  5513  // testUint16x16ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5514  // This converts only the low 8 elements.
  5515  func testUint16x16ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Int32x8, want func(x []uint16) []int32) {
  5516  	n := 16
  5517  	t.Helper()
  5518  	forSlice(t, uint16s, n, func(x []uint16) bool {
  5519  		t.Helper()
  5520  		a := archsimd.LoadUint16x16(x)
  5521  		g := make([]int32, 8)
  5522  		f(a).Store(g)
  5523  		w := want(x)
  5524  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5525  	})
  5526  }
  5527  
  5528  // testUint32x8ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5529  // This converts only the low 8 elements.
  5530  func testUint32x8ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Int32x8, want func(x []uint32) []int32) {
  5531  	n := 8
  5532  	t.Helper()
  5533  	forSlice(t, uint32s, n, func(x []uint32) bool {
  5534  		t.Helper()
  5535  		a := archsimd.LoadUint32x8(x)
  5536  		g := make([]int32, 8)
  5537  		f(a).Store(g)
  5538  		w := want(x)
  5539  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5540  	})
  5541  }
  5542  
  5543  // testUint64x4ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5544  // This converts only the low 8 elements.
  5545  func testUint64x4ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Int32x8, want func(x []uint64) []int32) {
  5546  	n := 4
  5547  	t.Helper()
  5548  	forSlice(t, uint64s, n, func(x []uint64) bool {
  5549  		t.Helper()
  5550  		a := archsimd.LoadUint64x4(x)
  5551  		g := make([]int32, 8)
  5552  		f(a).Store(g)
  5553  		w := want(x)
  5554  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5555  	})
  5556  }
  5557  
  5558  // testFloat32x8ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5559  // This converts only the low 8 elements.
  5560  func testFloat32x8ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Float32x8) archsimd.Int32x8, want func(x []float32) []int32) {
  5561  	n := 8
  5562  	t.Helper()
  5563  	forSlice(t, float32s, n, func(x []float32) bool {
  5564  		t.Helper()
  5565  		a := archsimd.LoadFloat32x8(x)
  5566  		g := make([]int32, 8)
  5567  		f(a).Store(g)
  5568  		w := want(x)
  5569  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5570  	})
  5571  }
  5572  
  5573  // testFloat64x4ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5574  // This converts only the low 8 elements.
  5575  func testFloat64x4ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Float64x4) archsimd.Int32x8, want func(x []float64) []int32) {
  5576  	n := 4
  5577  	t.Helper()
  5578  	forSlice(t, float64s, n, func(x []float64) bool {
  5579  		t.Helper()
  5580  		a := archsimd.LoadFloat64x4(x)
  5581  		g := make([]int32, 8)
  5582  		f(a).Store(g)
  5583  		w := want(x)
  5584  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5585  	})
  5586  }
  5587  
  5588  // testInt8x64ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5589  // This converts only the low 8 elements.
  5590  func testInt8x64ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Int8x64) archsimd.Int32x8, want func(x []int8) []int32) {
  5591  	n := 64
  5592  	t.Helper()
  5593  	forSlice(t, int8s, n, func(x []int8) bool {
  5594  		t.Helper()
  5595  		a := archsimd.LoadInt8x64(x)
  5596  		g := make([]int32, 8)
  5597  		f(a).Store(g)
  5598  		w := want(x)
  5599  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5600  	})
  5601  }
  5602  
  5603  // testInt16x32ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5604  // This converts only the low 8 elements.
  5605  func testInt16x32ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Int16x32) archsimd.Int32x8, want func(x []int16) []int32) {
  5606  	n := 32
  5607  	t.Helper()
  5608  	forSlice(t, int16s, n, func(x []int16) bool {
  5609  		t.Helper()
  5610  		a := archsimd.LoadInt16x32(x)
  5611  		g := make([]int32, 8)
  5612  		f(a).Store(g)
  5613  		w := want(x)
  5614  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5615  	})
  5616  }
  5617  
  5618  // testInt32x16ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5619  // This converts only the low 8 elements.
  5620  func testInt32x16ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Int32x16) archsimd.Int32x8, want func(x []int32) []int32) {
  5621  	n := 16
  5622  	t.Helper()
  5623  	forSlice(t, int32s, n, func(x []int32) bool {
  5624  		t.Helper()
  5625  		a := archsimd.LoadInt32x16(x)
  5626  		g := make([]int32, 8)
  5627  		f(a).Store(g)
  5628  		w := want(x)
  5629  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5630  	})
  5631  }
  5632  
  5633  // testInt64x8ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5634  // This converts only the low 8 elements.
  5635  func testInt64x8ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Int64x8) archsimd.Int32x8, want func(x []int64) []int32) {
  5636  	n := 8
  5637  	t.Helper()
  5638  	forSlice(t, int64s, n, func(x []int64) bool {
  5639  		t.Helper()
  5640  		a := archsimd.LoadInt64x8(x)
  5641  		g := make([]int32, 8)
  5642  		f(a).Store(g)
  5643  		w := want(x)
  5644  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5645  	})
  5646  }
  5647  
  5648  // testUint8x64ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5649  // This converts only the low 8 elements.
  5650  func testUint8x64ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Int32x8, want func(x []uint8) []int32) {
  5651  	n := 64
  5652  	t.Helper()
  5653  	forSlice(t, uint8s, n, func(x []uint8) bool {
  5654  		t.Helper()
  5655  		a := archsimd.LoadUint8x64(x)
  5656  		g := make([]int32, 8)
  5657  		f(a).Store(g)
  5658  		w := want(x)
  5659  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5660  	})
  5661  }
  5662  
  5663  // testUint16x32ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5664  // This converts only the low 8 elements.
  5665  func testUint16x32ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Int32x8, want func(x []uint16) []int32) {
  5666  	n := 32
  5667  	t.Helper()
  5668  	forSlice(t, uint16s, n, func(x []uint16) bool {
  5669  		t.Helper()
  5670  		a := archsimd.LoadUint16x32(x)
  5671  		g := make([]int32, 8)
  5672  		f(a).Store(g)
  5673  		w := want(x)
  5674  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5675  	})
  5676  }
  5677  
  5678  // testUint32x16ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5679  // This converts only the low 8 elements.
  5680  func testUint32x16ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Int32x8, want func(x []uint32) []int32) {
  5681  	n := 16
  5682  	t.Helper()
  5683  	forSlice(t, uint32s, n, func(x []uint32) bool {
  5684  		t.Helper()
  5685  		a := archsimd.LoadUint32x16(x)
  5686  		g := make([]int32, 8)
  5687  		f(a).Store(g)
  5688  		w := want(x)
  5689  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5690  	})
  5691  }
  5692  
  5693  // testUint64x8ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5694  // This converts only the low 8 elements.
  5695  func testUint64x8ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Int32x8, want func(x []uint64) []int32) {
  5696  	n := 8
  5697  	t.Helper()
  5698  	forSlice(t, uint64s, n, func(x []uint64) bool {
  5699  		t.Helper()
  5700  		a := archsimd.LoadUint64x8(x)
  5701  		g := make([]int32, 8)
  5702  		f(a).Store(g)
  5703  		w := want(x)
  5704  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5705  	})
  5706  }
  5707  
  5708  // testFloat32x16ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5709  // This converts only the low 8 elements.
  5710  func testFloat32x16ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Float32x16) archsimd.Int32x8, want func(x []float32) []int32) {
  5711  	n := 16
  5712  	t.Helper()
  5713  	forSlice(t, float32s, n, func(x []float32) bool {
  5714  		t.Helper()
  5715  		a := archsimd.LoadFloat32x16(x)
  5716  		g := make([]int32, 8)
  5717  		f(a).Store(g)
  5718  		w := want(x)
  5719  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5720  	})
  5721  }
  5722  
  5723  // testFloat64x8ConvertLoToInt32x8 tests the simd conversion method f against the expected behavior generated by want.
  5724  // This converts only the low 8 elements.
  5725  func testFloat64x8ConvertLoToInt32x8(t *testing.T, f func(x archsimd.Float64x8) archsimd.Int32x8, want func(x []float64) []int32) {
  5726  	n := 8
  5727  	t.Helper()
  5728  	forSlice(t, float64s, n, func(x []float64) bool {
  5729  		t.Helper()
  5730  		a := archsimd.LoadFloat64x8(x)
  5731  		g := make([]int32, 8)
  5732  		f(a).Store(g)
  5733  		w := want(x)
  5734  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5735  	})
  5736  }
  5737  
  5738  // testInt8x32ConvertLoToUint32x4 tests the simd conversion method f against the expected behavior generated by want.
  5739  // This converts only the low 4 elements.
  5740  func testInt8x32ConvertLoToUint32x4(t *testing.T, f func(x archsimd.Int8x32) archsimd.Uint32x4, want func(x []int8) []uint32) {
  5741  	n := 32
  5742  	t.Helper()
  5743  	forSlice(t, int8s, n, func(x []int8) bool {
  5744  		t.Helper()
  5745  		a := archsimd.LoadInt8x32(x)
  5746  		g := make([]uint32, 4)
  5747  		f(a).Store(g)
  5748  		w := want(x)
  5749  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5750  	})
  5751  }
  5752  
  5753  // testInt16x16ConvertLoToUint32x4 tests the simd conversion method f against the expected behavior generated by want.
  5754  // This converts only the low 4 elements.
  5755  func testInt16x16ConvertLoToUint32x4(t *testing.T, f func(x archsimd.Int16x16) archsimd.Uint32x4, want func(x []int16) []uint32) {
  5756  	n := 16
  5757  	t.Helper()
  5758  	forSlice(t, int16s, n, func(x []int16) bool {
  5759  		t.Helper()
  5760  		a := archsimd.LoadInt16x16(x)
  5761  		g := make([]uint32, 4)
  5762  		f(a).Store(g)
  5763  		w := want(x)
  5764  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5765  	})
  5766  }
  5767  
  5768  // testInt32x8ConvertLoToUint32x4 tests the simd conversion method f against the expected behavior generated by want.
  5769  // This converts only the low 4 elements.
  5770  func testInt32x8ConvertLoToUint32x4(t *testing.T, f func(x archsimd.Int32x8) archsimd.Uint32x4, want func(x []int32) []uint32) {
  5771  	n := 8
  5772  	t.Helper()
  5773  	forSlice(t, int32s, n, func(x []int32) bool {
  5774  		t.Helper()
  5775  		a := archsimd.LoadInt32x8(x)
  5776  		g := make([]uint32, 4)
  5777  		f(a).Store(g)
  5778  		w := want(x)
  5779  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5780  	})
  5781  }
  5782  
  5783  // testInt64x4ConvertLoToUint32x4 tests the simd conversion method f against the expected behavior generated by want.
  5784  // This converts only the low 4 elements.
  5785  func testInt64x4ConvertLoToUint32x4(t *testing.T, f func(x archsimd.Int64x4) archsimd.Uint32x4, want func(x []int64) []uint32) {
  5786  	n := 4
  5787  	t.Helper()
  5788  	forSlice(t, int64s, n, func(x []int64) bool {
  5789  		t.Helper()
  5790  		a := archsimd.LoadInt64x4(x)
  5791  		g := make([]uint32, 4)
  5792  		f(a).Store(g)
  5793  		w := want(x)
  5794  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5795  	})
  5796  }
  5797  
  5798  // testUint8x32ConvertLoToUint32x4 tests the simd conversion method f against the expected behavior generated by want.
  5799  // This converts only the low 4 elements.
  5800  func testUint8x32ConvertLoToUint32x4(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Uint32x4, want func(x []uint8) []uint32) {
  5801  	n := 32
  5802  	t.Helper()
  5803  	forSlice(t, uint8s, n, func(x []uint8) bool {
  5804  		t.Helper()
  5805  		a := archsimd.LoadUint8x32(x)
  5806  		g := make([]uint32, 4)
  5807  		f(a).Store(g)
  5808  		w := want(x)
  5809  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5810  	})
  5811  }
  5812  
  5813  // testUint16x16ConvertLoToUint32x4 tests the simd conversion method f against the expected behavior generated by want.
  5814  // This converts only the low 4 elements.
  5815  func testUint16x16ConvertLoToUint32x4(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Uint32x4, want func(x []uint16) []uint32) {
  5816  	n := 16
  5817  	t.Helper()
  5818  	forSlice(t, uint16s, n, func(x []uint16) bool {
  5819  		t.Helper()
  5820  		a := archsimd.LoadUint16x16(x)
  5821  		g := make([]uint32, 4)
  5822  		f(a).Store(g)
  5823  		w := want(x)
  5824  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5825  	})
  5826  }
  5827  
  5828  // testUint32x8ConvertLoToUint32x4 tests the simd conversion method f against the expected behavior generated by want.
  5829  // This converts only the low 4 elements.
  5830  func testUint32x8ConvertLoToUint32x4(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Uint32x4, want func(x []uint32) []uint32) {
  5831  	n := 8
  5832  	t.Helper()
  5833  	forSlice(t, uint32s, n, func(x []uint32) bool {
  5834  		t.Helper()
  5835  		a := archsimd.LoadUint32x8(x)
  5836  		g := make([]uint32, 4)
  5837  		f(a).Store(g)
  5838  		w := want(x)
  5839  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5840  	})
  5841  }
  5842  
  5843  // testUint64x4ConvertLoToUint32x4 tests the simd conversion method f against the expected behavior generated by want.
  5844  // This converts only the low 4 elements.
  5845  func testUint64x4ConvertLoToUint32x4(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Uint32x4, want func(x []uint64) []uint32) {
  5846  	n := 4
  5847  	t.Helper()
  5848  	forSlice(t, uint64s, n, func(x []uint64) bool {
  5849  		t.Helper()
  5850  		a := archsimd.LoadUint64x4(x)
  5851  		g := make([]uint32, 4)
  5852  		f(a).Store(g)
  5853  		w := want(x)
  5854  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5855  	})
  5856  }
  5857  
  5858  // testFloat32x8ConvertLoToUint32x4 tests the simd conversion method f against the expected behavior generated by want.
  5859  // This converts only the low 4 elements.
  5860  func testFloat32x8ConvertLoToUint32x4(t *testing.T, f func(x archsimd.Float32x8) archsimd.Uint32x4, want func(x []float32) []uint32) {
  5861  	n := 8
  5862  	t.Helper()
  5863  	forSlice(t, float32s, n, func(x []float32) bool {
  5864  		t.Helper()
  5865  		a := archsimd.LoadFloat32x8(x)
  5866  		g := make([]uint32, 4)
  5867  		f(a).Store(g)
  5868  		w := want(x)
  5869  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5870  	})
  5871  }
  5872  
  5873  // testFloat64x4ConvertLoToUint32x4 tests the simd conversion method f against the expected behavior generated by want.
  5874  // This converts only the low 4 elements.
  5875  func testFloat64x4ConvertLoToUint32x4(t *testing.T, f func(x archsimd.Float64x4) archsimd.Uint32x4, want func(x []float64) []uint32) {
  5876  	n := 4
  5877  	t.Helper()
  5878  	forSlice(t, float64s, n, func(x []float64) bool {
  5879  		t.Helper()
  5880  		a := archsimd.LoadFloat64x4(x)
  5881  		g := make([]uint32, 4)
  5882  		f(a).Store(g)
  5883  		w := want(x)
  5884  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5885  	})
  5886  }
  5887  
  5888  // testInt8x64ConvertLoToUint32x4 tests the simd conversion method f against the expected behavior generated by want.
  5889  // This converts only the low 4 elements.
  5890  func testInt8x64ConvertLoToUint32x4(t *testing.T, f func(x archsimd.Int8x64) archsimd.Uint32x4, want func(x []int8) []uint32) {
  5891  	n := 64
  5892  	t.Helper()
  5893  	forSlice(t, int8s, n, func(x []int8) bool {
  5894  		t.Helper()
  5895  		a := archsimd.LoadInt8x64(x)
  5896  		g := make([]uint32, 4)
  5897  		f(a).Store(g)
  5898  		w := want(x)
  5899  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5900  	})
  5901  }
  5902  
  5903  // testInt16x32ConvertLoToUint32x4 tests the simd conversion method f against the expected behavior generated by want.
  5904  // This converts only the low 4 elements.
  5905  func testInt16x32ConvertLoToUint32x4(t *testing.T, f func(x archsimd.Int16x32) archsimd.Uint32x4, want func(x []int16) []uint32) {
  5906  	n := 32
  5907  	t.Helper()
  5908  	forSlice(t, int16s, n, func(x []int16) bool {
  5909  		t.Helper()
  5910  		a := archsimd.LoadInt16x32(x)
  5911  		g := make([]uint32, 4)
  5912  		f(a).Store(g)
  5913  		w := want(x)
  5914  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5915  	})
  5916  }
  5917  
  5918  // testInt32x16ConvertLoToUint32x4 tests the simd conversion method f against the expected behavior generated by want.
  5919  // This converts only the low 4 elements.
  5920  func testInt32x16ConvertLoToUint32x4(t *testing.T, f func(x archsimd.Int32x16) archsimd.Uint32x4, want func(x []int32) []uint32) {
  5921  	n := 16
  5922  	t.Helper()
  5923  	forSlice(t, int32s, n, func(x []int32) bool {
  5924  		t.Helper()
  5925  		a := archsimd.LoadInt32x16(x)
  5926  		g := make([]uint32, 4)
  5927  		f(a).Store(g)
  5928  		w := want(x)
  5929  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5930  	})
  5931  }
  5932  
  5933  // testInt64x8ConvertLoToUint32x4 tests the simd conversion method f against the expected behavior generated by want.
  5934  // This converts only the low 4 elements.
  5935  func testInt64x8ConvertLoToUint32x4(t *testing.T, f func(x archsimd.Int64x8) archsimd.Uint32x4, want func(x []int64) []uint32) {
  5936  	n := 8
  5937  	t.Helper()
  5938  	forSlice(t, int64s, n, func(x []int64) bool {
  5939  		t.Helper()
  5940  		a := archsimd.LoadInt64x8(x)
  5941  		g := make([]uint32, 4)
  5942  		f(a).Store(g)
  5943  		w := want(x)
  5944  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5945  	})
  5946  }
  5947  
  5948  // testUint8x64ConvertLoToUint32x4 tests the simd conversion method f against the expected behavior generated by want.
  5949  // This converts only the low 4 elements.
  5950  func testUint8x64ConvertLoToUint32x4(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Uint32x4, want func(x []uint8) []uint32) {
  5951  	n := 64
  5952  	t.Helper()
  5953  	forSlice(t, uint8s, n, func(x []uint8) bool {
  5954  		t.Helper()
  5955  		a := archsimd.LoadUint8x64(x)
  5956  		g := make([]uint32, 4)
  5957  		f(a).Store(g)
  5958  		w := want(x)
  5959  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5960  	})
  5961  }
  5962  
  5963  // testUint16x32ConvertLoToUint32x4 tests the simd conversion method f against the expected behavior generated by want.
  5964  // This converts only the low 4 elements.
  5965  func testUint16x32ConvertLoToUint32x4(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Uint32x4, want func(x []uint16) []uint32) {
  5966  	n := 32
  5967  	t.Helper()
  5968  	forSlice(t, uint16s, n, func(x []uint16) bool {
  5969  		t.Helper()
  5970  		a := archsimd.LoadUint16x32(x)
  5971  		g := make([]uint32, 4)
  5972  		f(a).Store(g)
  5973  		w := want(x)
  5974  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5975  	})
  5976  }
  5977  
  5978  // testUint32x16ConvertLoToUint32x4 tests the simd conversion method f against the expected behavior generated by want.
  5979  // This converts only the low 4 elements.
  5980  func testUint32x16ConvertLoToUint32x4(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Uint32x4, want func(x []uint32) []uint32) {
  5981  	n := 16
  5982  	t.Helper()
  5983  	forSlice(t, uint32s, n, func(x []uint32) bool {
  5984  		t.Helper()
  5985  		a := archsimd.LoadUint32x16(x)
  5986  		g := make([]uint32, 4)
  5987  		f(a).Store(g)
  5988  		w := want(x)
  5989  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  5990  	})
  5991  }
  5992  
  5993  // testUint64x8ConvertLoToUint32x4 tests the simd conversion method f against the expected behavior generated by want.
  5994  // This converts only the low 4 elements.
  5995  func testUint64x8ConvertLoToUint32x4(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Uint32x4, want func(x []uint64) []uint32) {
  5996  	n := 8
  5997  	t.Helper()
  5998  	forSlice(t, uint64s, n, func(x []uint64) bool {
  5999  		t.Helper()
  6000  		a := archsimd.LoadUint64x8(x)
  6001  		g := make([]uint32, 4)
  6002  		f(a).Store(g)
  6003  		w := want(x)
  6004  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6005  	})
  6006  }
  6007  
  6008  // testFloat32x16ConvertLoToUint32x4 tests the simd conversion method f against the expected behavior generated by want.
  6009  // This converts only the low 4 elements.
  6010  func testFloat32x16ConvertLoToUint32x4(t *testing.T, f func(x archsimd.Float32x16) archsimd.Uint32x4, want func(x []float32) []uint32) {
  6011  	n := 16
  6012  	t.Helper()
  6013  	forSlice(t, float32s, n, func(x []float32) bool {
  6014  		t.Helper()
  6015  		a := archsimd.LoadFloat32x16(x)
  6016  		g := make([]uint32, 4)
  6017  		f(a).Store(g)
  6018  		w := want(x)
  6019  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6020  	})
  6021  }
  6022  
  6023  // testFloat64x8ConvertLoToUint32x4 tests the simd conversion method f against the expected behavior generated by want.
  6024  // This converts only the low 4 elements.
  6025  func testFloat64x8ConvertLoToUint32x4(t *testing.T, f func(x archsimd.Float64x8) archsimd.Uint32x4, want func(x []float64) []uint32) {
  6026  	n := 8
  6027  	t.Helper()
  6028  	forSlice(t, float64s, n, func(x []float64) bool {
  6029  		t.Helper()
  6030  		a := archsimd.LoadFloat64x8(x)
  6031  		g := make([]uint32, 4)
  6032  		f(a).Store(g)
  6033  		w := want(x)
  6034  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6035  	})
  6036  }
  6037  
  6038  // testInt8x16ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6039  // This converts only the low 8 elements.
  6040  func testInt8x16ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Int8x16) archsimd.Uint32x8, want func(x []int8) []uint32) {
  6041  	n := 16
  6042  	t.Helper()
  6043  	forSlice(t, int8s, n, func(x []int8) bool {
  6044  		t.Helper()
  6045  		a := archsimd.LoadInt8x16(x)
  6046  		g := make([]uint32, 8)
  6047  		f(a).Store(g)
  6048  		w := want(x)
  6049  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6050  	})
  6051  }
  6052  
  6053  // testInt16x8ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6054  // This converts only the low 8 elements.
  6055  func testInt16x8ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Int16x8) archsimd.Uint32x8, want func(x []int16) []uint32) {
  6056  	n := 8
  6057  	t.Helper()
  6058  	forSlice(t, int16s, n, func(x []int16) bool {
  6059  		t.Helper()
  6060  		a := archsimd.LoadInt16x8(x)
  6061  		g := make([]uint32, 8)
  6062  		f(a).Store(g)
  6063  		w := want(x)
  6064  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6065  	})
  6066  }
  6067  
  6068  // testInt32x4ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6069  // This converts only the low 8 elements.
  6070  func testInt32x4ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Int32x4) archsimd.Uint32x8, want func(x []int32) []uint32) {
  6071  	n := 4
  6072  	t.Helper()
  6073  	forSlice(t, int32s, n, func(x []int32) bool {
  6074  		t.Helper()
  6075  		a := archsimd.LoadInt32x4(x)
  6076  		g := make([]uint32, 8)
  6077  		f(a).Store(g)
  6078  		w := want(x)
  6079  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6080  	})
  6081  }
  6082  
  6083  // testInt64x2ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6084  // This converts only the low 8 elements.
  6085  func testInt64x2ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Int64x2) archsimd.Uint32x8, want func(x []int64) []uint32) {
  6086  	n := 2
  6087  	t.Helper()
  6088  	forSlice(t, int64s, n, func(x []int64) bool {
  6089  		t.Helper()
  6090  		a := archsimd.LoadInt64x2(x)
  6091  		g := make([]uint32, 8)
  6092  		f(a).Store(g)
  6093  		w := want(x)
  6094  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6095  	})
  6096  }
  6097  
  6098  // testUint8x16ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6099  // This converts only the low 8 elements.
  6100  func testUint8x16ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Uint32x8, want func(x []uint8) []uint32) {
  6101  	n := 16
  6102  	t.Helper()
  6103  	forSlice(t, uint8s, n, func(x []uint8) bool {
  6104  		t.Helper()
  6105  		a := archsimd.LoadUint8x16(x)
  6106  		g := make([]uint32, 8)
  6107  		f(a).Store(g)
  6108  		w := want(x)
  6109  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6110  	})
  6111  }
  6112  
  6113  // testUint16x8ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6114  // This converts only the low 8 elements.
  6115  func testUint16x8ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Uint32x8, want func(x []uint16) []uint32) {
  6116  	n := 8
  6117  	t.Helper()
  6118  	forSlice(t, uint16s, n, func(x []uint16) bool {
  6119  		t.Helper()
  6120  		a := archsimd.LoadUint16x8(x)
  6121  		g := make([]uint32, 8)
  6122  		f(a).Store(g)
  6123  		w := want(x)
  6124  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6125  	})
  6126  }
  6127  
  6128  // testUint32x4ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6129  // This converts only the low 8 elements.
  6130  func testUint32x4ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Uint32x8, want func(x []uint32) []uint32) {
  6131  	n := 4
  6132  	t.Helper()
  6133  	forSlice(t, uint32s, n, func(x []uint32) bool {
  6134  		t.Helper()
  6135  		a := archsimd.LoadUint32x4(x)
  6136  		g := make([]uint32, 8)
  6137  		f(a).Store(g)
  6138  		w := want(x)
  6139  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6140  	})
  6141  }
  6142  
  6143  // testUint64x2ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6144  // This converts only the low 8 elements.
  6145  func testUint64x2ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Uint32x8, want func(x []uint64) []uint32) {
  6146  	n := 2
  6147  	t.Helper()
  6148  	forSlice(t, uint64s, n, func(x []uint64) bool {
  6149  		t.Helper()
  6150  		a := archsimd.LoadUint64x2(x)
  6151  		g := make([]uint32, 8)
  6152  		f(a).Store(g)
  6153  		w := want(x)
  6154  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6155  	})
  6156  }
  6157  
  6158  // testFloat32x4ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6159  // This converts only the low 8 elements.
  6160  func testFloat32x4ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Float32x4) archsimd.Uint32x8, want func(x []float32) []uint32) {
  6161  	n := 4
  6162  	t.Helper()
  6163  	forSlice(t, float32s, n, func(x []float32) bool {
  6164  		t.Helper()
  6165  		a := archsimd.LoadFloat32x4(x)
  6166  		g := make([]uint32, 8)
  6167  		f(a).Store(g)
  6168  		w := want(x)
  6169  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6170  	})
  6171  }
  6172  
  6173  // testFloat64x2ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6174  // This converts only the low 8 elements.
  6175  func testFloat64x2ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Float64x2) archsimd.Uint32x8, want func(x []float64) []uint32) {
  6176  	n := 2
  6177  	t.Helper()
  6178  	forSlice(t, float64s, n, func(x []float64) bool {
  6179  		t.Helper()
  6180  		a := archsimd.LoadFloat64x2(x)
  6181  		g := make([]uint32, 8)
  6182  		f(a).Store(g)
  6183  		w := want(x)
  6184  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6185  	})
  6186  }
  6187  
  6188  // testInt8x32ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6189  // This converts only the low 8 elements.
  6190  func testInt8x32ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Int8x32) archsimd.Uint32x8, want func(x []int8) []uint32) {
  6191  	n := 32
  6192  	t.Helper()
  6193  	forSlice(t, int8s, n, func(x []int8) bool {
  6194  		t.Helper()
  6195  		a := archsimd.LoadInt8x32(x)
  6196  		g := make([]uint32, 8)
  6197  		f(a).Store(g)
  6198  		w := want(x)
  6199  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6200  	})
  6201  }
  6202  
  6203  // testInt16x16ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6204  // This converts only the low 8 elements.
  6205  func testInt16x16ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Int16x16) archsimd.Uint32x8, want func(x []int16) []uint32) {
  6206  	n := 16
  6207  	t.Helper()
  6208  	forSlice(t, int16s, n, func(x []int16) bool {
  6209  		t.Helper()
  6210  		a := archsimd.LoadInt16x16(x)
  6211  		g := make([]uint32, 8)
  6212  		f(a).Store(g)
  6213  		w := want(x)
  6214  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6215  	})
  6216  }
  6217  
  6218  // testInt32x8ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6219  // This converts only the low 8 elements.
  6220  func testInt32x8ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Int32x8) archsimd.Uint32x8, want func(x []int32) []uint32) {
  6221  	n := 8
  6222  	t.Helper()
  6223  	forSlice(t, int32s, n, func(x []int32) bool {
  6224  		t.Helper()
  6225  		a := archsimd.LoadInt32x8(x)
  6226  		g := make([]uint32, 8)
  6227  		f(a).Store(g)
  6228  		w := want(x)
  6229  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6230  	})
  6231  }
  6232  
  6233  // testInt64x4ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6234  // This converts only the low 8 elements.
  6235  func testInt64x4ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Int64x4) archsimd.Uint32x8, want func(x []int64) []uint32) {
  6236  	n := 4
  6237  	t.Helper()
  6238  	forSlice(t, int64s, n, func(x []int64) bool {
  6239  		t.Helper()
  6240  		a := archsimd.LoadInt64x4(x)
  6241  		g := make([]uint32, 8)
  6242  		f(a).Store(g)
  6243  		w := want(x)
  6244  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6245  	})
  6246  }
  6247  
  6248  // testUint8x32ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6249  // This converts only the low 8 elements.
  6250  func testUint8x32ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Uint32x8, want func(x []uint8) []uint32) {
  6251  	n := 32
  6252  	t.Helper()
  6253  	forSlice(t, uint8s, n, func(x []uint8) bool {
  6254  		t.Helper()
  6255  		a := archsimd.LoadUint8x32(x)
  6256  		g := make([]uint32, 8)
  6257  		f(a).Store(g)
  6258  		w := want(x)
  6259  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6260  	})
  6261  }
  6262  
  6263  // testUint16x16ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6264  // This converts only the low 8 elements.
  6265  func testUint16x16ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Uint32x8, want func(x []uint16) []uint32) {
  6266  	n := 16
  6267  	t.Helper()
  6268  	forSlice(t, uint16s, n, func(x []uint16) bool {
  6269  		t.Helper()
  6270  		a := archsimd.LoadUint16x16(x)
  6271  		g := make([]uint32, 8)
  6272  		f(a).Store(g)
  6273  		w := want(x)
  6274  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6275  	})
  6276  }
  6277  
  6278  // testUint32x8ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6279  // This converts only the low 8 elements.
  6280  func testUint32x8ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Uint32x8, want func(x []uint32) []uint32) {
  6281  	n := 8
  6282  	t.Helper()
  6283  	forSlice(t, uint32s, n, func(x []uint32) bool {
  6284  		t.Helper()
  6285  		a := archsimd.LoadUint32x8(x)
  6286  		g := make([]uint32, 8)
  6287  		f(a).Store(g)
  6288  		w := want(x)
  6289  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6290  	})
  6291  }
  6292  
  6293  // testUint64x4ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6294  // This converts only the low 8 elements.
  6295  func testUint64x4ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Uint32x8, want func(x []uint64) []uint32) {
  6296  	n := 4
  6297  	t.Helper()
  6298  	forSlice(t, uint64s, n, func(x []uint64) bool {
  6299  		t.Helper()
  6300  		a := archsimd.LoadUint64x4(x)
  6301  		g := make([]uint32, 8)
  6302  		f(a).Store(g)
  6303  		w := want(x)
  6304  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6305  	})
  6306  }
  6307  
  6308  // testFloat32x8ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6309  // This converts only the low 8 elements.
  6310  func testFloat32x8ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Float32x8) archsimd.Uint32x8, want func(x []float32) []uint32) {
  6311  	n := 8
  6312  	t.Helper()
  6313  	forSlice(t, float32s, n, func(x []float32) bool {
  6314  		t.Helper()
  6315  		a := archsimd.LoadFloat32x8(x)
  6316  		g := make([]uint32, 8)
  6317  		f(a).Store(g)
  6318  		w := want(x)
  6319  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6320  	})
  6321  }
  6322  
  6323  // testFloat64x4ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6324  // This converts only the low 8 elements.
  6325  func testFloat64x4ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Float64x4) archsimd.Uint32x8, want func(x []float64) []uint32) {
  6326  	n := 4
  6327  	t.Helper()
  6328  	forSlice(t, float64s, n, func(x []float64) bool {
  6329  		t.Helper()
  6330  		a := archsimd.LoadFloat64x4(x)
  6331  		g := make([]uint32, 8)
  6332  		f(a).Store(g)
  6333  		w := want(x)
  6334  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6335  	})
  6336  }
  6337  
  6338  // testInt8x64ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6339  // This converts only the low 8 elements.
  6340  func testInt8x64ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Int8x64) archsimd.Uint32x8, want func(x []int8) []uint32) {
  6341  	n := 64
  6342  	t.Helper()
  6343  	forSlice(t, int8s, n, func(x []int8) bool {
  6344  		t.Helper()
  6345  		a := archsimd.LoadInt8x64(x)
  6346  		g := make([]uint32, 8)
  6347  		f(a).Store(g)
  6348  		w := want(x)
  6349  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6350  	})
  6351  }
  6352  
  6353  // testInt16x32ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6354  // This converts only the low 8 elements.
  6355  func testInt16x32ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Int16x32) archsimd.Uint32x8, want func(x []int16) []uint32) {
  6356  	n := 32
  6357  	t.Helper()
  6358  	forSlice(t, int16s, n, func(x []int16) bool {
  6359  		t.Helper()
  6360  		a := archsimd.LoadInt16x32(x)
  6361  		g := make([]uint32, 8)
  6362  		f(a).Store(g)
  6363  		w := want(x)
  6364  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6365  	})
  6366  }
  6367  
  6368  // testInt32x16ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6369  // This converts only the low 8 elements.
  6370  func testInt32x16ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Int32x16) archsimd.Uint32x8, want func(x []int32) []uint32) {
  6371  	n := 16
  6372  	t.Helper()
  6373  	forSlice(t, int32s, n, func(x []int32) bool {
  6374  		t.Helper()
  6375  		a := archsimd.LoadInt32x16(x)
  6376  		g := make([]uint32, 8)
  6377  		f(a).Store(g)
  6378  		w := want(x)
  6379  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6380  	})
  6381  }
  6382  
  6383  // testInt64x8ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6384  // This converts only the low 8 elements.
  6385  func testInt64x8ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Int64x8) archsimd.Uint32x8, want func(x []int64) []uint32) {
  6386  	n := 8
  6387  	t.Helper()
  6388  	forSlice(t, int64s, n, func(x []int64) bool {
  6389  		t.Helper()
  6390  		a := archsimd.LoadInt64x8(x)
  6391  		g := make([]uint32, 8)
  6392  		f(a).Store(g)
  6393  		w := want(x)
  6394  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6395  	})
  6396  }
  6397  
  6398  // testUint8x64ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6399  // This converts only the low 8 elements.
  6400  func testUint8x64ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Uint32x8, want func(x []uint8) []uint32) {
  6401  	n := 64
  6402  	t.Helper()
  6403  	forSlice(t, uint8s, n, func(x []uint8) bool {
  6404  		t.Helper()
  6405  		a := archsimd.LoadUint8x64(x)
  6406  		g := make([]uint32, 8)
  6407  		f(a).Store(g)
  6408  		w := want(x)
  6409  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6410  	})
  6411  }
  6412  
  6413  // testUint16x32ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6414  // This converts only the low 8 elements.
  6415  func testUint16x32ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Uint32x8, want func(x []uint16) []uint32) {
  6416  	n := 32
  6417  	t.Helper()
  6418  	forSlice(t, uint16s, n, func(x []uint16) bool {
  6419  		t.Helper()
  6420  		a := archsimd.LoadUint16x32(x)
  6421  		g := make([]uint32, 8)
  6422  		f(a).Store(g)
  6423  		w := want(x)
  6424  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6425  	})
  6426  }
  6427  
  6428  // testUint32x16ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6429  // This converts only the low 8 elements.
  6430  func testUint32x16ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Uint32x8, want func(x []uint32) []uint32) {
  6431  	n := 16
  6432  	t.Helper()
  6433  	forSlice(t, uint32s, n, func(x []uint32) bool {
  6434  		t.Helper()
  6435  		a := archsimd.LoadUint32x16(x)
  6436  		g := make([]uint32, 8)
  6437  		f(a).Store(g)
  6438  		w := want(x)
  6439  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6440  	})
  6441  }
  6442  
  6443  // testUint64x8ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6444  // This converts only the low 8 elements.
  6445  func testUint64x8ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Uint32x8, want func(x []uint64) []uint32) {
  6446  	n := 8
  6447  	t.Helper()
  6448  	forSlice(t, uint64s, n, func(x []uint64) bool {
  6449  		t.Helper()
  6450  		a := archsimd.LoadUint64x8(x)
  6451  		g := make([]uint32, 8)
  6452  		f(a).Store(g)
  6453  		w := want(x)
  6454  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6455  	})
  6456  }
  6457  
  6458  // testFloat32x16ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6459  // This converts only the low 8 elements.
  6460  func testFloat32x16ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Float32x16) archsimd.Uint32x8, want func(x []float32) []uint32) {
  6461  	n := 16
  6462  	t.Helper()
  6463  	forSlice(t, float32s, n, func(x []float32) bool {
  6464  		t.Helper()
  6465  		a := archsimd.LoadFloat32x16(x)
  6466  		g := make([]uint32, 8)
  6467  		f(a).Store(g)
  6468  		w := want(x)
  6469  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6470  	})
  6471  }
  6472  
  6473  // testFloat64x8ConvertLoToUint32x8 tests the simd conversion method f against the expected behavior generated by want.
  6474  // This converts only the low 8 elements.
  6475  func testFloat64x8ConvertLoToUint32x8(t *testing.T, f func(x archsimd.Float64x8) archsimd.Uint32x8, want func(x []float64) []uint32) {
  6476  	n := 8
  6477  	t.Helper()
  6478  	forSlice(t, float64s, n, func(x []float64) bool {
  6479  		t.Helper()
  6480  		a := archsimd.LoadFloat64x8(x)
  6481  		g := make([]uint32, 8)
  6482  		f(a).Store(g)
  6483  		w := want(x)
  6484  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6485  	})
  6486  }
  6487  
  6488  // testInt8x32ConvertLoToInt16x8 tests the simd conversion method f against the expected behavior generated by want.
  6489  // This converts only the low 8 elements.
  6490  func testInt8x32ConvertLoToInt16x8(t *testing.T, f func(x archsimd.Int8x32) archsimd.Int16x8, want func(x []int8) []int16) {
  6491  	n := 32
  6492  	t.Helper()
  6493  	forSlice(t, int8s, n, func(x []int8) bool {
  6494  		t.Helper()
  6495  		a := archsimd.LoadInt8x32(x)
  6496  		g := make([]int16, 8)
  6497  		f(a).Store(g)
  6498  		w := want(x)
  6499  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6500  	})
  6501  }
  6502  
  6503  // testInt16x16ConvertLoToInt16x8 tests the simd conversion method f against the expected behavior generated by want.
  6504  // This converts only the low 8 elements.
  6505  func testInt16x16ConvertLoToInt16x8(t *testing.T, f func(x archsimd.Int16x16) archsimd.Int16x8, want func(x []int16) []int16) {
  6506  	n := 16
  6507  	t.Helper()
  6508  	forSlice(t, int16s, n, func(x []int16) bool {
  6509  		t.Helper()
  6510  		a := archsimd.LoadInt16x16(x)
  6511  		g := make([]int16, 8)
  6512  		f(a).Store(g)
  6513  		w := want(x)
  6514  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6515  	})
  6516  }
  6517  
  6518  // testInt32x8ConvertLoToInt16x8 tests the simd conversion method f against the expected behavior generated by want.
  6519  // This converts only the low 8 elements.
  6520  func testInt32x8ConvertLoToInt16x8(t *testing.T, f func(x archsimd.Int32x8) archsimd.Int16x8, want func(x []int32) []int16) {
  6521  	n := 8
  6522  	t.Helper()
  6523  	forSlice(t, int32s, n, func(x []int32) bool {
  6524  		t.Helper()
  6525  		a := archsimd.LoadInt32x8(x)
  6526  		g := make([]int16, 8)
  6527  		f(a).Store(g)
  6528  		w := want(x)
  6529  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6530  	})
  6531  }
  6532  
  6533  // testInt64x4ConvertLoToInt16x8 tests the simd conversion method f against the expected behavior generated by want.
  6534  // This converts only the low 8 elements.
  6535  func testInt64x4ConvertLoToInt16x8(t *testing.T, f func(x archsimd.Int64x4) archsimd.Int16x8, want func(x []int64) []int16) {
  6536  	n := 4
  6537  	t.Helper()
  6538  	forSlice(t, int64s, n, func(x []int64) bool {
  6539  		t.Helper()
  6540  		a := archsimd.LoadInt64x4(x)
  6541  		g := make([]int16, 8)
  6542  		f(a).Store(g)
  6543  		w := want(x)
  6544  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6545  	})
  6546  }
  6547  
  6548  // testUint8x32ConvertLoToInt16x8 tests the simd conversion method f against the expected behavior generated by want.
  6549  // This converts only the low 8 elements.
  6550  func testUint8x32ConvertLoToInt16x8(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Int16x8, want func(x []uint8) []int16) {
  6551  	n := 32
  6552  	t.Helper()
  6553  	forSlice(t, uint8s, n, func(x []uint8) bool {
  6554  		t.Helper()
  6555  		a := archsimd.LoadUint8x32(x)
  6556  		g := make([]int16, 8)
  6557  		f(a).Store(g)
  6558  		w := want(x)
  6559  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6560  	})
  6561  }
  6562  
  6563  // testUint16x16ConvertLoToInt16x8 tests the simd conversion method f against the expected behavior generated by want.
  6564  // This converts only the low 8 elements.
  6565  func testUint16x16ConvertLoToInt16x8(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Int16x8, want func(x []uint16) []int16) {
  6566  	n := 16
  6567  	t.Helper()
  6568  	forSlice(t, uint16s, n, func(x []uint16) bool {
  6569  		t.Helper()
  6570  		a := archsimd.LoadUint16x16(x)
  6571  		g := make([]int16, 8)
  6572  		f(a).Store(g)
  6573  		w := want(x)
  6574  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6575  	})
  6576  }
  6577  
  6578  // testUint32x8ConvertLoToInt16x8 tests the simd conversion method f against the expected behavior generated by want.
  6579  // This converts only the low 8 elements.
  6580  func testUint32x8ConvertLoToInt16x8(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Int16x8, want func(x []uint32) []int16) {
  6581  	n := 8
  6582  	t.Helper()
  6583  	forSlice(t, uint32s, n, func(x []uint32) bool {
  6584  		t.Helper()
  6585  		a := archsimd.LoadUint32x8(x)
  6586  		g := make([]int16, 8)
  6587  		f(a).Store(g)
  6588  		w := want(x)
  6589  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6590  	})
  6591  }
  6592  
  6593  // testUint64x4ConvertLoToInt16x8 tests the simd conversion method f against the expected behavior generated by want.
  6594  // This converts only the low 8 elements.
  6595  func testUint64x4ConvertLoToInt16x8(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Int16x8, want func(x []uint64) []int16) {
  6596  	n := 4
  6597  	t.Helper()
  6598  	forSlice(t, uint64s, n, func(x []uint64) bool {
  6599  		t.Helper()
  6600  		a := archsimd.LoadUint64x4(x)
  6601  		g := make([]int16, 8)
  6602  		f(a).Store(g)
  6603  		w := want(x)
  6604  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6605  	})
  6606  }
  6607  
  6608  // testFloat32x8ConvertLoToInt16x8 tests the simd conversion method f against the expected behavior generated by want.
  6609  // This converts only the low 8 elements.
  6610  func testFloat32x8ConvertLoToInt16x8(t *testing.T, f func(x archsimd.Float32x8) archsimd.Int16x8, want func(x []float32) []int16) {
  6611  	n := 8
  6612  	t.Helper()
  6613  	forSlice(t, float32s, n, func(x []float32) bool {
  6614  		t.Helper()
  6615  		a := archsimd.LoadFloat32x8(x)
  6616  		g := make([]int16, 8)
  6617  		f(a).Store(g)
  6618  		w := want(x)
  6619  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6620  	})
  6621  }
  6622  
  6623  // testFloat64x4ConvertLoToInt16x8 tests the simd conversion method f against the expected behavior generated by want.
  6624  // This converts only the low 8 elements.
  6625  func testFloat64x4ConvertLoToInt16x8(t *testing.T, f func(x archsimd.Float64x4) archsimd.Int16x8, want func(x []float64) []int16) {
  6626  	n := 4
  6627  	t.Helper()
  6628  	forSlice(t, float64s, n, func(x []float64) bool {
  6629  		t.Helper()
  6630  		a := archsimd.LoadFloat64x4(x)
  6631  		g := make([]int16, 8)
  6632  		f(a).Store(g)
  6633  		w := want(x)
  6634  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6635  	})
  6636  }
  6637  
  6638  // testInt8x64ConvertLoToInt16x8 tests the simd conversion method f against the expected behavior generated by want.
  6639  // This converts only the low 8 elements.
  6640  func testInt8x64ConvertLoToInt16x8(t *testing.T, f func(x archsimd.Int8x64) archsimd.Int16x8, want func(x []int8) []int16) {
  6641  	n := 64
  6642  	t.Helper()
  6643  	forSlice(t, int8s, n, func(x []int8) bool {
  6644  		t.Helper()
  6645  		a := archsimd.LoadInt8x64(x)
  6646  		g := make([]int16, 8)
  6647  		f(a).Store(g)
  6648  		w := want(x)
  6649  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6650  	})
  6651  }
  6652  
  6653  // testInt16x32ConvertLoToInt16x8 tests the simd conversion method f against the expected behavior generated by want.
  6654  // This converts only the low 8 elements.
  6655  func testInt16x32ConvertLoToInt16x8(t *testing.T, f func(x archsimd.Int16x32) archsimd.Int16x8, want func(x []int16) []int16) {
  6656  	n := 32
  6657  	t.Helper()
  6658  	forSlice(t, int16s, n, func(x []int16) bool {
  6659  		t.Helper()
  6660  		a := archsimd.LoadInt16x32(x)
  6661  		g := make([]int16, 8)
  6662  		f(a).Store(g)
  6663  		w := want(x)
  6664  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6665  	})
  6666  }
  6667  
  6668  // testInt32x16ConvertLoToInt16x8 tests the simd conversion method f against the expected behavior generated by want.
  6669  // This converts only the low 8 elements.
  6670  func testInt32x16ConvertLoToInt16x8(t *testing.T, f func(x archsimd.Int32x16) archsimd.Int16x8, want func(x []int32) []int16) {
  6671  	n := 16
  6672  	t.Helper()
  6673  	forSlice(t, int32s, n, func(x []int32) bool {
  6674  		t.Helper()
  6675  		a := archsimd.LoadInt32x16(x)
  6676  		g := make([]int16, 8)
  6677  		f(a).Store(g)
  6678  		w := want(x)
  6679  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6680  	})
  6681  }
  6682  
  6683  // testInt64x8ConvertLoToInt16x8 tests the simd conversion method f against the expected behavior generated by want.
  6684  // This converts only the low 8 elements.
  6685  func testInt64x8ConvertLoToInt16x8(t *testing.T, f func(x archsimd.Int64x8) archsimd.Int16x8, want func(x []int64) []int16) {
  6686  	n := 8
  6687  	t.Helper()
  6688  	forSlice(t, int64s, n, func(x []int64) bool {
  6689  		t.Helper()
  6690  		a := archsimd.LoadInt64x8(x)
  6691  		g := make([]int16, 8)
  6692  		f(a).Store(g)
  6693  		w := want(x)
  6694  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6695  	})
  6696  }
  6697  
  6698  // testUint8x64ConvertLoToInt16x8 tests the simd conversion method f against the expected behavior generated by want.
  6699  // This converts only the low 8 elements.
  6700  func testUint8x64ConvertLoToInt16x8(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Int16x8, want func(x []uint8) []int16) {
  6701  	n := 64
  6702  	t.Helper()
  6703  	forSlice(t, uint8s, n, func(x []uint8) bool {
  6704  		t.Helper()
  6705  		a := archsimd.LoadUint8x64(x)
  6706  		g := make([]int16, 8)
  6707  		f(a).Store(g)
  6708  		w := want(x)
  6709  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6710  	})
  6711  }
  6712  
  6713  // testUint16x32ConvertLoToInt16x8 tests the simd conversion method f against the expected behavior generated by want.
  6714  // This converts only the low 8 elements.
  6715  func testUint16x32ConvertLoToInt16x8(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Int16x8, want func(x []uint16) []int16) {
  6716  	n := 32
  6717  	t.Helper()
  6718  	forSlice(t, uint16s, n, func(x []uint16) bool {
  6719  		t.Helper()
  6720  		a := archsimd.LoadUint16x32(x)
  6721  		g := make([]int16, 8)
  6722  		f(a).Store(g)
  6723  		w := want(x)
  6724  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6725  	})
  6726  }
  6727  
  6728  // testUint32x16ConvertLoToInt16x8 tests the simd conversion method f against the expected behavior generated by want.
  6729  // This converts only the low 8 elements.
  6730  func testUint32x16ConvertLoToInt16x8(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Int16x8, want func(x []uint32) []int16) {
  6731  	n := 16
  6732  	t.Helper()
  6733  	forSlice(t, uint32s, n, func(x []uint32) bool {
  6734  		t.Helper()
  6735  		a := archsimd.LoadUint32x16(x)
  6736  		g := make([]int16, 8)
  6737  		f(a).Store(g)
  6738  		w := want(x)
  6739  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6740  	})
  6741  }
  6742  
  6743  // testUint64x8ConvertLoToInt16x8 tests the simd conversion method f against the expected behavior generated by want.
  6744  // This converts only the low 8 elements.
  6745  func testUint64x8ConvertLoToInt16x8(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Int16x8, want func(x []uint64) []int16) {
  6746  	n := 8
  6747  	t.Helper()
  6748  	forSlice(t, uint64s, n, func(x []uint64) bool {
  6749  		t.Helper()
  6750  		a := archsimd.LoadUint64x8(x)
  6751  		g := make([]int16, 8)
  6752  		f(a).Store(g)
  6753  		w := want(x)
  6754  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6755  	})
  6756  }
  6757  
  6758  // testFloat32x16ConvertLoToInt16x8 tests the simd conversion method f against the expected behavior generated by want.
  6759  // This converts only the low 8 elements.
  6760  func testFloat32x16ConvertLoToInt16x8(t *testing.T, f func(x archsimd.Float32x16) archsimd.Int16x8, want func(x []float32) []int16) {
  6761  	n := 16
  6762  	t.Helper()
  6763  	forSlice(t, float32s, n, func(x []float32) bool {
  6764  		t.Helper()
  6765  		a := archsimd.LoadFloat32x16(x)
  6766  		g := make([]int16, 8)
  6767  		f(a).Store(g)
  6768  		w := want(x)
  6769  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6770  	})
  6771  }
  6772  
  6773  // testFloat64x8ConvertLoToInt16x8 tests the simd conversion method f against the expected behavior generated by want.
  6774  // This converts only the low 8 elements.
  6775  func testFloat64x8ConvertLoToInt16x8(t *testing.T, f func(x archsimd.Float64x8) archsimd.Int16x8, want func(x []float64) []int16) {
  6776  	n := 8
  6777  	t.Helper()
  6778  	forSlice(t, float64s, n, func(x []float64) bool {
  6779  		t.Helper()
  6780  		a := archsimd.LoadFloat64x8(x)
  6781  		g := make([]int16, 8)
  6782  		f(a).Store(g)
  6783  		w := want(x)
  6784  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6785  	})
  6786  }
  6787  
  6788  // testInt8x32ConvertLoToUint16x8 tests the simd conversion method f against the expected behavior generated by want.
  6789  // This converts only the low 8 elements.
  6790  func testInt8x32ConvertLoToUint16x8(t *testing.T, f func(x archsimd.Int8x32) archsimd.Uint16x8, want func(x []int8) []uint16) {
  6791  	n := 32
  6792  	t.Helper()
  6793  	forSlice(t, int8s, n, func(x []int8) bool {
  6794  		t.Helper()
  6795  		a := archsimd.LoadInt8x32(x)
  6796  		g := make([]uint16, 8)
  6797  		f(a).Store(g)
  6798  		w := want(x)
  6799  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6800  	})
  6801  }
  6802  
  6803  // testInt16x16ConvertLoToUint16x8 tests the simd conversion method f against the expected behavior generated by want.
  6804  // This converts only the low 8 elements.
  6805  func testInt16x16ConvertLoToUint16x8(t *testing.T, f func(x archsimd.Int16x16) archsimd.Uint16x8, want func(x []int16) []uint16) {
  6806  	n := 16
  6807  	t.Helper()
  6808  	forSlice(t, int16s, n, func(x []int16) bool {
  6809  		t.Helper()
  6810  		a := archsimd.LoadInt16x16(x)
  6811  		g := make([]uint16, 8)
  6812  		f(a).Store(g)
  6813  		w := want(x)
  6814  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6815  	})
  6816  }
  6817  
  6818  // testInt32x8ConvertLoToUint16x8 tests the simd conversion method f against the expected behavior generated by want.
  6819  // This converts only the low 8 elements.
  6820  func testInt32x8ConvertLoToUint16x8(t *testing.T, f func(x archsimd.Int32x8) archsimd.Uint16x8, want func(x []int32) []uint16) {
  6821  	n := 8
  6822  	t.Helper()
  6823  	forSlice(t, int32s, n, func(x []int32) bool {
  6824  		t.Helper()
  6825  		a := archsimd.LoadInt32x8(x)
  6826  		g := make([]uint16, 8)
  6827  		f(a).Store(g)
  6828  		w := want(x)
  6829  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6830  	})
  6831  }
  6832  
  6833  // testInt64x4ConvertLoToUint16x8 tests the simd conversion method f against the expected behavior generated by want.
  6834  // This converts only the low 8 elements.
  6835  func testInt64x4ConvertLoToUint16x8(t *testing.T, f func(x archsimd.Int64x4) archsimd.Uint16x8, want func(x []int64) []uint16) {
  6836  	n := 4
  6837  	t.Helper()
  6838  	forSlice(t, int64s, n, func(x []int64) bool {
  6839  		t.Helper()
  6840  		a := archsimd.LoadInt64x4(x)
  6841  		g := make([]uint16, 8)
  6842  		f(a).Store(g)
  6843  		w := want(x)
  6844  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6845  	})
  6846  }
  6847  
  6848  // testUint8x32ConvertLoToUint16x8 tests the simd conversion method f against the expected behavior generated by want.
  6849  // This converts only the low 8 elements.
  6850  func testUint8x32ConvertLoToUint16x8(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Uint16x8, want func(x []uint8) []uint16) {
  6851  	n := 32
  6852  	t.Helper()
  6853  	forSlice(t, uint8s, n, func(x []uint8) bool {
  6854  		t.Helper()
  6855  		a := archsimd.LoadUint8x32(x)
  6856  		g := make([]uint16, 8)
  6857  		f(a).Store(g)
  6858  		w := want(x)
  6859  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6860  	})
  6861  }
  6862  
  6863  // testUint16x16ConvertLoToUint16x8 tests the simd conversion method f against the expected behavior generated by want.
  6864  // This converts only the low 8 elements.
  6865  func testUint16x16ConvertLoToUint16x8(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Uint16x8, want func(x []uint16) []uint16) {
  6866  	n := 16
  6867  	t.Helper()
  6868  	forSlice(t, uint16s, n, func(x []uint16) bool {
  6869  		t.Helper()
  6870  		a := archsimd.LoadUint16x16(x)
  6871  		g := make([]uint16, 8)
  6872  		f(a).Store(g)
  6873  		w := want(x)
  6874  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6875  	})
  6876  }
  6877  
  6878  // testUint32x8ConvertLoToUint16x8 tests the simd conversion method f against the expected behavior generated by want.
  6879  // This converts only the low 8 elements.
  6880  func testUint32x8ConvertLoToUint16x8(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Uint16x8, want func(x []uint32) []uint16) {
  6881  	n := 8
  6882  	t.Helper()
  6883  	forSlice(t, uint32s, n, func(x []uint32) bool {
  6884  		t.Helper()
  6885  		a := archsimd.LoadUint32x8(x)
  6886  		g := make([]uint16, 8)
  6887  		f(a).Store(g)
  6888  		w := want(x)
  6889  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6890  	})
  6891  }
  6892  
  6893  // testUint64x4ConvertLoToUint16x8 tests the simd conversion method f against the expected behavior generated by want.
  6894  // This converts only the low 8 elements.
  6895  func testUint64x4ConvertLoToUint16x8(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Uint16x8, want func(x []uint64) []uint16) {
  6896  	n := 4
  6897  	t.Helper()
  6898  	forSlice(t, uint64s, n, func(x []uint64) bool {
  6899  		t.Helper()
  6900  		a := archsimd.LoadUint64x4(x)
  6901  		g := make([]uint16, 8)
  6902  		f(a).Store(g)
  6903  		w := want(x)
  6904  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6905  	})
  6906  }
  6907  
  6908  // testFloat32x8ConvertLoToUint16x8 tests the simd conversion method f against the expected behavior generated by want.
  6909  // This converts only the low 8 elements.
  6910  func testFloat32x8ConvertLoToUint16x8(t *testing.T, f func(x archsimd.Float32x8) archsimd.Uint16x8, want func(x []float32) []uint16) {
  6911  	n := 8
  6912  	t.Helper()
  6913  	forSlice(t, float32s, n, func(x []float32) bool {
  6914  		t.Helper()
  6915  		a := archsimd.LoadFloat32x8(x)
  6916  		g := make([]uint16, 8)
  6917  		f(a).Store(g)
  6918  		w := want(x)
  6919  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6920  	})
  6921  }
  6922  
  6923  // testFloat64x4ConvertLoToUint16x8 tests the simd conversion method f against the expected behavior generated by want.
  6924  // This converts only the low 8 elements.
  6925  func testFloat64x4ConvertLoToUint16x8(t *testing.T, f func(x archsimd.Float64x4) archsimd.Uint16x8, want func(x []float64) []uint16) {
  6926  	n := 4
  6927  	t.Helper()
  6928  	forSlice(t, float64s, n, func(x []float64) bool {
  6929  		t.Helper()
  6930  		a := archsimd.LoadFloat64x4(x)
  6931  		g := make([]uint16, 8)
  6932  		f(a).Store(g)
  6933  		w := want(x)
  6934  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6935  	})
  6936  }
  6937  
  6938  // testInt8x64ConvertLoToUint16x8 tests the simd conversion method f against the expected behavior generated by want.
  6939  // This converts only the low 8 elements.
  6940  func testInt8x64ConvertLoToUint16x8(t *testing.T, f func(x archsimd.Int8x64) archsimd.Uint16x8, want func(x []int8) []uint16) {
  6941  	n := 64
  6942  	t.Helper()
  6943  	forSlice(t, int8s, n, func(x []int8) bool {
  6944  		t.Helper()
  6945  		a := archsimd.LoadInt8x64(x)
  6946  		g := make([]uint16, 8)
  6947  		f(a).Store(g)
  6948  		w := want(x)
  6949  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6950  	})
  6951  }
  6952  
  6953  // testInt16x32ConvertLoToUint16x8 tests the simd conversion method f against the expected behavior generated by want.
  6954  // This converts only the low 8 elements.
  6955  func testInt16x32ConvertLoToUint16x8(t *testing.T, f func(x archsimd.Int16x32) archsimd.Uint16x8, want func(x []int16) []uint16) {
  6956  	n := 32
  6957  	t.Helper()
  6958  	forSlice(t, int16s, n, func(x []int16) bool {
  6959  		t.Helper()
  6960  		a := archsimd.LoadInt16x32(x)
  6961  		g := make([]uint16, 8)
  6962  		f(a).Store(g)
  6963  		w := want(x)
  6964  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6965  	})
  6966  }
  6967  
  6968  // testInt32x16ConvertLoToUint16x8 tests the simd conversion method f against the expected behavior generated by want.
  6969  // This converts only the low 8 elements.
  6970  func testInt32x16ConvertLoToUint16x8(t *testing.T, f func(x archsimd.Int32x16) archsimd.Uint16x8, want func(x []int32) []uint16) {
  6971  	n := 16
  6972  	t.Helper()
  6973  	forSlice(t, int32s, n, func(x []int32) bool {
  6974  		t.Helper()
  6975  		a := archsimd.LoadInt32x16(x)
  6976  		g := make([]uint16, 8)
  6977  		f(a).Store(g)
  6978  		w := want(x)
  6979  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6980  	})
  6981  }
  6982  
  6983  // testInt64x8ConvertLoToUint16x8 tests the simd conversion method f against the expected behavior generated by want.
  6984  // This converts only the low 8 elements.
  6985  func testInt64x8ConvertLoToUint16x8(t *testing.T, f func(x archsimd.Int64x8) archsimd.Uint16x8, want func(x []int64) []uint16) {
  6986  	n := 8
  6987  	t.Helper()
  6988  	forSlice(t, int64s, n, func(x []int64) bool {
  6989  		t.Helper()
  6990  		a := archsimd.LoadInt64x8(x)
  6991  		g := make([]uint16, 8)
  6992  		f(a).Store(g)
  6993  		w := want(x)
  6994  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  6995  	})
  6996  }
  6997  
  6998  // testUint8x64ConvertLoToUint16x8 tests the simd conversion method f against the expected behavior generated by want.
  6999  // This converts only the low 8 elements.
  7000  func testUint8x64ConvertLoToUint16x8(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Uint16x8, want func(x []uint8) []uint16) {
  7001  	n := 64
  7002  	t.Helper()
  7003  	forSlice(t, uint8s, n, func(x []uint8) bool {
  7004  		t.Helper()
  7005  		a := archsimd.LoadUint8x64(x)
  7006  		g := make([]uint16, 8)
  7007  		f(a).Store(g)
  7008  		w := want(x)
  7009  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7010  	})
  7011  }
  7012  
  7013  // testUint16x32ConvertLoToUint16x8 tests the simd conversion method f against the expected behavior generated by want.
  7014  // This converts only the low 8 elements.
  7015  func testUint16x32ConvertLoToUint16x8(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Uint16x8, want func(x []uint16) []uint16) {
  7016  	n := 32
  7017  	t.Helper()
  7018  	forSlice(t, uint16s, n, func(x []uint16) bool {
  7019  		t.Helper()
  7020  		a := archsimd.LoadUint16x32(x)
  7021  		g := make([]uint16, 8)
  7022  		f(a).Store(g)
  7023  		w := want(x)
  7024  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7025  	})
  7026  }
  7027  
  7028  // testUint32x16ConvertLoToUint16x8 tests the simd conversion method f against the expected behavior generated by want.
  7029  // This converts only the low 8 elements.
  7030  func testUint32x16ConvertLoToUint16x8(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Uint16x8, want func(x []uint32) []uint16) {
  7031  	n := 16
  7032  	t.Helper()
  7033  	forSlice(t, uint32s, n, func(x []uint32) bool {
  7034  		t.Helper()
  7035  		a := archsimd.LoadUint32x16(x)
  7036  		g := make([]uint16, 8)
  7037  		f(a).Store(g)
  7038  		w := want(x)
  7039  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7040  	})
  7041  }
  7042  
  7043  // testUint64x8ConvertLoToUint16x8 tests the simd conversion method f against the expected behavior generated by want.
  7044  // This converts only the low 8 elements.
  7045  func testUint64x8ConvertLoToUint16x8(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Uint16x8, want func(x []uint64) []uint16) {
  7046  	n := 8
  7047  	t.Helper()
  7048  	forSlice(t, uint64s, n, func(x []uint64) bool {
  7049  		t.Helper()
  7050  		a := archsimd.LoadUint64x8(x)
  7051  		g := make([]uint16, 8)
  7052  		f(a).Store(g)
  7053  		w := want(x)
  7054  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7055  	})
  7056  }
  7057  
  7058  // testFloat32x16ConvertLoToUint16x8 tests the simd conversion method f against the expected behavior generated by want.
  7059  // This converts only the low 8 elements.
  7060  func testFloat32x16ConvertLoToUint16x8(t *testing.T, f func(x archsimd.Float32x16) archsimd.Uint16x8, want func(x []float32) []uint16) {
  7061  	n := 16
  7062  	t.Helper()
  7063  	forSlice(t, float32s, n, func(x []float32) bool {
  7064  		t.Helper()
  7065  		a := archsimd.LoadFloat32x16(x)
  7066  		g := make([]uint16, 8)
  7067  		f(a).Store(g)
  7068  		w := want(x)
  7069  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7070  	})
  7071  }
  7072  
  7073  // testFloat64x8ConvertLoToUint16x8 tests the simd conversion method f against the expected behavior generated by want.
  7074  // This converts only the low 8 elements.
  7075  func testFloat64x8ConvertLoToUint16x8(t *testing.T, f func(x archsimd.Float64x8) archsimd.Uint16x8, want func(x []float64) []uint16) {
  7076  	n := 8
  7077  	t.Helper()
  7078  	forSlice(t, float64s, n, func(x []float64) bool {
  7079  		t.Helper()
  7080  		a := archsimd.LoadFloat64x8(x)
  7081  		g := make([]uint16, 8)
  7082  		f(a).Store(g)
  7083  		w := want(x)
  7084  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7085  	})
  7086  }
  7087  
  7088  // testInt8x32ConvertLoToFloat64x2 tests the simd conversion method f against the expected behavior generated by want.
  7089  // This converts only the low 2 elements.
  7090  func testInt8x32ConvertLoToFloat64x2(t *testing.T, f func(x archsimd.Int8x32) archsimd.Float64x2, want func(x []int8) []float64) {
  7091  	n := 32
  7092  	t.Helper()
  7093  	forSlice(t, int8s, n, func(x []int8) bool {
  7094  		t.Helper()
  7095  		a := archsimd.LoadInt8x32(x)
  7096  		g := make([]float64, 2)
  7097  		f(a).Store(g)
  7098  		w := want(x)
  7099  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7100  	})
  7101  }
  7102  
  7103  // testInt16x16ConvertLoToFloat64x2 tests the simd conversion method f against the expected behavior generated by want.
  7104  // This converts only the low 2 elements.
  7105  func testInt16x16ConvertLoToFloat64x2(t *testing.T, f func(x archsimd.Int16x16) archsimd.Float64x2, want func(x []int16) []float64) {
  7106  	n := 16
  7107  	t.Helper()
  7108  	forSlice(t, int16s, n, func(x []int16) bool {
  7109  		t.Helper()
  7110  		a := archsimd.LoadInt16x16(x)
  7111  		g := make([]float64, 2)
  7112  		f(a).Store(g)
  7113  		w := want(x)
  7114  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7115  	})
  7116  }
  7117  
  7118  // testInt32x8ConvertLoToFloat64x2 tests the simd conversion method f against the expected behavior generated by want.
  7119  // This converts only the low 2 elements.
  7120  func testInt32x8ConvertLoToFloat64x2(t *testing.T, f func(x archsimd.Int32x8) archsimd.Float64x2, want func(x []int32) []float64) {
  7121  	n := 8
  7122  	t.Helper()
  7123  	forSlice(t, int32s, n, func(x []int32) bool {
  7124  		t.Helper()
  7125  		a := archsimd.LoadInt32x8(x)
  7126  		g := make([]float64, 2)
  7127  		f(a).Store(g)
  7128  		w := want(x)
  7129  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7130  	})
  7131  }
  7132  
  7133  // testInt64x4ConvertLoToFloat64x2 tests the simd conversion method f against the expected behavior generated by want.
  7134  // This converts only the low 2 elements.
  7135  func testInt64x4ConvertLoToFloat64x2(t *testing.T, f func(x archsimd.Int64x4) archsimd.Float64x2, want func(x []int64) []float64) {
  7136  	n := 4
  7137  	t.Helper()
  7138  	forSlice(t, int64s, n, func(x []int64) bool {
  7139  		t.Helper()
  7140  		a := archsimd.LoadInt64x4(x)
  7141  		g := make([]float64, 2)
  7142  		f(a).Store(g)
  7143  		w := want(x)
  7144  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7145  	})
  7146  }
  7147  
  7148  // testUint8x32ConvertLoToFloat64x2 tests the simd conversion method f against the expected behavior generated by want.
  7149  // This converts only the low 2 elements.
  7150  func testUint8x32ConvertLoToFloat64x2(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Float64x2, want func(x []uint8) []float64) {
  7151  	n := 32
  7152  	t.Helper()
  7153  	forSlice(t, uint8s, n, func(x []uint8) bool {
  7154  		t.Helper()
  7155  		a := archsimd.LoadUint8x32(x)
  7156  		g := make([]float64, 2)
  7157  		f(a).Store(g)
  7158  		w := want(x)
  7159  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7160  	})
  7161  }
  7162  
  7163  // testUint16x16ConvertLoToFloat64x2 tests the simd conversion method f against the expected behavior generated by want.
  7164  // This converts only the low 2 elements.
  7165  func testUint16x16ConvertLoToFloat64x2(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Float64x2, want func(x []uint16) []float64) {
  7166  	n := 16
  7167  	t.Helper()
  7168  	forSlice(t, uint16s, n, func(x []uint16) bool {
  7169  		t.Helper()
  7170  		a := archsimd.LoadUint16x16(x)
  7171  		g := make([]float64, 2)
  7172  		f(a).Store(g)
  7173  		w := want(x)
  7174  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7175  	})
  7176  }
  7177  
  7178  // testUint32x8ConvertLoToFloat64x2 tests the simd conversion method f against the expected behavior generated by want.
  7179  // This converts only the low 2 elements.
  7180  func testUint32x8ConvertLoToFloat64x2(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Float64x2, want func(x []uint32) []float64) {
  7181  	n := 8
  7182  	t.Helper()
  7183  	forSlice(t, uint32s, n, func(x []uint32) bool {
  7184  		t.Helper()
  7185  		a := archsimd.LoadUint32x8(x)
  7186  		g := make([]float64, 2)
  7187  		f(a).Store(g)
  7188  		w := want(x)
  7189  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7190  	})
  7191  }
  7192  
  7193  // testUint64x4ConvertLoToFloat64x2 tests the simd conversion method f against the expected behavior generated by want.
  7194  // This converts only the low 2 elements.
  7195  func testUint64x4ConvertLoToFloat64x2(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Float64x2, want func(x []uint64) []float64) {
  7196  	n := 4
  7197  	t.Helper()
  7198  	forSlice(t, uint64s, n, func(x []uint64) bool {
  7199  		t.Helper()
  7200  		a := archsimd.LoadUint64x4(x)
  7201  		g := make([]float64, 2)
  7202  		f(a).Store(g)
  7203  		w := want(x)
  7204  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7205  	})
  7206  }
  7207  
  7208  // testFloat32x8ConvertLoToFloat64x2 tests the simd conversion method f against the expected behavior generated by want.
  7209  // This converts only the low 2 elements.
  7210  func testFloat32x8ConvertLoToFloat64x2(t *testing.T, f func(x archsimd.Float32x8) archsimd.Float64x2, want func(x []float32) []float64) {
  7211  	n := 8
  7212  	t.Helper()
  7213  	forSlice(t, float32s, n, func(x []float32) bool {
  7214  		t.Helper()
  7215  		a := archsimd.LoadFloat32x8(x)
  7216  		g := make([]float64, 2)
  7217  		f(a).Store(g)
  7218  		w := want(x)
  7219  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7220  	})
  7221  }
  7222  
  7223  // testFloat64x4ConvertLoToFloat64x2 tests the simd conversion method f against the expected behavior generated by want.
  7224  // This converts only the low 2 elements.
  7225  func testFloat64x4ConvertLoToFloat64x2(t *testing.T, f func(x archsimd.Float64x4) archsimd.Float64x2, want func(x []float64) []float64) {
  7226  	n := 4
  7227  	t.Helper()
  7228  	forSlice(t, float64s, n, func(x []float64) bool {
  7229  		t.Helper()
  7230  		a := archsimd.LoadFloat64x4(x)
  7231  		g := make([]float64, 2)
  7232  		f(a).Store(g)
  7233  		w := want(x)
  7234  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7235  	})
  7236  }
  7237  
  7238  // testInt8x64ConvertLoToFloat64x2 tests the simd conversion method f against the expected behavior generated by want.
  7239  // This converts only the low 2 elements.
  7240  func testInt8x64ConvertLoToFloat64x2(t *testing.T, f func(x archsimd.Int8x64) archsimd.Float64x2, want func(x []int8) []float64) {
  7241  	n := 64
  7242  	t.Helper()
  7243  	forSlice(t, int8s, n, func(x []int8) bool {
  7244  		t.Helper()
  7245  		a := archsimd.LoadInt8x64(x)
  7246  		g := make([]float64, 2)
  7247  		f(a).Store(g)
  7248  		w := want(x)
  7249  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7250  	})
  7251  }
  7252  
  7253  // testInt16x32ConvertLoToFloat64x2 tests the simd conversion method f against the expected behavior generated by want.
  7254  // This converts only the low 2 elements.
  7255  func testInt16x32ConvertLoToFloat64x2(t *testing.T, f func(x archsimd.Int16x32) archsimd.Float64x2, want func(x []int16) []float64) {
  7256  	n := 32
  7257  	t.Helper()
  7258  	forSlice(t, int16s, n, func(x []int16) bool {
  7259  		t.Helper()
  7260  		a := archsimd.LoadInt16x32(x)
  7261  		g := make([]float64, 2)
  7262  		f(a).Store(g)
  7263  		w := want(x)
  7264  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7265  	})
  7266  }
  7267  
  7268  // testInt32x16ConvertLoToFloat64x2 tests the simd conversion method f against the expected behavior generated by want.
  7269  // This converts only the low 2 elements.
  7270  func testInt32x16ConvertLoToFloat64x2(t *testing.T, f func(x archsimd.Int32x16) archsimd.Float64x2, want func(x []int32) []float64) {
  7271  	n := 16
  7272  	t.Helper()
  7273  	forSlice(t, int32s, n, func(x []int32) bool {
  7274  		t.Helper()
  7275  		a := archsimd.LoadInt32x16(x)
  7276  		g := make([]float64, 2)
  7277  		f(a).Store(g)
  7278  		w := want(x)
  7279  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7280  	})
  7281  }
  7282  
  7283  // testInt64x8ConvertLoToFloat64x2 tests the simd conversion method f against the expected behavior generated by want.
  7284  // This converts only the low 2 elements.
  7285  func testInt64x8ConvertLoToFloat64x2(t *testing.T, f func(x archsimd.Int64x8) archsimd.Float64x2, want func(x []int64) []float64) {
  7286  	n := 8
  7287  	t.Helper()
  7288  	forSlice(t, int64s, n, func(x []int64) bool {
  7289  		t.Helper()
  7290  		a := archsimd.LoadInt64x8(x)
  7291  		g := make([]float64, 2)
  7292  		f(a).Store(g)
  7293  		w := want(x)
  7294  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7295  	})
  7296  }
  7297  
  7298  // testUint8x64ConvertLoToFloat64x2 tests the simd conversion method f against the expected behavior generated by want.
  7299  // This converts only the low 2 elements.
  7300  func testUint8x64ConvertLoToFloat64x2(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Float64x2, want func(x []uint8) []float64) {
  7301  	n := 64
  7302  	t.Helper()
  7303  	forSlice(t, uint8s, n, func(x []uint8) bool {
  7304  		t.Helper()
  7305  		a := archsimd.LoadUint8x64(x)
  7306  		g := make([]float64, 2)
  7307  		f(a).Store(g)
  7308  		w := want(x)
  7309  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7310  	})
  7311  }
  7312  
  7313  // testUint16x32ConvertLoToFloat64x2 tests the simd conversion method f against the expected behavior generated by want.
  7314  // This converts only the low 2 elements.
  7315  func testUint16x32ConvertLoToFloat64x2(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Float64x2, want func(x []uint16) []float64) {
  7316  	n := 32
  7317  	t.Helper()
  7318  	forSlice(t, uint16s, n, func(x []uint16) bool {
  7319  		t.Helper()
  7320  		a := archsimd.LoadUint16x32(x)
  7321  		g := make([]float64, 2)
  7322  		f(a).Store(g)
  7323  		w := want(x)
  7324  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7325  	})
  7326  }
  7327  
  7328  // testUint32x16ConvertLoToFloat64x2 tests the simd conversion method f against the expected behavior generated by want.
  7329  // This converts only the low 2 elements.
  7330  func testUint32x16ConvertLoToFloat64x2(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Float64x2, want func(x []uint32) []float64) {
  7331  	n := 16
  7332  	t.Helper()
  7333  	forSlice(t, uint32s, n, func(x []uint32) bool {
  7334  		t.Helper()
  7335  		a := archsimd.LoadUint32x16(x)
  7336  		g := make([]float64, 2)
  7337  		f(a).Store(g)
  7338  		w := want(x)
  7339  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7340  	})
  7341  }
  7342  
  7343  // testUint64x8ConvertLoToFloat64x2 tests the simd conversion method f against the expected behavior generated by want.
  7344  // This converts only the low 2 elements.
  7345  func testUint64x8ConvertLoToFloat64x2(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Float64x2, want func(x []uint64) []float64) {
  7346  	n := 8
  7347  	t.Helper()
  7348  	forSlice(t, uint64s, n, func(x []uint64) bool {
  7349  		t.Helper()
  7350  		a := archsimd.LoadUint64x8(x)
  7351  		g := make([]float64, 2)
  7352  		f(a).Store(g)
  7353  		w := want(x)
  7354  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7355  	})
  7356  }
  7357  
  7358  // testFloat32x16ConvertLoToFloat64x2 tests the simd conversion method f against the expected behavior generated by want.
  7359  // This converts only the low 2 elements.
  7360  func testFloat32x16ConvertLoToFloat64x2(t *testing.T, f func(x archsimd.Float32x16) archsimd.Float64x2, want func(x []float32) []float64) {
  7361  	n := 16
  7362  	t.Helper()
  7363  	forSlice(t, float32s, n, func(x []float32) bool {
  7364  		t.Helper()
  7365  		a := archsimd.LoadFloat32x16(x)
  7366  		g := make([]float64, 2)
  7367  		f(a).Store(g)
  7368  		w := want(x)
  7369  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7370  	})
  7371  }
  7372  
  7373  // testFloat64x8ConvertLoToFloat64x2 tests the simd conversion method f against the expected behavior generated by want.
  7374  // This converts only the low 2 elements.
  7375  func testFloat64x8ConvertLoToFloat64x2(t *testing.T, f func(x archsimd.Float64x8) archsimd.Float64x2, want func(x []float64) []float64) {
  7376  	n := 8
  7377  	t.Helper()
  7378  	forSlice(t, float64s, n, func(x []float64) bool {
  7379  		t.Helper()
  7380  		a := archsimd.LoadFloat64x8(x)
  7381  		g := make([]float64, 2)
  7382  		f(a).Store(g)
  7383  		w := want(x)
  7384  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7385  	})
  7386  }
  7387  
  7388  // testInt8x16ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7389  // This converts only the low 4 elements.
  7390  func testInt8x16ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Int8x16) archsimd.Float64x4, want func(x []int8) []float64) {
  7391  	n := 16
  7392  	t.Helper()
  7393  	forSlice(t, int8s, n, func(x []int8) bool {
  7394  		t.Helper()
  7395  		a := archsimd.LoadInt8x16(x)
  7396  		g := make([]float64, 4)
  7397  		f(a).Store(g)
  7398  		w := want(x)
  7399  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7400  	})
  7401  }
  7402  
  7403  // testInt16x8ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7404  // This converts only the low 4 elements.
  7405  func testInt16x8ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Int16x8) archsimd.Float64x4, want func(x []int16) []float64) {
  7406  	n := 8
  7407  	t.Helper()
  7408  	forSlice(t, int16s, n, func(x []int16) bool {
  7409  		t.Helper()
  7410  		a := archsimd.LoadInt16x8(x)
  7411  		g := make([]float64, 4)
  7412  		f(a).Store(g)
  7413  		w := want(x)
  7414  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7415  	})
  7416  }
  7417  
  7418  // testInt32x4ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7419  // This converts only the low 4 elements.
  7420  func testInt32x4ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Int32x4) archsimd.Float64x4, want func(x []int32) []float64) {
  7421  	n := 4
  7422  	t.Helper()
  7423  	forSlice(t, int32s, n, func(x []int32) bool {
  7424  		t.Helper()
  7425  		a := archsimd.LoadInt32x4(x)
  7426  		g := make([]float64, 4)
  7427  		f(a).Store(g)
  7428  		w := want(x)
  7429  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7430  	})
  7431  }
  7432  
  7433  // testInt64x2ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7434  // This converts only the low 4 elements.
  7435  func testInt64x2ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Int64x2) archsimd.Float64x4, want func(x []int64) []float64) {
  7436  	n := 2
  7437  	t.Helper()
  7438  	forSlice(t, int64s, n, func(x []int64) bool {
  7439  		t.Helper()
  7440  		a := archsimd.LoadInt64x2(x)
  7441  		g := make([]float64, 4)
  7442  		f(a).Store(g)
  7443  		w := want(x)
  7444  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7445  	})
  7446  }
  7447  
  7448  // testUint8x16ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7449  // This converts only the low 4 elements.
  7450  func testUint8x16ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Float64x4, want func(x []uint8) []float64) {
  7451  	n := 16
  7452  	t.Helper()
  7453  	forSlice(t, uint8s, n, func(x []uint8) bool {
  7454  		t.Helper()
  7455  		a := archsimd.LoadUint8x16(x)
  7456  		g := make([]float64, 4)
  7457  		f(a).Store(g)
  7458  		w := want(x)
  7459  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7460  	})
  7461  }
  7462  
  7463  // testUint16x8ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7464  // This converts only the low 4 elements.
  7465  func testUint16x8ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Float64x4, want func(x []uint16) []float64) {
  7466  	n := 8
  7467  	t.Helper()
  7468  	forSlice(t, uint16s, n, func(x []uint16) bool {
  7469  		t.Helper()
  7470  		a := archsimd.LoadUint16x8(x)
  7471  		g := make([]float64, 4)
  7472  		f(a).Store(g)
  7473  		w := want(x)
  7474  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7475  	})
  7476  }
  7477  
  7478  // testUint32x4ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7479  // This converts only the low 4 elements.
  7480  func testUint32x4ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Float64x4, want func(x []uint32) []float64) {
  7481  	n := 4
  7482  	t.Helper()
  7483  	forSlice(t, uint32s, n, func(x []uint32) bool {
  7484  		t.Helper()
  7485  		a := archsimd.LoadUint32x4(x)
  7486  		g := make([]float64, 4)
  7487  		f(a).Store(g)
  7488  		w := want(x)
  7489  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7490  	})
  7491  }
  7492  
  7493  // testUint64x2ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7494  // This converts only the low 4 elements.
  7495  func testUint64x2ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Float64x4, want func(x []uint64) []float64) {
  7496  	n := 2
  7497  	t.Helper()
  7498  	forSlice(t, uint64s, n, func(x []uint64) bool {
  7499  		t.Helper()
  7500  		a := archsimd.LoadUint64x2(x)
  7501  		g := make([]float64, 4)
  7502  		f(a).Store(g)
  7503  		w := want(x)
  7504  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7505  	})
  7506  }
  7507  
  7508  // testFloat32x4ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7509  // This converts only the low 4 elements.
  7510  func testFloat32x4ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Float32x4) archsimd.Float64x4, want func(x []float32) []float64) {
  7511  	n := 4
  7512  	t.Helper()
  7513  	forSlice(t, float32s, n, func(x []float32) bool {
  7514  		t.Helper()
  7515  		a := archsimd.LoadFloat32x4(x)
  7516  		g := make([]float64, 4)
  7517  		f(a).Store(g)
  7518  		w := want(x)
  7519  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7520  	})
  7521  }
  7522  
  7523  // testFloat64x2ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7524  // This converts only the low 4 elements.
  7525  func testFloat64x2ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Float64x2) archsimd.Float64x4, want func(x []float64) []float64) {
  7526  	n := 2
  7527  	t.Helper()
  7528  	forSlice(t, float64s, n, func(x []float64) bool {
  7529  		t.Helper()
  7530  		a := archsimd.LoadFloat64x2(x)
  7531  		g := make([]float64, 4)
  7532  		f(a).Store(g)
  7533  		w := want(x)
  7534  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7535  	})
  7536  }
  7537  
  7538  // testInt8x32ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7539  // This converts only the low 4 elements.
  7540  func testInt8x32ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Int8x32) archsimd.Float64x4, want func(x []int8) []float64) {
  7541  	n := 32
  7542  	t.Helper()
  7543  	forSlice(t, int8s, n, func(x []int8) bool {
  7544  		t.Helper()
  7545  		a := archsimd.LoadInt8x32(x)
  7546  		g := make([]float64, 4)
  7547  		f(a).Store(g)
  7548  		w := want(x)
  7549  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7550  	})
  7551  }
  7552  
  7553  // testInt16x16ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7554  // This converts only the low 4 elements.
  7555  func testInt16x16ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Int16x16) archsimd.Float64x4, want func(x []int16) []float64) {
  7556  	n := 16
  7557  	t.Helper()
  7558  	forSlice(t, int16s, n, func(x []int16) bool {
  7559  		t.Helper()
  7560  		a := archsimd.LoadInt16x16(x)
  7561  		g := make([]float64, 4)
  7562  		f(a).Store(g)
  7563  		w := want(x)
  7564  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7565  	})
  7566  }
  7567  
  7568  // testInt32x8ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7569  // This converts only the low 4 elements.
  7570  func testInt32x8ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Int32x8) archsimd.Float64x4, want func(x []int32) []float64) {
  7571  	n := 8
  7572  	t.Helper()
  7573  	forSlice(t, int32s, n, func(x []int32) bool {
  7574  		t.Helper()
  7575  		a := archsimd.LoadInt32x8(x)
  7576  		g := make([]float64, 4)
  7577  		f(a).Store(g)
  7578  		w := want(x)
  7579  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7580  	})
  7581  }
  7582  
  7583  // testInt64x4ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7584  // This converts only the low 4 elements.
  7585  func testInt64x4ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Int64x4) archsimd.Float64x4, want func(x []int64) []float64) {
  7586  	n := 4
  7587  	t.Helper()
  7588  	forSlice(t, int64s, n, func(x []int64) bool {
  7589  		t.Helper()
  7590  		a := archsimd.LoadInt64x4(x)
  7591  		g := make([]float64, 4)
  7592  		f(a).Store(g)
  7593  		w := want(x)
  7594  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7595  	})
  7596  }
  7597  
  7598  // testUint8x32ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7599  // This converts only the low 4 elements.
  7600  func testUint8x32ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Uint8x32) archsimd.Float64x4, want func(x []uint8) []float64) {
  7601  	n := 32
  7602  	t.Helper()
  7603  	forSlice(t, uint8s, n, func(x []uint8) bool {
  7604  		t.Helper()
  7605  		a := archsimd.LoadUint8x32(x)
  7606  		g := make([]float64, 4)
  7607  		f(a).Store(g)
  7608  		w := want(x)
  7609  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7610  	})
  7611  }
  7612  
  7613  // testUint16x16ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7614  // This converts only the low 4 elements.
  7615  func testUint16x16ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Uint16x16) archsimd.Float64x4, want func(x []uint16) []float64) {
  7616  	n := 16
  7617  	t.Helper()
  7618  	forSlice(t, uint16s, n, func(x []uint16) bool {
  7619  		t.Helper()
  7620  		a := archsimd.LoadUint16x16(x)
  7621  		g := make([]float64, 4)
  7622  		f(a).Store(g)
  7623  		w := want(x)
  7624  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7625  	})
  7626  }
  7627  
  7628  // testUint32x8ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7629  // This converts only the low 4 elements.
  7630  func testUint32x8ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Uint32x8) archsimd.Float64x4, want func(x []uint32) []float64) {
  7631  	n := 8
  7632  	t.Helper()
  7633  	forSlice(t, uint32s, n, func(x []uint32) bool {
  7634  		t.Helper()
  7635  		a := archsimd.LoadUint32x8(x)
  7636  		g := make([]float64, 4)
  7637  		f(a).Store(g)
  7638  		w := want(x)
  7639  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7640  	})
  7641  }
  7642  
  7643  // testUint64x4ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7644  // This converts only the low 4 elements.
  7645  func testUint64x4ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Uint64x4) archsimd.Float64x4, want func(x []uint64) []float64) {
  7646  	n := 4
  7647  	t.Helper()
  7648  	forSlice(t, uint64s, n, func(x []uint64) bool {
  7649  		t.Helper()
  7650  		a := archsimd.LoadUint64x4(x)
  7651  		g := make([]float64, 4)
  7652  		f(a).Store(g)
  7653  		w := want(x)
  7654  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7655  	})
  7656  }
  7657  
  7658  // testFloat32x8ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7659  // This converts only the low 4 elements.
  7660  func testFloat32x8ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Float32x8) archsimd.Float64x4, want func(x []float32) []float64) {
  7661  	n := 8
  7662  	t.Helper()
  7663  	forSlice(t, float32s, n, func(x []float32) bool {
  7664  		t.Helper()
  7665  		a := archsimd.LoadFloat32x8(x)
  7666  		g := make([]float64, 4)
  7667  		f(a).Store(g)
  7668  		w := want(x)
  7669  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7670  	})
  7671  }
  7672  
  7673  // testFloat64x4ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7674  // This converts only the low 4 elements.
  7675  func testFloat64x4ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Float64x4) archsimd.Float64x4, want func(x []float64) []float64) {
  7676  	n := 4
  7677  	t.Helper()
  7678  	forSlice(t, float64s, n, func(x []float64) bool {
  7679  		t.Helper()
  7680  		a := archsimd.LoadFloat64x4(x)
  7681  		g := make([]float64, 4)
  7682  		f(a).Store(g)
  7683  		w := want(x)
  7684  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7685  	})
  7686  }
  7687  
  7688  // testInt8x64ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7689  // This converts only the low 4 elements.
  7690  func testInt8x64ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Int8x64) archsimd.Float64x4, want func(x []int8) []float64) {
  7691  	n := 64
  7692  	t.Helper()
  7693  	forSlice(t, int8s, n, func(x []int8) bool {
  7694  		t.Helper()
  7695  		a := archsimd.LoadInt8x64(x)
  7696  		g := make([]float64, 4)
  7697  		f(a).Store(g)
  7698  		w := want(x)
  7699  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7700  	})
  7701  }
  7702  
  7703  // testInt16x32ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7704  // This converts only the low 4 elements.
  7705  func testInt16x32ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Int16x32) archsimd.Float64x4, want func(x []int16) []float64) {
  7706  	n := 32
  7707  	t.Helper()
  7708  	forSlice(t, int16s, n, func(x []int16) bool {
  7709  		t.Helper()
  7710  		a := archsimd.LoadInt16x32(x)
  7711  		g := make([]float64, 4)
  7712  		f(a).Store(g)
  7713  		w := want(x)
  7714  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7715  	})
  7716  }
  7717  
  7718  // testInt32x16ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7719  // This converts only the low 4 elements.
  7720  func testInt32x16ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Int32x16) archsimd.Float64x4, want func(x []int32) []float64) {
  7721  	n := 16
  7722  	t.Helper()
  7723  	forSlice(t, int32s, n, func(x []int32) bool {
  7724  		t.Helper()
  7725  		a := archsimd.LoadInt32x16(x)
  7726  		g := make([]float64, 4)
  7727  		f(a).Store(g)
  7728  		w := want(x)
  7729  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7730  	})
  7731  }
  7732  
  7733  // testInt64x8ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7734  // This converts only the low 4 elements.
  7735  func testInt64x8ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Int64x8) archsimd.Float64x4, want func(x []int64) []float64) {
  7736  	n := 8
  7737  	t.Helper()
  7738  	forSlice(t, int64s, n, func(x []int64) bool {
  7739  		t.Helper()
  7740  		a := archsimd.LoadInt64x8(x)
  7741  		g := make([]float64, 4)
  7742  		f(a).Store(g)
  7743  		w := want(x)
  7744  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7745  	})
  7746  }
  7747  
  7748  // testUint8x64ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7749  // This converts only the low 4 elements.
  7750  func testUint8x64ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Uint8x64) archsimd.Float64x4, want func(x []uint8) []float64) {
  7751  	n := 64
  7752  	t.Helper()
  7753  	forSlice(t, uint8s, n, func(x []uint8) bool {
  7754  		t.Helper()
  7755  		a := archsimd.LoadUint8x64(x)
  7756  		g := make([]float64, 4)
  7757  		f(a).Store(g)
  7758  		w := want(x)
  7759  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7760  	})
  7761  }
  7762  
  7763  // testUint16x32ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7764  // This converts only the low 4 elements.
  7765  func testUint16x32ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Uint16x32) archsimd.Float64x4, want func(x []uint16) []float64) {
  7766  	n := 32
  7767  	t.Helper()
  7768  	forSlice(t, uint16s, n, func(x []uint16) bool {
  7769  		t.Helper()
  7770  		a := archsimd.LoadUint16x32(x)
  7771  		g := make([]float64, 4)
  7772  		f(a).Store(g)
  7773  		w := want(x)
  7774  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7775  	})
  7776  }
  7777  
  7778  // testUint32x16ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7779  // This converts only the low 4 elements.
  7780  func testUint32x16ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Uint32x16) archsimd.Float64x4, want func(x []uint32) []float64) {
  7781  	n := 16
  7782  	t.Helper()
  7783  	forSlice(t, uint32s, n, func(x []uint32) bool {
  7784  		t.Helper()
  7785  		a := archsimd.LoadUint32x16(x)
  7786  		g := make([]float64, 4)
  7787  		f(a).Store(g)
  7788  		w := want(x)
  7789  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7790  	})
  7791  }
  7792  
  7793  // testUint64x8ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7794  // This converts only the low 4 elements.
  7795  func testUint64x8ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Uint64x8) archsimd.Float64x4, want func(x []uint64) []float64) {
  7796  	n := 8
  7797  	t.Helper()
  7798  	forSlice(t, uint64s, n, func(x []uint64) bool {
  7799  		t.Helper()
  7800  		a := archsimd.LoadUint64x8(x)
  7801  		g := make([]float64, 4)
  7802  		f(a).Store(g)
  7803  		w := want(x)
  7804  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7805  	})
  7806  }
  7807  
  7808  // testFloat32x16ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7809  // This converts only the low 4 elements.
  7810  func testFloat32x16ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Float32x16) archsimd.Float64x4, want func(x []float32) []float64) {
  7811  	n := 16
  7812  	t.Helper()
  7813  	forSlice(t, float32s, n, func(x []float32) bool {
  7814  		t.Helper()
  7815  		a := archsimd.LoadFloat32x16(x)
  7816  		g := make([]float64, 4)
  7817  		f(a).Store(g)
  7818  		w := want(x)
  7819  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7820  	})
  7821  }
  7822  
  7823  // testFloat64x8ConvertLoToFloat64x4 tests the simd conversion method f against the expected behavior generated by want.
  7824  // This converts only the low 4 elements.
  7825  func testFloat64x8ConvertLoToFloat64x4(t *testing.T, f func(x archsimd.Float64x8) archsimd.Float64x4, want func(x []float64) []float64) {
  7826  	n := 8
  7827  	t.Helper()
  7828  	forSlice(t, float64s, n, func(x []float64) bool {
  7829  		t.Helper()
  7830  		a := archsimd.LoadFloat64x8(x)
  7831  		g := make([]float64, 4)
  7832  		f(a).Store(g)
  7833  		w := want(x)
  7834  		return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
  7835  	})
  7836  }
  7837  
  7838  // testFloat32x8UnaryFlaky tests the simd unary method f against the expected behavior generated by want,
  7839  // but using a flakiness parameter because we haven't exactly figured out how simd floating point works
  7840  func testFloat32x8UnaryFlaky(t *testing.T, f func(x archsimd.Float32x8) archsimd.Float32x8, want func(x []float32) []float32, flakiness float64) {
  7841  	n := 8
  7842  	t.Helper()
  7843  	forSlice(t, float32s, n, func(x []float32) bool {
  7844  		t.Helper()
  7845  		a := archsimd.LoadFloat32x8(x)
  7846  		g := make([]float32, n)
  7847  		f(a).Store(g)
  7848  		w := want(x)
  7849  		return checkSlicesLogInput(t, g, w, flakiness, func() { t.Helper(); t.Logf("x=%v", x) })
  7850  	})
  7851  }
  7852  
  7853  // testFloat64x4UnaryFlaky tests the simd unary method f against the expected behavior generated by want,
  7854  // but using a flakiness parameter because we haven't exactly figured out how simd floating point works
  7855  func testFloat64x4UnaryFlaky(t *testing.T, f func(x archsimd.Float64x4) archsimd.Float64x4, want func(x []float64) []float64, flakiness float64) {
  7856  	n := 4
  7857  	t.Helper()
  7858  	forSlice(t, float64s, n, func(x []float64) bool {
  7859  		t.Helper()
  7860  		a := archsimd.LoadFloat64x4(x)
  7861  		g := make([]float64, n)
  7862  		f(a).Store(g)
  7863  		w := want(x)
  7864  		return checkSlicesLogInput(t, g, w, flakiness, func() { t.Helper(); t.Logf("x=%v", x) })
  7865  	})
  7866  }
  7867  
  7868  // testFloat32x16UnaryFlaky tests the simd unary method f against the expected behavior generated by want,
  7869  // but using a flakiness parameter because we haven't exactly figured out how simd floating point works
  7870  func testFloat32x16UnaryFlaky(t *testing.T, f func(x archsimd.Float32x16) archsimd.Float32x16, want func(x []float32) []float32, flakiness float64) {
  7871  	n := 16
  7872  	t.Helper()
  7873  	forSlice(t, float32s, n, func(x []float32) bool {
  7874  		t.Helper()
  7875  		a := archsimd.LoadFloat32x16(x)
  7876  		g := make([]float32, n)
  7877  		f(a).Store(g)
  7878  		w := want(x)
  7879  		return checkSlicesLogInput(t, g, w, flakiness, func() { t.Helper(); t.Logf("x=%v", x) })
  7880  	})
  7881  }
  7882  
  7883  // testFloat64x8UnaryFlaky tests the simd unary method f against the expected behavior generated by want,
  7884  // but using a flakiness parameter because we haven't exactly figured out how simd floating point works
  7885  func testFloat64x8UnaryFlaky(t *testing.T, f func(x archsimd.Float64x8) archsimd.Float64x8, want func(x []float64) []float64, flakiness float64) {
  7886  	n := 8
  7887  	t.Helper()
  7888  	forSlice(t, float64s, n, func(x []float64) bool {
  7889  		t.Helper()
  7890  		a := archsimd.LoadFloat64x8(x)
  7891  		g := make([]float64, n)
  7892  		f(a).Store(g)
  7893  		w := want(x)
  7894  		return checkSlicesLogInput(t, g, w, flakiness, func() { t.Helper(); t.Logf("x=%v", x) })
  7895  	})
  7896  }
  7897  

View as plain text