8a, 8l: add EMMS instruction

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5673081
This commit is contained in:
Evan Shaw 2012-02-17 11:21:46 -05:00 committed by Russ Cox
parent a2bdb5c04f
commit fc444ebac1
5 changed files with 8 additions and 4 deletions

View File

@ -666,6 +666,7 @@ struct
"LFENCE", LTYPE0, ALFENCE,
"MFENCE", LTYPE0, AMFENCE,
"SFENCE", LTYPE0, ASFENCE,
"EMMS", LTYPE0, AEMMS,
0
};

View File

@ -449,6 +449,8 @@ enum as
AMFENCE,
ASFENCE,
AEMMS,
ALAST
};

View File

@ -759,5 +759,7 @@ Optab optab[] =
{ AMFENCE, ynone, Pm, 0xae,0xf0 },
{ ASFENCE, ynone, Pm, 0xae,0xf8 },
{ AEMMS, ynone, Pm, 0x77 },
0
};

View File

@ -688,6 +688,7 @@ static Optable optab0F[256]=
[0x74] = { RM,0, "PCMPEQB %m,%M" },
[0x75] = { RM,0, "PCMPEQW %m,%M" },
[0x76] = { RM,0, "PCMPEQL %m,%M" },
[0x77] = { 0,0, "EMMS" },
[0x7E] = { RM,0, "MOV%S %M,%e" },
[0x7F] = { RM,0, "MOVQ %M,%m" },
[0xAE] = { RMOP,0, optab0FAE },

View File

@ -108,8 +108,7 @@ TEXT ·LoadUint64(SB),7,$0
BYTE $0x0f; BYTE $0x6f; BYTE $0x00
// MOVQ %MM0, 0x8(%ESP)
BYTE $0x0f; BYTE $0x7f; BYTE $0x44; BYTE $0x24; BYTE $0x08
// EMMS
BYTE $0x0F; BYTE $0x77
EMMS
RET
TEXT ·LoadUintptr(SB),7,$0
@ -137,8 +136,7 @@ TEXT ·StoreUint64(SB),7,$0
BYTE $0x0f; BYTE $0x6f; BYTE $0x44; BYTE $0x24; BYTE $0x08
// MOVQ %MM0, (%EAX)
BYTE $0x0f; BYTE $0x7f; BYTE $0x00
// EMMS
BYTE $0x0F; BYTE $0x77
EMMS
// This is essentially a no-op, but it provides required memory fencing.
// It can be replaced with MFENCE, but MFENCE was introduced only on the Pentium4 (SSE2).
XORL AX, AX