shithub: bench9

ref: bbdcad5c85ca1a0daa21bf1f8f70ea9394cb7a02
dir: /b_amd64.s/

View raw version
TEXT _tstart(SB), 1, $0
	CPUID
	RDTSC
	MOVL AX, 0(RARG)
	MOVL DX, 4(RARG)
	RET

TEXT _tend(SB), 1, $0
	CPUID
	RDTSC
	MOVL AX, 0(RARG)
	MOVL DX, 4(RARG)
	RET

TEXT _tstartp(SB), 1, $0
	CPUID
	WORD $0x010f; BYTE $0xf9 // RDTSCP
	MOVL AX, 0(RARG)
	MOVL DX, 4(RARG)
	RET

TEXT _tendp(SB), 1, $0
	WORD $0x010f; BYTE $0xf9 // RDTSCP
	MOVL AX, 0(RARG)
	MOVL DX, 4(RARG)
	CPUID
	RET

TEXT cpuid(SB), 1, $0
	MOVL ax+8(FP), AX
	MOVL cx+16(FP), CX
	CPUID
	MOVL AX, 0(BP)
	MOVL BX, 4(BP)
	MOVL CX, 8(BP)
	MOVL DX, 12(BP)
	RET