diff options
| author | Martin Möhrmann <moehrmann@google.com> | 2018-11-06 17:00:04 +0100 |
|---|---|---|
| committer | Martin Möhrmann <martisch@uos.de> | 2018-11-14 20:30:31 +0000 |
| commit | 75798e8ada7fcb286f633618ac2f55ad5240ed97 (patch) | |
| tree | 4e3b17182231c1adb49672527654ffe560473764 /src/runtime | |
| parent | 529ea7c0de1f9e582280c73031ae870f868e7908 (diff) | |
| download | go-75798e8ada7fcb286f633618ac2f55ad5240ed97.tar.xz | |
runtime: make processor capability variable naming platform specific
The current support_XXX variables are specific for the
amd64 and 386 platforms.
Prefix processor capability variables by architecture to have a
consistent naming scheme and avoid reuse of the existing
variables for new platforms.
This also aligns naming of runtime variables closer with internal/cpu
processor capability variable names.
Change-Id: I3eabb29a03874678851376185d3a62e73c1aff1d
Reviewed-on: https://go-review.googlesource.com/c/91435
Run-TryBot: Martin Möhrmann <martisch@uos.de>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/runtime')
| -rw-r--r-- | src/runtime/cpuflags.go | 9 | ||||
| -rw-r--r-- | src/runtime/proc.go | 6 | ||||
| -rw-r--r-- | src/runtime/runtime2.go | 6 |
3 files changed, 12 insertions, 9 deletions
diff --git a/src/runtime/cpuflags.go b/src/runtime/cpuflags.go index b65523766a..1565afb93a 100644 --- a/src/runtime/cpuflags.go +++ b/src/runtime/cpuflags.go @@ -17,3 +17,12 @@ const ( offsetARMHasIDIVA = unsafe.Offsetof(cpu.ARM.HasIDIVA) ) + +var ( + // Set in runtime.cpuinit. + // TODO: deprecate these; use internal/cpu directly. + x86HasPOPCNT bool + x86HasSSE41 bool + + arm64HasATOMICS bool +) diff --git a/src/runtime/proc.go b/src/runtime/proc.go index 837fa93bfa..41ac75d3dd 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -509,10 +509,10 @@ func cpuinit() { // Support cpu feature variables are used in code generated by the compiler // to guard execution of instructions that can not be assumed to be always supported. - support_popcnt = cpu.X86.HasPOPCNT - support_sse41 = cpu.X86.HasSSE41 + x86HasPOPCNT = cpu.X86.HasPOPCNT + x86HasSSE41 = cpu.X86.HasSSE41 - arm64_support_atomics = cpu.ARM64.HasATOMICS + arm64HasATOMICS = cpu.ARM64.HasATOMICS } // The bootstrap sequence is: diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go index 66dd1b19c1..290a7bd311 100644 --- a/src/runtime/runtime2.go +++ b/src/runtime/runtime2.go @@ -858,12 +858,6 @@ var ( isIntel bool lfenceBeforeRdtsc bool - // Set in runtime.cpuinit. - // TODO: deprecate these; use internal/cpu directly. - support_popcnt bool - support_sse41 bool - arm64_support_atomics bool - goarm uint8 // set by cmd/link on arm systems framepointer_enabled bool // set by cmd/link ) |
