github.com/Andyfoo/golang/x/sys@v0.0.0-20190901054642-57c1bf301704/cpu/cpu_x86.s (about) 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 5 // +build 386 amd64 amd64p32 6 // +build !gccgo 7 8 #include "textflag.h" 9 10 // func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) 11 TEXT ·cpuid(SB), NOSPLIT, $0-24 12 MOVL eaxArg+0(FP), AX 13 MOVL ecxArg+4(FP), CX 14 CPUID 15 MOVL AX, eax+8(FP) 16 MOVL BX, ebx+12(FP) 17 MOVL CX, ecx+16(FP) 18 MOVL DX, edx+20(FP) 19 RET 20 21 // func xgetbv() (eax, edx uint32) 22 TEXT ·xgetbv(SB),NOSPLIT,$0-8 23 MOVL $0, CX 24 XGETBV 25 MOVL AX, eax+0(FP) 26 MOVL DX, edx+4(FP) 27 RET