From 75798e8ada7fcb286f633618ac2f55ad5240ed97 Mon Sep 17 00:00:00 2001 From: Martin Möhrmann Date: Tue, 6 Nov 2018 17:00:04 +0100 Subject: runtime: make processor capability variable naming platform specific MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- src/runtime/cpuflags.go | 9 +++++++++ src/runtime/proc.go | 6 +++--- src/runtime/runtime2.go | 6 ------ 3 files changed, 12 insertions(+), 9 deletions(-) (limited to 'src/runtime') 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 ) -- cgit v1.3-5-g9baa