Source file src/internal/cpu/cpu_riscv64.go

     1  // Copyright 2019 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 cpu
     6  
     7  const CacheLinePadSize = 64
     8  
     9  // RISC-V doesn't have a 'cpuid' equivalent. On Linux we rely on the riscv_hwprobe syscall.
    10  
    11  func doinit() {
    12  	options = []option{
    13  		{Name: "fastmisaligned", Feature: &RISCV64.HasFastMisaligned},
    14  		{Name: "v", Feature: &RISCV64.HasV},
    15  		{Name: "zbb", Feature: &RISCV64.HasZbb},
    16  		{Name: "zbc", Feature: &RISCV64.HasZbc},
    17  		{Name: "zvbb", Feature: &RISCV64.HasZvbb},
    18  		{Name: "zvbc", Feature: &RISCV64.HasZvbc},
    19  		{Name: "zvkg", Feature: &RISCV64.HasZvkg},
    20  		{Name: "zvkned", Feature: &RISCV64.HasZvkned},
    21  		{Name: "zvknha", Feature: &RISCV64.HasZvknha},
    22  		{Name: "zvknhb", Feature: &RISCV64.HasZvknhb},
    23  		{Name: "zvksed", Feature: &RISCV64.HasZvksed},
    24  		{Name: "zvksh", Feature: &RISCV64.HasZvksh},
    25  		{Name: "zvkt", Feature: &RISCV64.HasZvkt},
    26  	}
    27  	osInit()
    28  }
    29  
    30  func isSet(hwc uint, value uint) bool {
    31  	return hwc&value != 0
    32  }
    33  

View as plain text