aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/alg.go
diff options
context:
space:
mode:
authorMartin Möhrmann <moehrmann@google.com>2017-04-27 08:30:27 +0200
committerMartin Möhrmann <moehrmann@google.com>2017-05-01 20:46:03 +0000
commit5a6c58099085a8156bc42b68a7cf51b5b9c72802 (patch)
tree245a4db2af872b465cfb8e6220c4b8ae26996466 /src/runtime/alg.go
parent1f85d3ad09152e09d5f4e9b6d9dcec72dbb4ad9b (diff)
downloadgo-5a6c58099085a8156bc42b68a7cf51b5b9c72802.tar.gz
go-5a6c58099085a8156bc42b68a7cf51b5b9c72802.zip
runtime: refactor cpu feature detection for 386 & amd64
Changes all cpu features to be detected and stored in bools in rt0_go. Updates: #15403 Change-Id: I5a9961cdec789b331d09c44d86beb53833d5dc3e Reviewed-on: https://go-review.googlesource.com/41950 Run-TryBot: Martin Möhrmann <moehrmann@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ilya Tocar <ilya.tocar@intel.com> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/runtime/alg.go')
-rw-r--r--src/runtime/alg.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/alg.go b/src/runtime/alg.go
index 504be61cd0..8d388da5a2 100644
--- a/src/runtime/alg.go
+++ b/src/runtime/alg.go
@@ -283,9 +283,9 @@ func alginit() {
// Install aes hash algorithm if we have the instructions we need
if (GOARCH == "386" || GOARCH == "amd64") &&
GOOS != "nacl" &&
- cpuid_ecx&(1<<25) != 0 && // aes (aesenc)
- cpuid_ecx&(1<<9) != 0 && // sse3 (pshufb)
- cpuid_ecx&(1<<19) != 0 { // sse4.1 (pinsr{d,q})
+ support_aes && // AESENC
+ support_ssse3 && // PSHUFB
+ support_sse41 { // PINSR{D,Q}
useAeshash = true
algarray[alg_MEM32].hash = aeshash32
algarray[alg_MEM64].hash = aeshash64