Guoqi Chen
7401cce313
cpu: replace specific instructions with WORD in the function get_cpucfg on loong64
...
The CPUCFG instruction on loong64 was introduced in Go1.24, which caused
compilation errors when using this feature in Go1.23 and earlier versions.
Change-Id: I68891bbfc527194ecdafebac3398e700bfb53c2f
Reviewed-on: https://go-review.googlesource.com/c/sys/+/656915
Reviewed-by: Meidan Li <limeidan@loongson.cn >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: David Chase <drchase@google.com >
Reviewed-by: Junyang Shao <shaojunyang@google.com >
2025-03-12 17:52:00 -07:00
Guoqi Chen
b8f7da6c5a
cpu: add support for detecting cpu features on loong64
...
Except for lasx, all other features have been implemented
in the Go mainline.
Change-Id: I61a09396ed23d17991b641a1265e952585cb5636
Reviewed-on: https://go-review.googlesource.com/c/sys/+/655355
Reviewed-by: David Chase <drchase@google.com >
Reviewed-by: sophie zhao <zhaoxiaolin@loongson.cn >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Junyang Shao <shaojunyang@google.com >
Reviewed-by: Meidan Li <limeidan@loongson.cn >
2025-03-11 18:36:47 -07:00
Grigorii Khvatskii
c75621413d
cpu: add support for AVX-VNNI and IFMA detection
...
Added detection for x86 AVX-VNNI (VEX-coded Vector Neural Network
Instructions) and AVX-IFMA (VEX-coded Integer Fused Multiply Add),
including both the base VNNI set and the Int8 extention.
Fixes golang/go#71142
Change-Id: I9e8d18b2e8bf81d5d4313a4a47fdf731fb3d44dd
GitHub-Last-Rev: 32ea443fc2
GitHub-Pull-Request: golang/sys#242
Reviewed-on: https://go-review.googlesource.com/c/sys/+/641155
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Michael Pratt <mpratt@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
2025-01-10 12:06:19 -08:00
Vaughn Iverson
8f2aa9fb48
cpu: conditionally re-enable AVX512 support on darwin/amd64
...
Darwin opmask clobbering bug was fixed in kernel version 21.3.0
as released in MacOS 12.2.0. This commit resolves issue by
checking for Darwin AVX512 support via a sysctl call with the
addition of a kernel minimum version check.
The kernel version check is completed without adding new
dependencies to x/sys/cpu. A sysctl call is accomplished by
copying a minimal amount of code from x/sys/unix, to retrieve
only the needed KERN_OSRELEASE value. This code is structured
in the same manner as an existing analogous AIX/PPC64 syscall.
The resulting dotted version string value is then parsed for
numeric comparison with a dependency free function.
All code in this contribution is structured to ease removal of
the special darwin/amd64 codepaths when that OS/arch combination
is eventually no longer supported by golang.
Resolves issue: golang/go#49233 , reinstates fix for issue: golang/go#43089
Change-Id: I4755fc8b3865eb6562b0959ecc910e2c46ac6cb4
Reviewed-on: https://go-review.googlesource.com/c/sys/+/620256
Reviewed-by: Keith Randall <khr@google.com >
Reviewed-by: Keith Randall <khr@golang.org >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Carlos Amedee <carlos@golang.org >
Reviewed-by: vsivsi@yahoo.com <vsivsi@yahoo.com >
2024-11-04 23:17:32 +00:00
cuishuang
2dfefb6832
all: execute gofmt
...
Change-Id: I55aef760145df773be30d567c9e989f46a3e79dc
Reviewed-on: https://go-review.googlesource.com/c/sys/+/618898
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Michael Knyszek <mknyszek@google.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2024-10-11 18:38:43 +00:00
Mark Ryan
3283fc3f61
cpu: add support for detecting RISC-V extensions
...
Add a RISCV64 variable to cpu that indicates both the presence
of RISC-V extensions and performance information about the underlying
RISC-V cores. The variable is only populated with non false values on
Linux. The detection code first attempts to use the riscv_hwprobe
syscall introduced in Linux 6.4, falling back to HWCAP if riscv_hwprobe
is not supported. The patch can detect the C, V, Zba, Zbb and Zbs
extensions. V, Zba, Zbb and Zbs can only be detected on a 6.5 kernel
or later (without backports).
Updates golang/go#61416
Change-Id: I40f92724ee3d337c06bdc559ff0b18a8f6bfda9f
Reviewed-on: https://go-review.googlesource.com/c/sys/+/605815
Reviewed-by: Cherry Mui <cherryyz@google.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Joel Sing <joel@sing.id.au >
Reviewed-by: Meng Zhuo <mengzhuo1203@gmail.com >
2024-08-23 10:43:34 +00:00
Hernan Martinez
7bb0bf703b
cpu: add Int8 matrix multiplication instructions CPU feature flag for ARM64
...
References:
5bbd9b2498/arch/arm64/include/uapi/asm/hwcap.h (L75C9-L75C31)
https://developer.arm.com/documentation/ddi0601/2024-03/AArch64-Registers/ID-AA64ISAR1-EL1--AArch64-Instruction-Set-Attribute-Register-1
Change-Id: Ic4e1cf2c23097c7e8695453b6d0b335756d474bc
Reviewed-on: https://go-review.googlesource.com/c/sys/+/595678
Reviewed-by: Ian Lance Taylor <iant@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Auto-Submit: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Cherry Mui <cherryyz@google.com >
2024-07-17 17:57:00 +00:00
Roland Shoemaker
0c18c88c71
cpu: add DIT option and hwcap DIT support
...
Follow-up to https://go.dev/cl/597377 , add a option for DIT so it can be
set via GODEBUG, and add hwcap support for Linux.
Change-Id: Ib094b520edea9c099d37f121b09d02b31644a433
Reviewed-on: https://go-review.googlesource.com/c/sys/+/598719
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
2024-07-17 01:04:09 +00:00
Roland Shoemaker
47fe916942
cpu: add support for DIT detection
...
Change-Id: I9f0991da9684ebd297e40a754e34130c418c34d0
Reviewed-on: https://go-review.googlesource.com/c/sys/+/597377
Reviewed-by: Ian Lance Taylor <iant@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
2024-07-11 16:45:38 +00:00
Michal Hruby
7758090324
cpu: add support for sve2 detection
...
Fixes golang/go#66952
Change-Id: Idaf2ce3b09baf33cf29079677a83a51ea9c4b255
GitHub-Last-Rev: eac00886d1
GitHub-Pull-Request: golang/sys#193
Reviewed-on: https://go-review.googlesource.com/c/sys/+/580655
Reviewed-by: Ian Lance Taylor <iant@google.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: David Chase <drchase@google.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2024-05-03 16:45:19 +00:00
Dmitri Shuralyov
1bfbee0e20
all: update go directive to 1.18
...
Done with:
go get go@1.18
go mod tidy
go fix ./...
Using go1.21.3.
Also update code generators to use only the new go:build lines,
not the old +build ones.
For golang/go#60268 .
Change-Id: I6aabc42efb6ab3329981100e1db2263aac5e92a6
Reviewed-on: https://go-review.googlesource.com/c/sys/+/534222
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
2023-10-11 21:54:30 +00:00
Kir Kolyshkin
f3ef2d1cfa
cpu: remove the use of ioutil
...
A trivial change.
Change-Id: I8121c263d5b8e9d0634d4f38847aff3cb770ef96
Reviewed-on: https://go-review.googlesource.com/c/sys/+/526301
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Run-TryBot: Kirill Kolyshkin <kolyshkin@gmail.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
2023-09-14 15:30:27 +00:00
Meng Zhuo
38ebf4150f
cpu: fix wrong cache line size of riscv64
...
This CL follows CL526659 as cache line should be 64 Bytes
Change-Id: Id3a49dbfbfad6aeb439eb5e585fd2d6228a3d3ed
Reviewed-on: https://go-review.googlesource.com/c/sys/+/526935
Reviewed-by: Heschi Kreinick <heschi@google.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
2023-09-13 01:34:38 +00:00
cui fliter
70233675ae
cpu: remove repetitive word
...
Change-Id: I6dbed409b549ab2cfc862094f19373816b7c0859
Reviewed-on: https://go-review.googlesource.com/c/sys/+/519076
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
Run-TryBot: Ian Lance Taylor <iant@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Auto-Submit: Ian Lance Taylor <iant@google.com >
2023-08-16 01:58:07 +00:00
Anton Kuklin
eabbd5c036
cpu: add support for amx detection
...
Added detection for x86 AMX,
including AMX-Tile, AMX-INT8 and AMX-BF16
instruction sets.
Change-Id: Ib3d663430b64d46b46b22bdd05d40f1992e37ee0
GitHub-Last-Rev: 7986ed6d4f
GitHub-Pull-Request: golang/sys#170
Reviewed-on: https://go-review.googlesource.com/c/sys/+/516815
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Michael Knyszek <mknyszek@google.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
2023-08-14 16:42:18 +00:00
Tobias Klauser
352d8339e8
cpu: add test for IsBigEndian
...
For golang/go#57237
Change-Id: I11d1c954f942ebd836c4deb9c710c40778dc5599
Reviewed-on: https://go-review.googlesource.com/c/sys/+/494858
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Heschi Kreinick <heschi@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
2023-05-16 16:00:41 +00:00
Tobias Klauser
c43fe1e1f5
cpu: define IsBigEndian on wasm
...
For golang/go#57237
Change-Id: Ia2aa943e93c8df51cd08003535fa026d2bb8003e
Reviewed-on: https://go-review.googlesource.com/c/sys/+/494856
TryBot-Result: Gopher Robot <gobot@golang.org >
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Heschi Kreinick <heschi@google.com >
2023-05-16 16:00:40 +00:00
Brad Fitzpatrick
2da1413846
cpu: get hwcap/auxv from the Go 1.21+ runtime
...
Depends on https://go.dev/cl/458256
This change only does Linux for now.
Updates golang/go#57336
Change-Id: I0659697c1bdc6e2577c6251b964a0df32047ee12
Reviewed-on: https://go-review.googlesource.com/c/sys/+/465295
Reviewed-by: Ian Lance Taylor <iant@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Michael Pratt <mpratt@google.com >
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org >
2023-02-17 19:36:37 +00:00
Tobias Klauser
13fe000ef0
cpu: add IsBigEndian
...
Copy the definition of x/sys/unix.isBigEndian to x/sys/cpu.
Updates golang/go#57237
Change-Id: Iefbf4303720445611de93b0a3ea365f8208c033b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/463335
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com >
Reviewed-by: Rob Pike <r@golang.org >
TryBot-Result: Gopher Robot <gobot@golang.org >
2023-01-27 13:35:52 +00:00
Tobias Klauser
b8be2fde2a
cpu: add //go:build line to cpu_gccgo_x86.c
...
Change-Id: I597a83c767bf597f4d5c2ffdd7097f3cd6781f84
Reviewed-on: https://go-review.googlesource.com/c/sys/+/460158
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Heschi Kreinick <heschi@google.com >
2023-01-05 18:34:43 +00:00
Brad Fitzpatrick
2204b6615f
cpu: parse /proc/cpuinfo on linux/arm64 on old kernels when needed
...
Updates tailscale/tailscale#5793
Fixes golang/go#57336
Change-Id: I4f8128bebcc58f265d447ecaaad2473aafa9131c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/458315
Reviewed-by: Michael Pratt <mpratt@google.com >
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org >
Auto-Submit: Brad Fitzpatrick <bradfitz@golang.org >
Reviewed-by: David Chase <drchase@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
2022-12-20 02:54:02 +00:00
Joel Sing
3938a4f48c
cpu: add support for ppc64 on platforms other than aix and linux
...
This allows the cpu package to function on openbsd/ppc64.
Updates golang/go#56001
Change-Id: Iff306b6091da8f7dc28dd1bd2c9ba668b5318a67
Reviewed-on: https://go-review.googlesource.com/c/sys/+/439977
Run-TryBot: Joel Sing <joel@sing.id.au >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Bryan Mills <bcmills@google.com >
2022-10-10 17:02:31 +00:00
Pure White
20c2bfdbfe
cpu: fix cpu cacheLineSize for arm64 darwin(a.k.a. M1)
...
The existing value for M1 is 64, which is the same as other arm64 cpus.
But the correct cacheLineSize for M1 should be 128, which can be
verified using the following command:
$ sysctl -a hw | grep cachelinesize
hw.cachelinesize: 128
Fixes golang/go#53075
Change-Id: I555716ed412cdc02941c8b1d9767952f7ad6678c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/408614
Run-TryBot: Keith Randall <khr@golang.org >
Reviewed-by: Keith Randall <khr@golang.org >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Joedian Reid <joedian@golang.org >
Reviewed-by: Keith Randall <khr@google.com >
2022-08-23 22:43:34 +00:00
Joel Sing
3d627bb497
cpu: implement CPU feature detection for openbsd/arm64
...
OpenBSD 7.1 onwards expose the aarch64 ISAR0 and ISAR1 registers via sysctl:
$ sysctl machdep
machdep.compatible=apple,j274
machdep.id_aa64isar0=153421459058925856
machdep.id_aa64isar1=1172796674562
Implement CPU feature detection for openbsd/arm64 based on this information.
Updates golang/go#31746
Change-Id: I6dc473d93ccff720582c05b75456de51269bc3e5
Reviewed-on: https://go-review.googlesource.com/c/sys/+/421799
Run-TryBot: Joel Sing <joel@sing.id.au >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Than McIntosh <thanm@google.com >
Run-TryBot: Ian Lance Taylor <iant@google.com >
2022-08-08 15:39:00 +00:00
Meng Zhuo
5a0f0661e0
cpu: support non-linux OS for riscv64
...
Fixes golang/go#53698
Change-Id: Ia954aed4445a47fb8f8a2c0b9869aa8c50f2de15
Reviewed-on: https://go-review.googlesource.com/c/sys/+/416394
Auto-Submit: Meng Zhuo <mzh@golangcn.org >
Reviewed-by: Heschi Kreinick <heschi@google.com >
Run-TryBot: Meng Zhuo <mzh@golangcn.org >
Reviewed-by: Benny Siegert <bsiegert@gmail.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Joel Sing <joel@sing.id.au >
2022-07-08 08:52:39 +00:00
Ian Lance Taylor
9f5ed59c13
cpu: use xgetbv intrinsic
...
Fixes golang/go#53302
Change-Id: I698ef44f90e2ec538ae4a057134c22c102a87ff8
Reviewed-on: https://go-review.googlesource.com/c/sys/+/411635
Auto-Submit: Ian Lance Taylor <iant@google.com >
Run-TryBot: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Cherry Mui <cherryyz@google.com >
Reviewed-by: Ian Lance Taylor <iant@google.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Run-TryBot: Ian Lance Taylor <iant@google.com >
2022-06-10 22:13:04 +00:00
Russ Cox
b5fbb4746d
all: gofmt
...
Gofmt to update doc comments to the new formatting.
For golang/go#51082 .
Change-Id: I9a1c4b671c06820a1c383ee515f7884965fefa54
Reviewed-on: https://go-review.googlesource.com/c/sys/+/399602
Reviewed-by: Ian Lance Taylor <iant@google.com >
Auto-Submit: Russ Cox <rsc@golang.org >
TryBot-Result: Gopher Robot <gobot@golang.org >
Run-TryBot: Russ Cox <rsc@golang.org >
2022-04-29 23:34:32 +00:00
limeidan
0a89baf871
cpu: add basic support for GOARCH=loong64
...
Updates golang/go#46229
Change-Id: Ibee284c742532dec798f4a5ecfe38b429825d7aa
Reviewed-on: https://go-review.googlesource.com/c/sys/+/399334
Run-TryBot: Ian Lance Taylor <iant@golang.org >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@google.com >
Auto-Submit: Ian Lance Taylor <iant@google.com >
Reviewed-by: Russ Cox <rsc@golang.org >
2022-04-12 01:57:24 +00:00
Johan Van de Wauw
b874c991c1
cpu: fix typo in comments
...
Change-Id: Icb2bacefd7d8656e0a5867cb90fe0ca06252ad0b
GitHub-Last-Rev: c6d3b42e1b
GitHub-Pull-Request: golang/sys#120
Reviewed-on: https://go-review.googlesource.com/c/sys/+/390934
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2022-03-10 02:08:20 +00:00
zhouguangyuan
97ca703d54
cpu: remove the declaration of function darwinSupportsAVX512
...
The implement of darwinSupportsAVX512 has been removed in CL 361255.
But the command "go install -buildmode=shared std" failed because the
declaration of it is remained in cpu/cpu_gc_x86.go. It should be removed.
Update golang/go#49233
For golang/go#49942
Change-Id: I8fa7c61c20457e49414930029b9f026c335aa421
Reviewed-on: https://go-review.googlesource.com/c/sys/+/368994
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Keith Randall <khr@golang.org >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gopher Robot <gobot@golang.org >
Trust: Ian Lance Taylor <iant@golang.org >
2021-12-05 18:29:25 +00:00
Keith Randall
7861aae155
cpu: pretend AVX-512 is disabled on Darwin
...
Darwin doesn't save/restore the AVX-512 mask registers when
processing a signal. Go generates lots of signals, which cause
the mask registers to randomly get clobbered. Better to pretend
that AVX-512 isn't supported.
Update golang/go#49233
Change-Id: I0dda77a6f205e10eefccd82e6f4f0f184dae42d9
Reviewed-on: https://go-review.googlesource.com/c/sys/+/361255
Trust: Keith Randall <khr@golang.org >
Run-TryBot: Keith Randall <khr@golang.org >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
Reviewed-by: Martin Möhrmann <martin@golang.org >
2021-11-03 23:57:46 +00:00
Tobias Klauser
808efd93c3
cpu: enable TestARM64minimalFeatures on darwin/arm64
...
Go 1.16 renamed the iOS port from darwin/arm64 to ios/arm64 and
darwin/arm64 was repurposed for the macOS ARM64 port (see
https://golang.org/doc/go1.16#darwin ).
Now that Go 1.16 is the oldest supported release, the ios tag can be
used exclusively to detect iOS. Thus, TestARM64minimalFeatures which
ought to run on darwin/arm64 can now be enabled on that platform.
For golang/go#45696
Change-Id: Ic510fbf27dc813832507446201501df58c9f6f31
Reviewed-on: https://go-review.googlesource.com/c/sys/+/353530
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2021-10-02 10:42:44 +00:00
zhangyunhao
63515b42dc
cpu: add support for detecting cmpxchg16b
...
Change-Id: I892de938e85205c0506aa82e31297b7a99e48e44
Reviewed-on: https://go-review.googlesource.com/c/sys/+/329450
Trust: Martin Möhrmann <martin@golang.org >
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Martin Möhrmann <martin@golang.org >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Martin Möhrmann <martin@golang.org >
2021-08-23 07:06:55 +00:00
Tobias Klauser
b0526f3d87
cpu: set PPC64.IsPOWER8 for Power9 on aix
...
This is in line with the behavior on linux.
Fixes golang/go#46040
Change-Id: I01ba1896d879425d12096ae67250d7e60beb7a99
Reviewed-on: https://go-review.googlesource.com/c/sys/+/318549
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Trust: Bryan C. Mills <bcmills@google.com >
Trust: Martin Möhrmann <moehrmann@google.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Bryan C. Mills <bcmills@google.com >
Reviewed-by: Martin Möhrmann <moehrmann@google.com >
2021-05-11 11:38:59 +00:00
Vaughn Iverson
b677753862
cpu: fix AVX512 support detection on Darwin
...
Summary: On darwin/amd64, it is not adequate to use OSXSAVE
bits to determine AVX512 availabilty. The reason is involved.
See github issue for details.
The fix consists of implementing Apple's recommended approach
using the process commpage cpu_capabilities bits to determine
availability of AVX512.
Fixes golang/go#43089
Change-Id: I1ba89965498863d268fbf2e427dbfd6429c7409f
Reviewed-on: https://go-review.googlesource.com/c/sys/+/285572
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Martin Möhrmann <moehrmann@google.com >
2021-05-03 07:37:44 +00:00
Tobias Klauser
8feff5de77
cpu: add //go:build lines to assembly files
...
Change-Id: I44c0bab1cc8a3b7ce59a1c690cb22046bca32bac
Reviewed-on: https://go-review.googlesource.com/c/sys/+/313689
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
TryBot-Result: Go Bot <gobot@golang.org >
2021-04-26 21:46:56 +00:00
Russ Cox
9a76102bfb
all: go fmt ./...
...
Make all our package sources use Go 1.17 gofmt format
(adding //go:build lines).
Not strictly necessary but will avoid spurious changes
as files are edited.
Part of //go:build change (#41184 ).
See https://golang.org/design/draft-gobuild
Change-Id: I01667f826428426a39c84717d02efa25fa44553c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/294490
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Keith Randall <khr@golang.org >
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com >
Reviewed-by: Matt Layher <mdlayher@gmail.com >
Trust: Josh Bleecher Snyder <josharian@gmail.com >
Trust: Russ Cox <rsc@golang.org >
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com >
Run-TryBot: Russ Cox <rsc@golang.org >
2021-02-20 05:07:31 +00:00
Tamir Duberstein
0a15ea8d9b
*: use more precise build tags
...
s/!gccgo/gc/ in files which use gc-syntax assembly.
Change-Id: Iafc006cd60ad0e429cff182a05c790d80c380802
Reviewed-on: https://go-review.googlesource.com/c/sys/+/269717
Run-TryBot: Ian Lance Taylor <iant@golang.org >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Trust: Than McIntosh <thanm@google.com >
2020-11-13 13:57:34 +00:00
Joel Sing
201ba4db24
cpu: make x/sys/cpu build on non-linux mips64x
...
Update golang/go#40995
Change-Id: Icab9865e59350c11da32bf8af2d0830001e41323
Reviewed-on: https://go-review.googlesource.com/c/sys/+/265959
Trust: Joel Sing <joel@sing.id.au >
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
2020-10-29 08:09:32 +00:00
Bill O'Farrell
708e7fb298
cpu: add support for zos/s390x
...
This adds feature detection that works on the s390x running zos.
There are some differences with Linux (no hwcap, facilities vector available in-memory).
These changes should not affect other platforms.
Fixes golang/go#41984 .
Change-Id: Ieabbfafd07367a346a4d279dde0f00aa3fc4321b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/262477
Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Martin Möhrmann <moehrmann@google.com >
Trust: Martin Möhrmann <moehrmann@google.com >
Trust: Emmanuel Odeke <emmanuel@orijtech.com >
2020-10-28 09:49:53 +00:00
Tobias Klauser
ef9fd89ba2
cpu: read ARM64 registers using sysctl(3) on netbsd/arm64
...
Use sysctl("machdep.cpu0.cpu_id") to retrieve the ARM64 cpu_id
information on netbsd/arm64. This includes the ISAR0, ISAR1 and PFR0
registers which can be parsed using existing functionality.
In order to use sysctl(3) without depending on x/sys/unix, some
functionality needed to be copied and slightly adjusted.
Change-Id: Ic9a133917ae5da516e6794f375bd7602d9bd3aa6
Reviewed-on: https://go-review.googlesource.com/c/sys/+/264378
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Trust: Benny Siegert <bsiegert@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Benny Siegert <bsiegert@gmail.com >
2020-10-24 13:24:49 +00:00
Tobias Klauser
fb209a7c41
cpu: refactor parsing of ARM64 registers into separate function
...
This will allow to re-use the implementation when adding support for
netbsd/arm64 which will retreive these register values using sysctl(3).
Change-Id: I2414cc4c6d1a91fff946466e4bf6d95d07f30137
Reviewed-on: https://go-review.googlesource.com/c/sys/+/264377
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Martin Möhrmann <moehrmann@google.com >
2020-10-22 20:17:47 +00:00
Tobias Klauser
98379d014c
cpu: avoid illegal instruction on openbsd/arm64
...
On OpenBSD, this package tries to read a privileged register, which
results in a SIGILL. Use the same workaround as Android, iOS and NetBSD.
Update golang/go#31746
Change-Id: I981249310169bc30b018c1a157529a4e46597d81
Reviewed-on: https://go-review.googlesource.com/c/sys/+/263337
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Joel Sing <joel@sing.id.au >
2020-10-18 12:10:11 +00:00
Anton Kuklin
006507a758
cpu: add support for detecting AVX-512
...
The existing implementation hasn't AVX-512 detection support.
This patch extends cpu package with such a functionality.
Fixes golang/go#41288
Change-Id: Iaddd57c5ff6d73360b77886458b9210b6c446859
Reviewed-on: https://go-review.googlesource.com/c/sys/+/257937
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2020-09-28 20:51:50 +00:00
Cherry Zhang
d9f96fdee2
all: add GOOS=ios
...
Following CL 254740, this CL does it on x/sys.
Updates golang/go#38485 .
Change-Id: I5eab09a9a87c87fc883b5701434415648fb28eb0
Reviewed-on: https://go-review.googlesource.com/c/sys/+/255557
Trust: Cherry Zhang <cherryyz@google.com >
Run-TryBot: Cherry Zhang <cherryyz@google.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2020-09-23 18:26:05 +00:00
Joel Sing
d785dc2583
cpu: add missing build tag for linux
...
The code in this file is specific to linux and does not build on other
mips64x platforms.
Change-Id: Ic27eedf06f39a7d2c51f5b261d957eed04e5df0b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/249318
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
2020-08-19 17:11:15 +00:00
Polina Osadcha
0cf7623e9d
cpu: add GODEBUG options to disable use of instruction set extensions
...
The GODEBUG environment variable can be used to disable usage of
specific processor features of Go programs that use the sys/cpu package.
This is useful for testing and benchmarking different code paths that
are guarded by sys/cpu variable checks.
Use of processor features can not be enabled through GODEBUG.
To disable usage of AVX and SSE41 cpu features on GOARCH amd64 use:
GODEBUG=cpu.avx=off,cpu.sse41=off
The special "all" option can be used to disable all options:
GODEBUG=all=off
This aligns the support of GODEBUG for sys/cpu with existing support
for GODEBUG in the Go standard library package internal/cpu.
Fixes golang/go#33963
Change-Id: I618b71af397bf06c57a49b2a300d032a16d05664
Reviewed-on: https://go-review.googlesource.com/c/sys/+/245237
Run-TryBot: Martin Möhrmann <moehrmann@google.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Martin Möhrmann <moehrmann@google.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2020-08-05 06:55:43 +00:00
Tobias Klauser
f1bc736245
cpu: adjust godoc comment for hostByteOrder
...
This was changed in CL 194646 to no longer depend on the encoding/binary
package. Adjust the godoc comment as well.
Change-Id: I1f23dc83a4c1256ebce8a283623f79e1bd00da51
Reviewed-on: https://go-review.googlesource.com/c/sys/+/238037
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2020-06-15 20:00:32 +00:00
Tobias Klauser
2780627062
cpu: add all GOARCHes supported by gccgo
...
Extend hostByteOrder to return the correct byte order for all GOARCHes
currently supported by gccgo.
Change-Id: I019de33aa598c58fe75cd7ad55479e6fce82dd8e
Reviewed-on: https://go-review.googlesource.com/c/sys/+/237897
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2020-06-15 19:00:26 +00:00
Benny Siegert
0598657881
cpu: avoid illegal instruction on netbsd/arm64
...
On NetBSD, this package tries to read a privileged register,
which results in a SIGILL. Use the same workaround as Android and
iOS. In the future, we could use sysctl(3) instead.
Update golang/go#30824
Change-Id: Ifd9aa2a2cf4dac43341d013602d1ccb4b8d6eb6d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/235097
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
2020-05-23 22:24:54 +00:00