aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorisharipo <iskander.sharipov@intel.com>2017-08-18 13:33:00 +0300
committerIlya Tocar <ilya.tocar@intel.com>2017-09-06 15:37:00 +0000
commit4074e4e5be5988a0c168eeba6417e7aceac7d9a5 (patch)
tree863ca99229b3b79fb80a108dc21db2df471ec5cc /src
parent26dadbe32ce5b9d705ef38279e1f85fbbdf58287 (diff)
downloadgo-4074e4e5be5988a0c168eeba6417e7aceac7d9a5.tar.xz
cmd/asm: add amd64 CLFLUSH instruction
This is the last instruction I found missing in SSE2 set. It does not reuse 'yprefetch' ytabs due to differences in operands SRC/DST roles: - PREFETCHx: ModRM:r/m(r) -> FROM - CLFLUSH: ModRM:r/m(w) -> TO unaryDst map is extended accordingly. Change-Id: I89e34ebb81cc0ee5f9ebbb1301bad417f7ee437f Reviewed-on: https://go-review.googlesource.com/56833 Run-TryBot: Ilya Tocar <ilya.tocar@intel.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ilya Tocar <ilya.tocar@intel.com> Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/asm/internal/asm/testdata/amd64enc.s4
-rw-r--r--src/cmd/internal/obj/x86/a.out.go1
-rw-r--r--src/cmd/internal/obj/x86/anames.go1
-rw-r--r--src/cmd/internal/obj/x86/asm6.go5
-rw-r--r--src/cmd/internal/obj/x86/obj6.go1
5 files changed, 10 insertions, 2 deletions
diff --git a/src/cmd/asm/internal/asm/testdata/amd64enc.s b/src/cmd/asm/internal/asm/testdata/amd64enc.s
index 534854f845..ed80f6f92e 100644
--- a/src/cmd/asm/internal/asm/testdata/amd64enc.s
+++ b/src/cmd/asm/internal/asm/testdata/amd64enc.s
@@ -771,8 +771,8 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
//TODO: CLAC // 0f01ca
CLC // f8
CLD // fc
- //TODO: CLFLUSH (BX) // 0fae3b
- //TODO: CLFLUSH (R11) // 410fae3b
+ CLFLUSH (BX) // 0fae3b
+ CLFLUSH (R11) // 410fae3b
//TODO: CLFLUSHOPT (BX) // 660fae3b
//TODO: CLFLUSHOPT (R11) // 66410fae3b
CLI // fa
diff --git a/src/cmd/internal/obj/x86/a.out.go b/src/cmd/internal/obj/x86/a.out.go
index 36e715933f..778bdc6383 100644
--- a/src/cmd/internal/obj/x86/a.out.go
+++ b/src/cmd/internal/obj/x86/a.out.go
@@ -76,6 +76,7 @@ const (
ABYTE
ACLC
ACLD
+ ACLFLUSH
ACLI
ACLTS
ACMC
diff --git a/src/cmd/internal/obj/x86/anames.go b/src/cmd/internal/obj/x86/anames.go
index 8499e93b84..45b39aa552 100644
--- a/src/cmd/internal/obj/x86/anames.go
+++ b/src/cmd/internal/obj/x86/anames.go
@@ -38,6 +38,7 @@ var Anames = []string{
"BYTE",
"CLC",
"CLD",
+ "CLFLUSH",
"CLI",
"CLTS",
"CMC",
diff --git a/src/cmd/internal/obj/x86/asm6.go b/src/cmd/internal/obj/x86/asm6.go
index 48b96cd7c9..16e58ad94d 100644
--- a/src/cmd/internal/obj/x86/asm6.go
+++ b/src/cmd/internal/obj/x86/asm6.go
@@ -551,6 +551,10 @@ var ypopl = []ytab{
{Ynone, Ynone, Ym, Zo_m, 2},
}
+var yclflush = []ytab{
+ {Ynone, Ynone, Ym, Zo_m, 2},
+}
+
var ybswap = []ytab{
{Ynone, Ynone, Yrl, Z_rp, 2},
}
@@ -994,6 +998,7 @@ var optab =
{ACDQ, ynone, Px, [23]uint8{0x99}},
{ACLC, ynone, Px, [23]uint8{0xf8}},
{ACLD, ynone, Px, [23]uint8{0xfc}},
+ {ACLFLUSH, yclflush, Pm, [23]uint8{0xae, 07}},
{ACLI, ynone, Px, [23]uint8{0xfa}},
{ACLTS, ynone, Pm, [23]uint8{0x06}},
{ACMC, ynone, Px, [23]uint8{0xf5}},
diff --git a/src/cmd/internal/obj/x86/obj6.go b/src/cmd/internal/obj/x86/obj6.go
index 52fbaa0156..38aeb4a59d 100644
--- a/src/cmd/internal/obj/x86/obj6.go
+++ b/src/cmd/internal/obj/x86/obj6.go
@@ -1183,6 +1183,7 @@ func stacksplit(ctxt *obj.Link, cursym *obj.LSym, p *obj.Prog, newprog obj.ProgA
var unaryDst = map[obj.As]bool{
ABSWAPL: true,
ABSWAPQ: true,
+ ACLFLUSH: true,
ACMPXCHG8B: true,
ADECB: true,
ADECL: true,