| 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 |
} |
| 17 |
osInit() |
| 18 |
} |
| 19 |
|
| 20 |
func isSet(hwc uint, value uint) bool { |
| 21 |
return hwc&value != 0 |
| 22 |
} |