]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: use internal/cpu instead of support_avx
authorTobias Klauser <tklauser@distanz.ch>
Wed, 11 Apr 2018 07:57:18 +0000 (09:57 +0200)
committerTobias Klauser <tobias.klauser@gmail.com>
Wed, 11 Apr 2018 13:50:04 +0000 (13:50 +0000)
After CL 104636 cpu.X86.HasAVX is set early enough that it can be used
to determine useAVXmemmove. Use it and remove support_avx.

Change-Id: Ib7a627bede2bf96c92362507e742bd833cb42a74
Reviewed-on: https://go-review.googlesource.com/106235
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/runtime/asm_386.s
src/runtime/asm_amd64.s
src/runtime/asm_amd64p32.s
src/runtime/cpuflags_amd64.go
src/runtime/runtime2.go

index 4ba1d5b278f0dc5a29499e76c3c9512488659bfc..e68f727076bb5d2a6d581604e685d6e8a4b92865 100644 (file)
@@ -176,11 +176,6 @@ notintel:
        TESTL   $(1<<27), DI // OSXSAVE
        SETNE   runtime·support_osxsave(SB)
 
-       // If OS support for XMM and YMM is not present
-       // support_avx will be set back to false later.
-       TESTL   $(1<<28), DI // AVX
-       SETNE   runtime·support_avx(SB)
-
 eax7:
        // Load EAX=7/ECX=0 cpuid flags
        CMPL    SI, $7
@@ -211,7 +206,6 @@ osavx:
        JE nocpuinfo
 #endif
 noavx:
-       MOVB $0, runtime·support_avx(SB)
        MOVB $0, runtime·support_avx2(SB)
 
 nocpuinfo:
index a8357f0e9741e29784105758aa50937053ea7be6..23b25bb9a4a0af210a7cba6a1e79ce53c04a0bcc 100644 (file)
@@ -139,11 +139,6 @@ notintel:
        TESTL   $(1<<27), CX // OSXSAVE
        SETNE   runtime·support_osxsave(SB)
 
-       // If OS support for XMM and YMM is not present
-       // support_avx will be set back to false later.
-       TESTL   $(1<<28), CX // AVX
-       SETNE   runtime·support_avx(SB)
-
 eax7:
        // Load EAX=7/ECX=0 cpuid flags
        CMPL    SI, $7
@@ -170,7 +165,6 @@ osavx:
        CMPL    AX, $6 // Check for OS support of XMM and YMM registers.
        JE nocpuinfo
 noavx:
-       MOVB $0, runtime·support_avx(SB)
        MOVB $0, runtime·support_avx2(SB)
 
 nocpuinfo:
index e58e5ec90f8ac74c83aa1a84b2e329c6b08909a9..63bf2b07a0c38cc372e9729b4f60c73299bf676d 100644 (file)
@@ -59,11 +59,6 @@ notintel:
        TESTL   $(1<<27), CX // OSXSAVE
        SETNE   runtime·support_osxsave(SB)
 
-       // If OS support for XMM and YMM is not present
-       // support_avx will be set back to false later.
-       TESTL   $(1<<28), CX // AVX
-       SETNE   runtime·support_avx(SB)
-
 eax7:
        // Load EAX=7/ECX=0 cpuid flags
        CMPL    SI, $7
@@ -94,7 +89,6 @@ osavx:
        JE nocpuinfo
 #endif
 noavx:
-       MOVB $0, runtime·support_avx(SB)
        MOVB $0, runtime·support_avx2(SB)
 
 nocpuinfo:
index 3e408dae5f1a5d4bfba4cd7f81b966eb29992e7e..9d2d4fcbe2c835f0542ae715de1302c08a02bffd 100644 (file)
@@ -4,6 +4,8 @@
 
 package runtime
 
+import "internal/cpu"
+
 var useAVXmemmove bool
 
 func init() {
@@ -16,5 +18,5 @@ func init() {
                processor == 0x306A0 ||
                processor == 0x306E0
 
-       useAVXmemmove = support_avx && !isIntelBridgeFamily
+       useAVXmemmove = cpu.X86.HasAVX && !isIntelBridgeFamily
 }
index 22ba375a932ae56892eabf0ca57f2feeb021f37e..516d3473ce6d94e46cd975828ff159eb687a0678 100644 (file)
@@ -771,7 +771,6 @@ var (
        processorVersionInfo uint32
        isIntel              bool
        lfenceBeforeRdtsc    bool
-       support_avx          bool
        support_avx2         bool
        support_erms         bool
        support_osxsave      bool