mirror of
https://github.com/golang/go
synced 2024-11-19 13:04:45 -07:00
runtime: use internal/cpu instead of support_avx
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>
This commit is contained in:
parent
51533fdac6
commit
e0ac5f540b
@ -176,11 +176,6 @@ notintel:
|
|||||||
TESTL $(1<<27), DI // OSXSAVE
|
TESTL $(1<<27), DI // OSXSAVE
|
||||||
SETNE runtime·support_osxsave(SB)
|
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:
|
eax7:
|
||||||
// Load EAX=7/ECX=0 cpuid flags
|
// Load EAX=7/ECX=0 cpuid flags
|
||||||
CMPL SI, $7
|
CMPL SI, $7
|
||||||
@ -211,7 +206,6 @@ osavx:
|
|||||||
JE nocpuinfo
|
JE nocpuinfo
|
||||||
#endif
|
#endif
|
||||||
noavx:
|
noavx:
|
||||||
MOVB $0, runtime·support_avx(SB)
|
|
||||||
MOVB $0, runtime·support_avx2(SB)
|
MOVB $0, runtime·support_avx2(SB)
|
||||||
|
|
||||||
nocpuinfo:
|
nocpuinfo:
|
||||||
|
@ -139,11 +139,6 @@ notintel:
|
|||||||
TESTL $(1<<27), CX // OSXSAVE
|
TESTL $(1<<27), CX // OSXSAVE
|
||||||
SETNE runtime·support_osxsave(SB)
|
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:
|
eax7:
|
||||||
// Load EAX=7/ECX=0 cpuid flags
|
// Load EAX=7/ECX=0 cpuid flags
|
||||||
CMPL SI, $7
|
CMPL SI, $7
|
||||||
@ -170,7 +165,6 @@ osavx:
|
|||||||
CMPL AX, $6 // Check for OS support of XMM and YMM registers.
|
CMPL AX, $6 // Check for OS support of XMM and YMM registers.
|
||||||
JE nocpuinfo
|
JE nocpuinfo
|
||||||
noavx:
|
noavx:
|
||||||
MOVB $0, runtime·support_avx(SB)
|
|
||||||
MOVB $0, runtime·support_avx2(SB)
|
MOVB $0, runtime·support_avx2(SB)
|
||||||
|
|
||||||
nocpuinfo:
|
nocpuinfo:
|
||||||
|
@ -59,11 +59,6 @@ notintel:
|
|||||||
TESTL $(1<<27), CX // OSXSAVE
|
TESTL $(1<<27), CX // OSXSAVE
|
||||||
SETNE runtime·support_osxsave(SB)
|
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:
|
eax7:
|
||||||
// Load EAX=7/ECX=0 cpuid flags
|
// Load EAX=7/ECX=0 cpuid flags
|
||||||
CMPL SI, $7
|
CMPL SI, $7
|
||||||
@ -94,7 +89,6 @@ osavx:
|
|||||||
JE nocpuinfo
|
JE nocpuinfo
|
||||||
#endif
|
#endif
|
||||||
noavx:
|
noavx:
|
||||||
MOVB $0, runtime·support_avx(SB)
|
|
||||||
MOVB $0, runtime·support_avx2(SB)
|
MOVB $0, runtime·support_avx2(SB)
|
||||||
|
|
||||||
nocpuinfo:
|
nocpuinfo:
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
package runtime
|
package runtime
|
||||||
|
|
||||||
|
import "internal/cpu"
|
||||||
|
|
||||||
var useAVXmemmove bool
|
var useAVXmemmove bool
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -16,5 +18,5 @@ func init() {
|
|||||||
processor == 0x306A0 ||
|
processor == 0x306A0 ||
|
||||||
processor == 0x306E0
|
processor == 0x306E0
|
||||||
|
|
||||||
useAVXmemmove = support_avx && !isIntelBridgeFamily
|
useAVXmemmove = cpu.X86.HasAVX && !isIntelBridgeFamily
|
||||||
}
|
}
|
||||||
|
@ -771,7 +771,6 @@ var (
|
|||||||
processorVersionInfo uint32
|
processorVersionInfo uint32
|
||||||
isIntel bool
|
isIntel bool
|
||||||
lfenceBeforeRdtsc bool
|
lfenceBeforeRdtsc bool
|
||||||
support_avx bool
|
|
||||||
support_avx2 bool
|
support_avx2 bool
|
||||||
support_erms bool
|
support_erms bool
|
||||||
support_osxsave bool
|
support_osxsave bool
|
||||||
|
Loading…
Reference in New Issue
Block a user