Source file src/cmd/compile/internal/midway/midway.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  package midway
     6  
     7  import (
     8  	"internal/buildcfg"
     9  )
    10  
    11  func rewriteSizes() []int {
    12  	switch buildcfg.GOARCH {
    13  	case "wasm":
    14  		return []int{128}
    15  	case "amd64":
    16  		return []int{128, 256, 512}
    17  	case "arm64":
    18  		return []int{128} // this will change for SVE and cannot just be a size-based choice.
    19  	}
    20  	return nil
    21  }
    22  
    23  const simdPkg = "simd"
    24  const archFullPkg = "simd/internal/bridge"
    25  const archPkg = "bridge"
    26  const vectorSizeFn = "VectorBitSize"
    27  
    28  func isSimdTypeName(s string) bool {
    29  	switch s {
    30  	case "Int8s", "Int16s", "Int32s", "Int64s",
    31  		"Uint8s", "Uint16s", "Uint32s", "Uint64s",
    32  		"Mask8s", "Mask16s", "Mask32s", "Mask64s",
    33  		"Float32s", "Float64s":
    34  		return true
    35  	}
    36  	return false
    37  }
    38  

View as plain text