mirror of
https://github.com/golang/go
synced 2024-11-25 00:07:56 -07:00
8a, 8l: implement support for RDTSC instruction.
Also modify runtime/asm_386.s to use it. R=rsc CC=golang-dev https://golang.org/cl/5634043
This commit is contained in:
parent
7ac03695f8
commit
6392b43a15
@ -445,6 +445,7 @@ struct
|
|||||||
"RCRB", LTYPE3, ARCRB,
|
"RCRB", LTYPE3, ARCRB,
|
||||||
"RCRL", LTYPE3, ARCRL,
|
"RCRL", LTYPE3, ARCRL,
|
||||||
"RCRW", LTYPE3, ARCRW,
|
"RCRW", LTYPE3, ARCRW,
|
||||||
|
"RDTSC", LTYPE0, ARDTSC,
|
||||||
"REP", LTYPE0, AREP,
|
"REP", LTYPE0, AREP,
|
||||||
"REPN", LTYPE0, AREPN,
|
"REPN", LTYPE0, AREPN,
|
||||||
"RET", LTYPE0, ARET,
|
"RET", LTYPE0, ARET,
|
||||||
|
@ -395,7 +395,9 @@ enum as
|
|||||||
ACMPXCHGL,
|
ACMPXCHGL,
|
||||||
ACMPXCHGW,
|
ACMPXCHGW,
|
||||||
ACMPXCHG8B,
|
ACMPXCHG8B,
|
||||||
|
|
||||||
|
ARDTSC,
|
||||||
|
|
||||||
AXADDB,
|
AXADDB,
|
||||||
AXADDL,
|
AXADDL,
|
||||||
AXADDW,
|
AXADDW,
|
||||||
|
@ -707,6 +707,8 @@ Optab optab[] =
|
|||||||
{ ACMPXCHGW, yrl_ml, Pm, 0xb1 },
|
{ ACMPXCHGW, yrl_ml, Pm, 0xb1 },
|
||||||
{ ACMPXCHG8B, yscond, Pm, 0xc7,(01) },
|
{ ACMPXCHG8B, yscond, Pm, 0xc7,(01) },
|
||||||
|
|
||||||
|
{ ARDTSC, ynone, Pm, 0x31 },
|
||||||
|
|
||||||
{ AXADDB, yrb_mb, Pb, 0x0f,0xc0 },
|
{ AXADDB, yrb_mb, Pb, 0x0f,0xc0 },
|
||||||
{ AXADDL, yrl_ml, Pm, 0xc1 },
|
{ AXADDL, yrl_ml, Pm, 0xc1 },
|
||||||
{ AXADDW, yrl_ml, Pe, 0x0f,0xc1 },
|
{ AXADDW, yrl_ml, Pe, 0x0f,0xc1 },
|
||||||
|
@ -527,7 +527,7 @@ TEXT runtime·getcallersp(SB), 7, $0
|
|||||||
// int64 runtime·cputicks(void), so really
|
// int64 runtime·cputicks(void), so really
|
||||||
// void runtime·cputicks(int64 *ticks)
|
// void runtime·cputicks(int64 *ticks)
|
||||||
TEXT runtime·cputicks(SB),7,$0
|
TEXT runtime·cputicks(SB),7,$0
|
||||||
BYTE $0x0F; BYTE $0x31; // RDTSC; not supported by 8a
|
RDTSC
|
||||||
MOVL ret+0(FP), DI
|
MOVL ret+0(FP), DI
|
||||||
MOVL AX, 0(DI)
|
MOVL AX, 0(DI)
|
||||||
MOVL DX, 4(DI)
|
MOVL DX, 4(DI)
|
||||||
|
Loading…
Reference in New Issue
Block a user