.gitignore added
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / sys@v0.0.0-20210124154548-22da62e12c0c / cpu / cpu_linux_ppc64x.go
1 // Copyright 2018 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 // +build linux
6 // +build ppc64 ppc64le
7
8 package cpu
9
10 // HWCAP/HWCAP2 bits. These are exposed by the kernel.
11 const (
12         // ISA Level
13         _PPC_FEATURE2_ARCH_2_07 = 0x80000000
14         _PPC_FEATURE2_ARCH_3_00 = 0x00800000
15
16         // CPU features
17         _PPC_FEATURE2_DARN = 0x00200000
18         _PPC_FEATURE2_SCV  = 0x00100000
19 )
20
21 func doinit() {
22         // HWCAP2 feature bits
23         PPC64.IsPOWER8 = isSet(hwCap2, _PPC_FEATURE2_ARCH_2_07)
24         PPC64.IsPOWER9 = isSet(hwCap2, _PPC_FEATURE2_ARCH_3_00)
25         PPC64.HasDARN = isSet(hwCap2, _PPC_FEATURE2_DARN)
26         PPC64.HasSCV = isSet(hwCap2, _PPC_FEATURE2_SCV)
27 }
28
29 func isSet(hwc uint, value uint) bool {
30         return hwc&value != 0
31 }