Source file test/fixedbugs/issue34950.go

     1  // run
     2  
     3  //go:build goexperiment.simd && amd64
     4  
     5  // Copyright 2026 The Go Authors. All rights reserved.
     6  // Use of this source code is governed by a BSD-style
     7  // license that can be found in the LICENSE file.
     8  
     9  package main
    10  
    11  import "simd/archsimd"
    12  
    13  //go:noinline
    14  func f(k bool, v archsimd.Int32x4) int32 {
    15  	n := int32(0)
    16  	if k {
    17  		n = 1
    18  	}
    19  	if archsimd.X86.AVX() {
    20  		n += v.GetElem(0)
    21  	}
    22  	return n
    23  }
    24  
    25  func main() {
    26  	_ = f(true, archsimd.Int32x4{})
    27  }
    28  

View as plain text