Commit fc444eba authored by Evan Shaw's avatar Evan Shaw Committed by Russ Cox

8a, 8l: add EMMS instruction

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5673081
parent a2bdb5c0
...@@ -666,6 +666,7 @@ struct ...@@ -666,6 +666,7 @@ struct
"LFENCE", LTYPE0, ALFENCE, "LFENCE", LTYPE0, ALFENCE,
"MFENCE", LTYPE0, AMFENCE, "MFENCE", LTYPE0, AMFENCE,
"SFENCE", LTYPE0, ASFENCE, "SFENCE", LTYPE0, ASFENCE,
"EMMS", LTYPE0, AEMMS,
0 0
}; };
......
...@@ -449,6 +449,8 @@ enum as ...@@ -449,6 +449,8 @@ enum as
AMFENCE, AMFENCE,
ASFENCE, ASFENCE,
AEMMS,
ALAST ALAST
}; };
......
...@@ -759,5 +759,7 @@ Optab optab[] = ...@@ -759,5 +759,7 @@ Optab optab[] =
{ AMFENCE, ynone, Pm, 0xae,0xf0 }, { AMFENCE, ynone, Pm, 0xae,0xf0 },
{ ASFENCE, ynone, Pm, 0xae,0xf8 }, { ASFENCE, ynone, Pm, 0xae,0xf8 },
{ AEMMS, ynone, Pm, 0x77 },
0 0
}; };
...@@ -688,6 +688,7 @@ static Optable optab0F[256]= ...@@ -688,6 +688,7 @@ static Optable optab0F[256]=
[0x74] = { RM,0, "PCMPEQB %m,%M" }, [0x74] = { RM,0, "PCMPEQB %m,%M" },
[0x75] = { RM,0, "PCMPEQW %m,%M" }, [0x75] = { RM,0, "PCMPEQW %m,%M" },
[0x76] = { RM,0, "PCMPEQL %m,%M" }, [0x76] = { RM,0, "PCMPEQL %m,%M" },
[0x77] = { 0,0, "EMMS" },
[0x7E] = { RM,0, "MOV%S %M,%e" }, [0x7E] = { RM,0, "MOV%S %M,%e" },
[0x7F] = { RM,0, "MOVQ %M,%m" }, [0x7F] = { RM,0, "MOVQ %M,%m" },
[0xAE] = { RMOP,0, optab0FAE }, [0xAE] = { RMOP,0, optab0FAE },
......
...@@ -108,8 +108,7 @@ TEXT ·LoadUint64(SB),7,$0 ...@@ -108,8 +108,7 @@ TEXT ·LoadUint64(SB),7,$0
BYTE $0x0f; BYTE $0x6f; BYTE $0x00 BYTE $0x0f; BYTE $0x6f; BYTE $0x00
// MOVQ %MM0, 0x8(%ESP) // MOVQ %MM0, 0x8(%ESP)
BYTE $0x0f; BYTE $0x7f; BYTE $0x44; BYTE $0x24; BYTE $0x08 BYTE $0x0f; BYTE $0x7f; BYTE $0x44; BYTE $0x24; BYTE $0x08
// EMMS EMMS
BYTE $0x0F; BYTE $0x77
RET RET
TEXT ·LoadUintptr(SB),7,$0 TEXT ·LoadUintptr(SB),7,$0
...@@ -137,8 +136,7 @@ TEXT ·StoreUint64(SB),7,$0 ...@@ -137,8 +136,7 @@ TEXT ·StoreUint64(SB),7,$0
BYTE $0x0f; BYTE $0x6f; BYTE $0x44; BYTE $0x24; BYTE $0x08 BYTE $0x0f; BYTE $0x6f; BYTE $0x44; BYTE $0x24; BYTE $0x08
// MOVQ %MM0, (%EAX) // MOVQ %MM0, (%EAX)
BYTE $0x0f; BYTE $0x7f; BYTE $0x00 BYTE $0x0f; BYTE $0x7f; BYTE $0x00
// EMMS EMMS
BYTE $0x0F; BYTE $0x77
// This is essentially a no-op, but it provides required memory fencing. // 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). // It can be replaced with MFENCE, but MFENCE was introduced only on the Pentium4 (SSE2).
XORL AX, AX XORL AX, AX
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment