github.com/hxx258456/ccgo@v0.0.5-0.20230213014102-48b35f46f66f/internal/cpu/cpu_x86.s (about)

     1  // Copyright 2017 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  //go:build 386 || amd64
     6  // +build 386 amd64
     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