Commit 24494440 authored by Artem Alekseev's avatar Artem Alekseev Committed by Cherry Zhang

cmd/asm: add missing x86 instructions

Instructions added: CLDEMOTE, CLWB, TPAUSE, UMWAIT, UMONITOR.

Change-Id: I1ba550d4d5acc41a2fd97068ff5834e0412d3bcf
Reviewed-on: https://go-review.googlesource.com/c/go/+/183225
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
parent 00ea8e1c
...@@ -1049,5 +1049,11 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0 ...@@ -1049,5 +1049,11 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
VADDPD Z2, Z9, Z21 // 62e1b54858ea VADDPD Z2, Z9, Z21 // 62e1b54858ea
VADDPD Z21, Z2, Z9 // 6231ed4858cd VADDPD Z21, Z2, Z9 // 6231ed4858cd
VADDPD Z9, Z21, Z2 // 62d1d54058d1 VADDPD Z9, Z21, Z2 // 62d1d54058d1
CLWB (BX) // 660fae33
CLDEMOTE (BX) // 0f1c03
TPAUSE BX // 660faef3
UMONITOR BX // f30faef3
UMWAIT BX // f20faef3
// End of tests. // End of tests.
RET RET
...@@ -132,4 +132,12 @@ TEXT errors(SB),$0 ...@@ -132,4 +132,12 @@ TEXT errors(SB),$0
VADDPD.BCST X3, X2, K1, X1 // ERROR "illegal broadcast without memory argument" VADDPD.BCST X3, X2, K1, X1 // ERROR "illegal broadcast without memory argument"
VADDPD.BCST X3, X2, K1, X1 // ERROR "illegal broadcast without memory argument" VADDPD.BCST X3, X2, K1, X1 // ERROR "illegal broadcast without memory argument"
VADDPD.BCST X3, X2, K1, X1 // ERROR "illegal broadcast without memory argument" VADDPD.BCST X3, X2, K1, X1 // ERROR "illegal broadcast without memory argument"
// CLWB instuctions:
CLWB BX // ERROR "invalid instruction"
// CLDEMOTE instructions:
CLDEMOTE BX // ERROR "invalid instruction"
// WAITPKG instructions:
TPAUSE (BX) // ERROR "invalid instruction"
UMONITOR (BX) // ERROR "invalid instruction"
UMWAIT (BX) // ERROR "invalid instruction"
RET RET
...@@ -90,10 +90,12 @@ const ( ...@@ -90,10 +90,12 @@ const (
ACLAC ACLAC
ACLC ACLC
ACLD ACLD
ACLDEMOTE
ACLFLUSH ACLFLUSH
ACLFLUSHOPT ACLFLUSHOPT
ACLI ACLI
ACLTS ACLTS
ACLWB
ACMC ACMC
ACMOVLCC ACMOVLCC
ACMOVLCS ACMOVLCS
...@@ -877,6 +879,7 @@ const ( ...@@ -877,6 +879,7 @@ const (
ATESTL ATESTL
ATESTQ ATESTQ
ATESTW ATESTW
ATPAUSE
ATZCNTL ATZCNTL
ATZCNTQ ATZCNTQ
ATZCNTW ATZCNTW
...@@ -884,10 +887,12 @@ const ( ...@@ -884,10 +887,12 @@ const (
AUCOMISS AUCOMISS
AUD1 AUD1
AUD2 AUD2
AUMWAIT
AUNPCKHPD AUNPCKHPD
AUNPCKHPS AUNPCKHPS
AUNPCKLPD AUNPCKLPD
AUNPCKLPS AUNPCKLPS
AUMONITOR
AV4FMADDPS AV4FMADDPS
AV4FMADDSS AV4FMADDSS
AV4FNMADDPS AV4FNMADDPS
......
...@@ -88,10 +88,12 @@ var Anames = []string{ ...@@ -88,10 +88,12 @@ var Anames = []string{
"CLAC", "CLAC",
"CLC", "CLC",
"CLD", "CLD",
"CLDEMOTE",
"CLFLUSH", "CLFLUSH",
"CLFLUSHOPT", "CLFLUSHOPT",
"CLI", "CLI",
"CLTS", "CLTS",
"CLWB",
"CMC", "CMC",
"CMOVLCC", "CMOVLCC",
"CMOVLCS", "CMOVLCS",
...@@ -875,6 +877,7 @@ var Anames = []string{ ...@@ -875,6 +877,7 @@ var Anames = []string{
"TESTL", "TESTL",
"TESTQ", "TESTQ",
"TESTW", "TESTW",
"TPAUSE",
"TZCNTL", "TZCNTL",
"TZCNTQ", "TZCNTQ",
"TZCNTW", "TZCNTW",
...@@ -882,10 +885,12 @@ var Anames = []string{ ...@@ -882,10 +885,12 @@ var Anames = []string{
"UCOMISS", "UCOMISS",
"UD1", "UD1",
"UD2", "UD2",
"UMWAIT",
"UNPCKHPD", "UNPCKHPD",
"UNPCKHPS", "UNPCKHPS",
"UNPCKLPD", "UNPCKLPD",
"UNPCKLPS", "UNPCKLPS",
"UMONITOR",
"V4FMADDPS", "V4FMADDPS",
"V4FMADDSS", "V4FMADDSS",
"V4FNMADDPS", "V4FNMADDPS",
......
...@@ -983,10 +983,12 @@ var optab = ...@@ -983,10 +983,12 @@ var optab =
{ACLAC, ynone, Pm, opBytes{01, 0xca}}, {ACLAC, ynone, Pm, opBytes{01, 0xca}},
{ACLC, ynone, Px, opBytes{0xf8}}, {ACLC, ynone, Px, opBytes{0xf8}},
{ACLD, ynone, Px, opBytes{0xfc}}, {ACLD, ynone, Px, opBytes{0xfc}},
{ACLDEMOTE, yclflush, Pm, opBytes{0x1c, 00}},
{ACLFLUSH, yclflush, Pm, opBytes{0xae, 07}}, {ACLFLUSH, yclflush, Pm, opBytes{0xae, 07}},
{ACLFLUSHOPT, yclflush, Pq, opBytes{0xae, 07}}, {ACLFLUSHOPT, yclflush, Pq, opBytes{0xae, 07}},
{ACLI, ynone, Px, opBytes{0xfa}}, {ACLI, ynone, Px, opBytes{0xfa}},
{ACLTS, ynone, Pm, opBytes{0x06}}, {ACLTS, ynone, Pm, opBytes{0x06}},
{ACLWB, yclflush, Pq, opBytes{0xae, 06}},
{ACMC, ynone, Px, opBytes{0xf5}}, {ACMC, ynone, Px, opBytes{0xf5}},
{ACMOVLCC, yml_rl, Pm, opBytes{0x43}}, {ACMOVLCC, yml_rl, Pm, opBytes{0x43}},
{ACMOVLCS, yml_rl, Pm, opBytes{0x42}}, {ACMOVLCS, yml_rl, Pm, opBytes{0x42}},
...@@ -1500,6 +1502,7 @@ var optab = ...@@ -1500,6 +1502,7 @@ var optab =
{ATESTL, ytestl, Px, opBytes{0xa9, 0xf7, 00, 0x85, 0x85}}, {ATESTL, ytestl, Px, opBytes{0xa9, 0xf7, 00, 0x85, 0x85}},
{ATESTQ, ytestl, Pw, opBytes{0xa9, 0xf7, 00, 0x85, 0x85}}, {ATESTQ, ytestl, Pw, opBytes{0xa9, 0xf7, 00, 0x85, 0x85}},
{ATESTW, ytestl, Pe, opBytes{0xa9, 0xf7, 00, 0x85, 0x85}}, {ATESTW, ytestl, Pe, opBytes{0xa9, 0xf7, 00, 0x85, 0x85}},
{ATPAUSE, ywrfsbase, Pq, opBytes{0xae, 06}},
{obj.ATEXT, ytext, Px, opBytes{}}, {obj.ATEXT, ytext, Px, opBytes{}},
{AUCOMISD, yxm, Pe, opBytes{0x2e}}, {AUCOMISD, yxm, Pe, opBytes{0x2e}},
{AUCOMISS, yxm, Pm, opBytes{0x2e}}, {AUCOMISS, yxm, Pm, opBytes{0x2e}},
...@@ -1507,6 +1510,7 @@ var optab = ...@@ -1507,6 +1510,7 @@ var optab =
{AUNPCKHPS, yxm, Pm, opBytes{0x15}}, {AUNPCKHPS, yxm, Pm, opBytes{0x15}},
{AUNPCKLPD, yxm, Pe, opBytes{0x14}}, {AUNPCKLPD, yxm, Pe, opBytes{0x14}},
{AUNPCKLPS, yxm, Pm, opBytes{0x14}}, {AUNPCKLPS, yxm, Pm, opBytes{0x14}},
{AUMONITOR, ywrfsbase, Pf3, opBytes{0xae, 06}},
{AVERR, ydivl, Pm, opBytes{0x00, 04}}, {AVERR, ydivl, Pm, opBytes{0x00, 04}},
{AVERW, ydivl, Pm, opBytes{0x00, 05}}, {AVERW, ydivl, Pm, opBytes{0x00, 05}},
{AWAIT, ynone, Px, opBytes{0x9b}}, {AWAIT, ynone, Px, opBytes{0x9b}},
...@@ -1691,11 +1695,11 @@ var optab = ...@@ -1691,11 +1695,11 @@ var optab =
{AMOVDDUP, yxm, Pf2, opBytes{0x12}}, {AMOVDDUP, yxm, Pf2, opBytes{0x12}},
{AMOVSHDUP, yxm, Pf3, opBytes{0x16}}, {AMOVSHDUP, yxm, Pf3, opBytes{0x16}},
{AMOVSLDUP, yxm, Pf3, opBytes{0x12}}, {AMOVSLDUP, yxm, Pf3, opBytes{0x12}},
{ARDTSCP, ynone, Pm, opBytes{0x01, 0xf9, 0}}, {ARDTSCP, ynone, Pm, opBytes{0x01, 0xf9, 0}},
{ASTAC, ynone, Pm, opBytes{0x01, 0xcb, 0}}, {ASTAC, ynone, Pm, opBytes{0x01, 0xcb, 0}},
{AUD1, ynone, Pm, opBytes{0xb9, 0}}, {AUD1, ynone, Pm, opBytes{0xb9, 0}},
{AUD2, ynone, Pm, opBytes{0x0b, 0}}, {AUD2, ynone, Pm, opBytes{0x0b, 0}},
{AUMWAIT, ywrfsbase, Pf2, opBytes{0xae, 06}},
{ASYSENTER, ynone, Px, opBytes{0x0f, 0x34, 0}}, {ASYSENTER, ynone, Px, opBytes{0x0f, 0x34, 0}},
{ASYSENTER64, ynone, Pw, opBytes{0x0f, 0x34, 0}}, {ASYSENTER64, ynone, Pw, opBytes{0x0f, 0x34, 0}},
{ASYSEXIT, ynone, Px, opBytes{0x0f, 0x35, 0}}, {ASYSEXIT, ynone, Px, opBytes{0x0f, 0x35, 0}},
......
...@@ -1136,8 +1136,10 @@ func stacksplit(ctxt *obj.Link, cursym *obj.LSym, p *obj.Prog, newprog obj.ProgA ...@@ -1136,8 +1136,10 @@ func stacksplit(ctxt *obj.Link, cursym *obj.LSym, p *obj.Prog, newprog obj.ProgA
var unaryDst = map[obj.As]bool{ var unaryDst = map[obj.As]bool{
ABSWAPL: true, ABSWAPL: true,
ABSWAPQ: true, ABSWAPQ: true,
ACLDEMOTE: true,
ACLFLUSH: true, ACLFLUSH: true,
ACLFLUSHOPT: true, ACLFLUSHOPT: true,
ACLWB: true,
ACMPXCHG16B: true, ACMPXCHG16B: true,
ACMPXCHG8B: true, ACMPXCHG8B: true,
ADECB: true, ADECB: true,
......
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