cpu_x86.s 642 B

12345678910111213141516171819202122232425262728
  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) && gc
  5. // +build 386 amd64 amd64p32
  6. // +build gc
  7. #include "textflag.h"
  8. // func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32)
  9. TEXT ·cpuid(SB), NOSPLIT, $0-24
  10. MOVL eaxArg+0(FP), AX
  11. MOVL ecxArg+4(FP), CX
  12. CPUID
  13. MOVL AX, eax+8(FP)
  14. MOVL BX, ebx+12(FP)
  15. MOVL CX, ecx+16(FP)
  16. MOVL DX, edx+20(FP)
  17. RET
  18. // func xgetbv() (eax, edx uint32)
  19. TEXT ·xgetbv(SB),NOSPLIT,$0-8
  20. MOVL $0, CX
  21. XGETBV
  22. MOVL AX, eax+0(FP)
  23. MOVL DX, edx+4(FP)
  24. RET