internal/runtime/cpu_amd64.s
raw| 1 | #include "textflag.h" |
| 2 | |
| 3 | // func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) |
| 4 | TEXT ·cpuid(SB), NOSPLIT, $0-24 |
| 5 | MOVL eaxArg+0(FP), AX |
| 6 | MOVL ecxArg+4(FP), CX |
| 7 | CPUID |
| 8 | MOVL AX, eax+8(FP) |
| 9 | MOVL BX, ebx+12(FP) |
| 10 | MOVL CX, ecx+16(FP) |
| 11 | MOVL DX, edx+20(FP) |
| 12 | RET |
| 13 | |
| 14 | // func xgetbv() (eax, edx uint32) |
| 15 | TEXT ·xgetbv(SB), NOSPLIT, $0-8 |
| 16 | MOVL $0, CX |
| 17 | XGETBV |
| 18 | MOVL AX, eax+0(FP) |
| 19 | MOVL DX, edx+4(FP) |
| 20 | RET |