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

     1  // Copyright 2026 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build goexperiment.simd && amd64
     6  
     7  package simd_test
     8  
     9  import (
    10  	"simd/archsimd"
    11  	"simd/internal/test_helpers"
    12  	"testing"
    13  )
    14  
    15  func TestMask8x16Range(t *testing.T) {
    16  	test_helpers.TestMaskAllAny(t, archsimd.LoadInt8x16)
    17  }
    18  
    19  func TestMask8x32Range(t *testing.T) {
    20  	if !archsimd.X86.AVX2() {
    21  		t.Skip("AVX2 not supported")
    22  	}
    23  	test_helpers.TestMaskAllAny(t, archsimd.LoadInt8x32)
    24  }
    25  
    26  func TestMask8x64Range(t *testing.T) {
    27  	if !archsimd.X86.AVX512() {
    28  		t.Skip("AVX512 not supported")
    29  	}
    30  	test_helpers.TestMaskAllAny(t, archsimd.LoadInt8x64)
    31  }
    32  
    33  func TestMask16x8Range(t *testing.T) {
    34  	test_helpers.TestMaskAllAny(t, archsimd.LoadInt16x8)
    35  }
    36  
    37  func TestMask32x4Range(t *testing.T) {
    38  	test_helpers.TestMaskAllAny(t, archsimd.LoadInt32x4)
    39  }
    40  
    41  func TestMask64x2Range(t *testing.T) {
    42  	test_helpers.TestMaskAllAny(t, archsimd.LoadInt64x2)
    43  }
    44  
    45  func TestMask16x16Range(t *testing.T) {
    46  	if !archsimd.X86.AVX2() {
    47  		t.Skip("AVX2 not supported")
    48  	}
    49  	test_helpers.TestMaskAllAny(t, archsimd.LoadInt16x16)
    50  }
    51  
    52  func TestMask32x8Range(t *testing.T) {
    53  	if !archsimd.X86.AVX2() {
    54  		t.Skip("AVX2 not supported")
    55  	}
    56  	test_helpers.TestMaskAllAny(t, archsimd.LoadInt32x8)
    57  }
    58  
    59  func TestMask64x4Range(t *testing.T) {
    60  	if !archsimd.X86.AVX2() {
    61  		t.Skip("AVX2 not supported")
    62  	}
    63  	test_helpers.TestMaskAllAny(t, archsimd.LoadInt64x4)
    64  }
    65  
    66  func TestMask16x32Range(t *testing.T) {
    67  	if !archsimd.X86.AVX512() {
    68  		t.Skip("AVX512 not supported")
    69  	}
    70  	test_helpers.TestMaskAllAny(t, archsimd.LoadInt16x32)
    71  }
    72  
    73  func TestMask32x16Range(t *testing.T) {
    74  	if !archsimd.X86.AVX512() {
    75  		t.Skip("AVX512 not supported")
    76  	}
    77  	test_helpers.TestMaskAllAny(t, archsimd.LoadInt32x16)
    78  }
    79  
    80  func TestMask64x8Range(t *testing.T) {
    81  	if !archsimd.X86.AVX512() {
    82  		t.Skip("AVX512 not supported")
    83  	}
    84  	test_helpers.TestMaskAllAny(t, archsimd.LoadInt64x8)
    85  }
    86  

View as plain text