Source file test/fixedbugs/issue80657.go

     1  // compile
     2  
     3  //go:build goexperiment.simd
     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 p
    10  
    11  import "simd"
    12  
    13  type Implementation struct{}
    14  
    15  func (Implementation) Foo(x []float64) {
    16  	for i := 0; i < len(x); {
    17  		v, n := simd.LoadFloat64sPart(x[i:])
    18  		_ = v
    19  		i += n
    20  	}
    21  }
    22  
    23  func (impl Implementation) Bar(x []float32) {
    24  	for i := 0; i < len(x); {
    25  		v, n := simd.LoadFloat32sPart(x[i:])
    26  		_ = v
    27  		i += n
    28  	}
    29  }
    30  
    31  func (Implementation) Baz(x []float64, extra ...int) {
    32  	for i := 0; i < len(x); {
    33  		v, n := simd.LoadFloat64sPart(x[i:])
    34  		_ = v
    35  		i += n
    36  	}
    37  	_ = extra
    38  }
    39  

View as plain text