aboutsummaryrefslogtreecommitdiff
path: root/src/internal/cpu/cpu_ppc64x.go
AgeCommit message (Collapse)Author
2022-05-10internal/cpu: report CPU if known on PPC64Paul E. Murphy
The PPC64 maintainers are testing on P10 hardware, so it is helpful to report the correct cpu, even if this information is not used elsewhere yet. Note, AIX will report the current CPU of the host system, so a POWER10 will not set the IsPOWER9 flag. This is existing behavior, and should be fixed in a separate patch. Change-Id: Iebe23dd96ebe03c8a1c70d1ed2dc1506bad3c330 Reviewed-on: https://go-review.googlesource.com/c/go/+/404394 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Paul Murphy <murp@ibm.com> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com>
2021-10-28all: go fix -fix=buildtag std cmd (except for bootstrap deps, vendor)Russ Cox
When these packages are released as part of Go 1.18, Go 1.16 will no longer be supported, so we can remove the +build tags in these files. Ran go fix -fix=buildtag std cmd and then reverted the bootstrapDirs as defined in src/cmd/dist/buildtool.go, which need to continue to build with Go 1.4 for now. Also reverted src/vendor and src/cmd/vendor, which will need to be updated in their own repos first. Manual changes in runtime/pprof/mprof_test.go to adjust line numbers. For #41184. Change-Id: Ic0f93f7091295b6abc76ed5cd6e6746e1280861e Reviewed-on: https://go-review.googlesource.com/c/go/+/344955 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
2021-02-20all: go fmt std cmd (but revert vendor)Russ Cox
Make all our package sources use Go 1.17 gofmt format (adding //go:build lines). Part of //go:build change (#41184). See https://golang.org/design/draft-gobuild Change-Id: Ia0534360e4957e58cd9a18429c39d0e32a6addb4 Reviewed-on: https://go-review.googlesource.com/c/go/+/294430 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-10-29runtime: move ppc64/aix cpu feature detection to internal/cpuMartin Möhrmann
Additionally removed unused PPC64.IsPOWER8 CPU feature detection. Change-Id: I1411b03d396a72e08d6d51f8a1d1bad49eaa720e Reviewed-on: https://go-review.googlesource.com/c/go/+/266077 Trust: Martin Möhrmann <moehrmann@google.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-04-13internal/cpu: unify HWCap/HWCap2 commentsTobias Klauser
HWCap and HWCap2 are no longer linknamed into package runtime. Also, merge two sentences both starting with "These are..." and don't mention any file name where archauxv is defined, as it become outdated if support for a new $GOOS/$GOARCH combination is added. This is e.g. already the case for arm64, where archauxv is also defined for freebsd/arm64. Change-Id: I9314a66633736b12e777869a832d8b79d442a6f8 Reviewed-on: https://go-review.googlesource.com/c/go/+/228057 Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-10-31internal/cpu, runtime: add CPU feature detection support for AIXClément Chigot
AIX doesn't have HWCAP/HWCAP2 variables like Linux. Therefore, it relies on getsystemcfg syscall which can provide some information about the CPU. Change-Id: Ic0dc927e80890d4bf8f0bdfb43fad1e2b890d7a0 Reviewed-on: https://go-review.googlesource.com/c/144959 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Martin Möhrmann <moehrmann@google.com>
2018-10-29internal/cpu: remove unused and not required ppc64(le) feature detectionMartin Möhrmann
Minimum Go requirement for ppc64(le) architecture support is POWER8. https://github.com/golang/go/wiki/MinimumRequirements#ppc64-big-endian Reduce CPU features supported in internal/cpu to those needed to test minimum requirements and cpu feature kernel support for ppc64(le). Currently no internal/cpu feature variables are used to guard code from using unsupported instructions. The IsPower9 feature variable and detection is kept as it will soon be used to guard code execution. Reducing the set of detected CPU features for ppc64(le) makes implementing Go support for new operating systems easier as CPU feature detection for ppc64(le) needs operating system support (e.g. hwcap on Linux and getsystemcfg syscall on AIX). Change-Id: Ic4c17b31610970e481cd139c657da46507391d1d Reviewed-on: https://go-review.googlesource.com/c/145117 Run-TryBot: Martin Möhrmann <martisch@uos.de> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Carlos Eduardo Seo <cseo@linux.vnet.ibm.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-10-28internal/cpu: replace arch dependent with generic minimal feature testMartin Möhrmann
Use information about required CPU features stored in the CPU feature options slice to test if minimal CPU requirements are met instead of hard coding this information in the tests directly. Change-Id: I72d89b1cff305b8e751995d4230a2217e32f4236 Reviewed-on: https://go-review.googlesource.com/c/145118 Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Martin Möhrmann <martisch@uos.de> TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-10-24internal/cpu: add options and warnings for required cpu featuresMartin Möhrmann
Updates #27218 Change-Id: I8603f3a639cdd9ee201c4f1566692e5b88877fc4 Reviewed-on: https://go-review.googlesource.com/c/144107 Run-TryBot: Martin Möhrmann <martisch@uos.de> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-10-15internal/cpu: add invalid option warnings and support to enable cpu featuresMartin Möhrmann
This CL adds the ability to enable the cpu feature FEATURE by specifying FEATURE=on in GODEBUGCPU. Syntax support to enable cpu features is useful in combination with a preceeding all=off to disable all but some specific cpu features. Example: GODEBUGCPU=all=off,sse3=on This CL implements printing of warnings for invalid GODEBUGCPU settings: - requests enabling features that are not supported with the current CPU - specifying values different than 'on' or 'off' for a feature - settings for unkown cpu feature names Updates #27218 Change-Id: Ic13e5c4c35426a390c50eaa4bd2a408ef2ee21be Reviewed-on: https://go-review.googlesource.com/c/141800 Run-TryBot: Martin Möhrmann <moehrmann@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
2018-08-24internal/cpu: add a CacheLinePadSize constantMartin Möhrmann
The new constant CacheLinePadSize can be used to compute best effort alignment of structs to cache lines. e.g. the runtime can use this in the locktab definition: var locktab [57]struct { l spinlock pad [cpu.CacheLinePadSize - unsafe.Sizeof(spinlock{})]byte } Change-Id: I86f6fbfc5ee7436f742776a7d4a99a1d54ffccc8 Reviewed-on: https://go-review.googlesource.com/131237 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-08-21runtime: don't use linkname to refer to internal/cpuIan Lance Taylor
The runtime package already imports the internal/cpu package, so there is no reason for it to use go:linkname comments to refer to internal/cpu functions and variables. Since internal/cpu is internal, we can just export those names. Removing the obscurity of go:linkname outweighs the minor additional complexity added to the internal/cpu API. Change-Id: Id89951b7f3fc67cd9bce67ac6d01d44a647a10ad Reviewed-on: https://go-review.googlesource.com/128755 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Martin Möhrmann <moehrmann@google.com>
2018-05-22internal/cpu: add experiment to disable CPU features with GODEBUGCPUMartin Möhrmann
Needs the go compiler to be build with GOEXPERIMENT=debugcpu to be active. The GODEBUGCPU environment variable can be used to disable usage of specific processor features in the Go standard library. This is useful for testing and benchmarking different code paths that are guarded by internal/cpu variable checks. Use of processor features can not be enabled through GODEBUGCPU. To disable usage of AVX and SSE41 cpu features on GOARCH amd64 use: GODEBUGCPU=avx=0,sse41=0 The special "all" option can be used to disable all options: GODEBUGCPU=all=0 Updates #12805 Updates #15403 Change-Id: I699c2e6f74d98472b6fb4b1e5ffbf29b15697aab Reviewed-on: https://go-review.googlesource.com/91737 Run-TryBot: Martin Möhrmann <moehrmann@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-05-01internal/cpu: remove platform specific prefix from cpu hwcap variablesMartin Möhrmann
Go runtime currently only populates hwcap for ppc64 and arm64. While the interpretation of hwcap is platform specific the hwcap information is generally available on linux. Changing the runtime variable name to cpu_hwcap for cpu.hwcap makes it consistent with the general naming of runtime variables that are linked to other packages. Change-Id: I1e1f932a73ed624a219b9298faafbb6355e47ada Reviewed-on: https://go-review.googlesource.com/94757 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Martin Möhrmann <moehrmann@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-08-14runtime, internal/cpu: CPU capabilities detection for ppc64xCarlos Eduardo Seo
This change replaces the current runtime capabilities check for ppc64x with the new internal/cpu package. It also adds support for the new POWER9 ISA and capabilities. Updates #15403 Change-Id: I5b64a79e782f8da3603e5529600434f602986292 Reviewed-on: https://go-review.googlesource.com/53830 Reviewed-by: Martin Möhrmann <moehrmann@google.com>