github.com/JimmyHuang454/JLS-go@v0.0.0-20230831150107-90d536585ba0/cpu/cpu_ppc64x.go (about)

     1  // Copyright 2017 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 ppc64 || ppc64le
     6  
     7  package cpu
     8  
     9  const CacheLinePadSize = 128
    10  
    11  func doinit() {
    12  	options = []option{
    13  		{Name: "darn", Feature: &PPC64.HasDARN},
    14  		{Name: "scv", Feature: &PPC64.HasSCV},
    15  		{Name: "power9", Feature: &PPC64.IsPOWER9},
    16  	}
    17  
    18  	osinit()
    19  }
    20  
    21  func isSet(hwc uint, value uint) bool {
    22  	return hwc&value != 0
    23  }
    24  
    25  func Name() string {
    26  	switch {
    27  	case PPC64.IsPOWER10:
    28  		return "POWER10"
    29  	case PPC64.IsPOWER9:
    30  		return "POWER9"
    31  	case PPC64.IsPOWER8:
    32  		return "POWER8"
    33  	}
    34  	return ""
    35  }