summaryrefslogtreecommitdiff
path: root/vendor/golang.org/x/sys/cpu/cpu_linux_loong64.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2025-04-07 11:04:56 +0100
committerLibravatar GitHub <noreply@github.com>2025-04-07 11:04:56 +0100
commit920e20c2d2cff73d6dbdba108e19bc50261d3003 (patch)
tree79e302bd4102247a3f1b870120a2575d4f51a8a1 /vendor/golang.org/x/sys/cpu/cpu_linux_loong64.go
parent[chore]: Bump codeberg.org/gruf/go-mutexes from 1.5.1 to 1.5.2 (#3976) (diff)
downloadgotosocial-920e20c2d2cff73d6dbdba108e19bc50261d3003.tar.xz
[chore]: Bump golang.org/x/crypto from 0.36.0 to 0.37.0 (#3975)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.36.0 to 0.37.0. - [Commits](https://github.com/golang/crypto/compare/v0.36.0...v0.37.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-version: 0.37.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/golang.org/x/sys/cpu/cpu_linux_loong64.go')
-rw-r--r--vendor/golang.org/x/sys/cpu/cpu_linux_loong64.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_loong64.go b/vendor/golang.org/x/sys/cpu/cpu_linux_loong64.go
new file mode 100644
index 000000000..4f3411432
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_linux_loong64.go
@@ -0,0 +1,22 @@
+// Copyright 2025 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
+
+// HWCAP bits. These are exposed by the Linux kernel.
+const (
+ hwcap_LOONGARCH_LSX = 1 << 4
+ hwcap_LOONGARCH_LASX = 1 << 5
+)
+
+func doinit() {
+ // TODO: Features that require kernel support like LSX and LASX can
+ // be detected here once needed in std library or by the compiler.
+ Loong64.HasLSX = hwcIsSet(hwCap, hwcap_LOONGARCH_LSX)
+ Loong64.HasLASX = hwcIsSet(hwCap, hwcap_LOONGARCH_LASX)
+}
+
+func hwcIsSet(hwc uint, val uint) bool {
+ return hwc&val != 0
+}