github.com/egonelbre/exp@v0.0.0-20240430123955-ed1d3aa93911/sync2/runtime2/pid_amd64.s (about) 1 #include "textflag.h" 2 #include "go_asm.h" 3 4 // func rdtscp_pid() int 5 TEXT ·rdtscp_pid(SB), NOSPLIT, $0-8 6 BYTE $0x0F; BYTE $0x01; BYTE $0xF9 // RDTSCP 7 ANDQ $0xff, CX 8 MOVQ CX, ret+0(FP) 9 RET 10 11 // func rdpid_pid() int 12 TEXT ·rdpid_pid(SB), NOSPLIT, $0-8 13 BYTE $0xF3; BYTE $0x0F; BYTE $0xC7; BYTE $0xf8; // RDPID AX 14 MOVL AX, ret+0(FP) 15 RET 16 17 // func cpuid_pid() int 18 TEXT ·cpuid_pid(SB), NOSPLIT, $0-8 19 MOVL $0xB, AX 20 CPUID // .0BH:EDX[31:0] 21 MOVL BX, AX 22 RET