Tobias Klauser
b4e8571b14
cpu: fix build for GOARCH=ppc64{,le} on GOOS!=linux
...
The current implementation for ppc64{,le} only supports linux (through
HWCaps read from /proc/self/auxv) and fails to build e.g. on
aix/ppc64.
Change-Id: I5e1efe75c781fd08bc7bbe797df88295726ba62b
Reviewed-on: https://go-review.googlesource.com/c/162798
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2019-02-21 07:52:27 +00:00
Michael Munday
153ac47618
cpu: unexport HWCap and HWCap2
...
These are an implementation detail and should not have been
exported. This only affects Linux on platforms other than 386 and
amd64.
Fixes golang/go#30255 .
Change-Id: Ib23b42a7309fd6093b6b9d8b6628de222a3928be
Reviewed-on: https://go-review.googlesource.com/c/163004
Run-TryBot: Michael Munday <mike.munday@ibm.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2019-02-19 09:28:55 +00:00
Michael Munday
d0b11bdaac
cpu: fix auxval parsing on big-endian systems
...
The words in auxval are encoded in native byte order.
I haven't added a test. This fix will be tested when s390x support
is added to the package.
Change-Id: I276f833660e6906c319995798faf9054ffc69461
Reviewed-on: https://go-review.googlesource.com/c/162902
Run-TryBot: Michael Munday <mike.munday@ibm.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2019-02-15 14:29:49 +00:00
Tobias Klauser
e77772198c
cpu: fix build for GOARCH=arm64 on GOOS!=linux
...
The current implementation for arm64 only supports linux (through HWCaps
read from /proc/self/auxv) and fails to build e.g. on darwin/arm64.
Fixes golang/go#30237
Change-Id: I9f32a285760795441a829b0a81b2d5aff04e2dc4
Reviewed-on: https://go-review.googlesource.com/c/162797
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
TryBot-Result: Gobot Gobot <gobot@golang.org >
2019-02-14 21:44:11 +00:00
Tobias Klauser
2970a3744d
cpu: detect RDRAND and RDSEED instructions on x86
...
Change-Id: I2d0094d64ba12f888758aeebdb43aed353ddeeb9
Reviewed-on: https://go-review.googlesource.com/c/160577
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
Reviewed-by: Ian Lance Taylor <iant@golang.org >
2019-02-01 07:34:06 +00:00
Carlos Eduardo Seo
20be8e55dc
cpu: add linux/ppc64x
...
Port from Go internal/cpu.
Fixes golang/go#25185
Change-Id: Id3cac18da6ffec9d10df755c4032ce3068ab634d
Reviewed-on: https://go-review.googlesource.com/c/152938
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2019-01-07 17:34:14 +00:00
Meng Zhuo
70b957f3b6
cpu: add linux/arm64
...
Port from Go internal/cpu
Updates golang/go#25185
Change-Id: I8390980e38b61f6c428fafa0665a03952e7b00bb
Reviewed-on: https://go-review.googlesource.com/c/150718
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
Reviewed-by: Martin Möhrmann <moehrmann@google.com >
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com >
2018-12-06 07:42:57 +00:00
Ian Lance Taylor
9527bec266
cpu: fix gccgo build
...
Current versions of gccgo report a redefinition error for both a
declaration and definition, as of https://golang.org/cl/93083 .
Fix the last change to work with this.
Change-Id: Iae6a664fcc9fe97d4e3b7845a05dab3a8ad56830
Reviewed-on: https://go-review.googlesource.com/116776
Run-TryBot: Ian Lance Taylor <iant@golang.org >
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
TryBot-Result: Gobot Gobot <gobot@golang.org >
2018-06-06 20:27:47 +00:00
Alex Vaghin
bc2ef10f1b
cpu: add gccgo implementation
...
It uses __get_cpuid_count, provided by cpuid.h.
The xgetbv is implemented after its counterpart in cpu_x86.s.
Change-Id: I97624d7da67ab4ec3c9a53b0bfc4dfcdf7d12c87
Reviewed-on: https://go-review.googlesource.com/116155
Reviewed-by: Ian Lance Taylor <iant@golang.org >
Run-TryBot: Ian Lance Taylor <iant@golang.org >
TryBot-Result: Gobot Gobot <gobot@golang.org >
2018-06-06 16:53:29 +00:00
Tobias Klauser
538ab54ba9
cpu: introduce and export type CacheLinePad
...
Add a CacheLinePad struct type that has a size of cacheLineSize.
This can be used for padding structs in order to avoid false sharing.
Fixes golang/go#25203
Change-Id: I6b6daf91ea0e9c50428ffa053035429c3921b461
Reviewed-on: https://go-review.googlesource.com/111775
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2018-06-06 11:15:58 +00:00
Tobias Klauser
7db1c3b1a9
cpu: use t.Fatal instead of t.Fatalf
...
The messages contain no format string, so there is no need to use
t.Fatalf.
Change-Id: I29098c04797f919784b732af84a63fbaed671558
Reviewed-on: https://go-review.googlesource.com/111776
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com >
TryBot-Result: Gobot Gobot <gobot@golang.org >
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2018-05-07 13:57:25 +00:00
Andreas Auernhammer
4adea008a5
cpu: new package
...
This CL introduces a new cpu package for CPU/platform feature detection.
The cpu package is basically a copy of `internal/cpu` of the standard library.
Revision: bf86aec25972f3a100c3aa58a6abcbcc35bdea49
This CL does not export ARM64 and PPC64 feature detection since at the moment
ARM64/PPC64 requires standard library support.
Updates golang/go#24843
Change-Id: I11bc1ca60b116e902c941b5887c00870dbb1f899
Reviewed-on: https://go-review.googlesource.com/107015
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
2018-04-30 17:35:09 +00:00