| 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 |
//go:build mips64 || mips64le |
| 6 |
|
| 7 |
package cpu |
| 8 |
|
| 9 |
const CacheLinePadSize = 32 |
| 10 |
|
| 11 |
// This is initialized by archauxv and should not be changed after it is |
| 12 |
// initialized. |
| 13 |
var HWCap uint |
| 14 |
|
| 15 |
// HWCAP bits. These are exposed by the Linux kernel 5.4. |
| 16 |
const ( |
| 17 |
// CPU features |
| 18 |
hwcap_MIPS_MSA = 1 << 1 |
| 19 |
) |
| 20 |
|
| 21 |
func doinit() { |
| 22 |
options = []option{ |
| 23 |
{Name: "msa", Feature: &MIPS64X.HasMSA}, |
| 24 |
} |
| 25 |
|
| 26 |
// HWCAP feature bits |
| 27 |
MIPS64X.HasMSA = isSet(HWCap, hwcap_MIPS_MSA) |
| 28 |
} |
| 29 |
|
| 30 |
func isSet(hwc uint, value uint) bool { |
| 31 |
return hwc&value != 0 |
| 32 |
} |