cpu_gccgo_x86.go 840 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2018 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. //go:build (386 || amd64 || amd64p32) && gccgo
  5. // +build 386 amd64 amd64p32
  6. // +build gccgo
  7. package cpu
  8. //extern gccgoGetCpuidCount
  9. func gccgoGetCpuidCount(eaxArg, ecxArg uint32, eax, ebx, ecx, edx *uint32)
  10. func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) {
  11. var a, b, c, d uint32
  12. gccgoGetCpuidCount(eaxArg, ecxArg, &a, &b, &c, &d)
  13. return a, b, c, d
  14. }
  15. //extern gccgoXgetbv
  16. func gccgoXgetbv(eax, edx *uint32)
  17. func xgetbv() (eax, edx uint32) {
  18. var a, d uint32
  19. gccgoXgetbv(&a, &d)
  20. return a, d
  21. }
  22. // gccgo doesn't build on Darwin, per:
  23. // https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/gcc.rb#L76
  24. func darwinSupportsAVX512() bool {
  25. return false
  26. }