summaryrefslogtreecommitdiffstats
path: root/contrib/go/_std_1.26/src/internal/cpu/cpu_riscv64.go
blob: 0fe1704855fa0c48be8ef2c97727837f6c6a51d4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package cpu

const CacheLinePadSize = 64

// RISC-V doesn't have a 'cpuid' equivalent. On Linux we rely on the riscv_hwprobe syscall.

func doinit() {
	options = []option{
		{Name: "fastmisaligned", Feature: &RISCV64.HasFastMisaligned},
		{Name: "v", Feature: &RISCV64.HasV},
		{Name: "zbb", Feature: &RISCV64.HasZbb},
	}
	osInit()
}

func isSet(hwc uint, value uint) bool {
	return hwc&value != 0
}