diff --git a/src/cmd/asm/internal/asm/testdata/amd64enc_extra.s b/src/cmd/asm/internal/asm/testdata/amd64enc_extra.s index d7afecc230..a7d9bdac54 100644 --- a/src/cmd/asm/internal/asm/testdata/amd64enc_extra.s +++ b/src/cmd/asm/internal/asm/testdata/amd64enc_extra.s @@ -1049,5 +1049,11 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0 VADDPD Z2, Z9, Z21 // 62e1b54858ea VADDPD Z21, Z2, Z9 // 6231ed4858cd VADDPD Z9, Z21, Z2 // 62d1d54058d1 + + CLWB (BX) // 660fae33 + CLDEMOTE (BX) // 0f1c03 + TPAUSE BX // 660faef3 + UMONITOR BX // f30faef3 + UMWAIT BX // f20faef3 // End of tests. RET diff --git a/src/cmd/asm/internal/asm/testdata/amd64error.s b/src/cmd/asm/internal/asm/testdata/amd64error.s index 93272e39d5..7e91fb4e97 100644 --- a/src/cmd/asm/internal/asm/testdata/amd64error.s +++ b/src/cmd/asm/internal/asm/testdata/amd64error.s @@ -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" + // 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 diff --git a/src/cmd/internal/obj/x86/aenum.go b/src/cmd/internal/obj/x86/aenum.go index 0377b39a41..2c035641f5 100644 --- a/src/cmd/internal/obj/x86/aenum.go +++ b/src/cmd/internal/obj/x86/aenum.go @@ -90,10 +90,12 @@ const ( ACLAC ACLC ACLD + ACLDEMOTE ACLFLUSH ACLFLUSHOPT ACLI ACLTS + ACLWB ACMC ACMOVLCC ACMOVLCS @@ -877,6 +879,7 @@ const ( ATESTL ATESTQ ATESTW + ATPAUSE ATZCNTL ATZCNTQ ATZCNTW @@ -884,10 +887,12 @@ const ( AUCOMISS AUD1 AUD2 + AUMWAIT AUNPCKHPD AUNPCKHPS AUNPCKLPD AUNPCKLPS + AUMONITOR AV4FMADDPS AV4FMADDSS AV4FNMADDPS diff --git a/src/cmd/internal/obj/x86/anames.go b/src/cmd/internal/obj/x86/anames.go index a928f67bae..e6c00bdbe0 100644 --- a/src/cmd/internal/obj/x86/anames.go +++ b/src/cmd/internal/obj/x86/anames.go @@ -88,10 +88,12 @@ var Anames = []string{ "CLAC", "CLC", "CLD", + "CLDEMOTE", "CLFLUSH", "CLFLUSHOPT", "CLI", "CLTS", + "CLWB", "CMC", "CMOVLCC", "CMOVLCS", @@ -875,6 +877,7 @@ var Anames = []string{ "TESTL", "TESTQ", "TESTW", + "TPAUSE", "TZCNTL", "TZCNTQ", "TZCNTW", @@ -882,10 +885,12 @@ var Anames = []string{ "UCOMISS", "UD1", "UD2", + "UMWAIT", "UNPCKHPD", "UNPCKHPS", "UNPCKLPD", "UNPCKLPS", + "UMONITOR", "V4FMADDPS", "V4FMADDSS", "V4FNMADDPS", diff --git a/src/cmd/internal/obj/x86/asm6.go b/src/cmd/internal/obj/x86/asm6.go index f5359493d0..618e88212c 100644 --- a/src/cmd/internal/obj/x86/asm6.go +++ b/src/cmd/internal/obj/x86/asm6.go @@ -983,10 +983,12 @@ var optab = {ACLAC, ynone, Pm, opBytes{01, 0xca}}, {ACLC, ynone, Px, opBytes{0xf8}}, {ACLD, ynone, Px, opBytes{0xfc}}, + {ACLDEMOTE, yclflush, Pm, opBytes{0x1c, 00}}, {ACLFLUSH, yclflush, Pm, opBytes{0xae, 07}}, {ACLFLUSHOPT, yclflush, Pq, opBytes{0xae, 07}}, {ACLI, ynone, Px, opBytes{0xfa}}, {ACLTS, ynone, Pm, opBytes{0x06}}, + {ACLWB, yclflush, Pq, opBytes{0xae, 06}}, {ACMC, ynone, Px, opBytes{0xf5}}, {ACMOVLCC, yml_rl, Pm, opBytes{0x43}}, {ACMOVLCS, yml_rl, Pm, opBytes{0x42}}, @@ -1500,6 +1502,7 @@ var optab = {ATESTL, ytestl, Px, opBytes{0xa9, 0xf7, 00, 0x85, 0x85}}, {ATESTQ, ytestl, Pw, 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{}}, {AUCOMISD, yxm, Pe, opBytes{0x2e}}, {AUCOMISS, yxm, Pm, opBytes{0x2e}}, @@ -1507,6 +1510,7 @@ var optab = {AUNPCKHPS, yxm, Pm, opBytes{0x15}}, {AUNPCKLPD, yxm, Pe, opBytes{0x14}}, {AUNPCKLPS, yxm, Pm, opBytes{0x14}}, + {AUMONITOR, ywrfsbase, Pf3, opBytes{0xae, 06}}, {AVERR, ydivl, Pm, opBytes{0x00, 04}}, {AVERW, ydivl, Pm, opBytes{0x00, 05}}, {AWAIT, ynone, Px, opBytes{0x9b}}, @@ -1691,11 +1695,11 @@ var optab = {AMOVDDUP, yxm, Pf2, opBytes{0x12}}, {AMOVSHDUP, yxm, Pf3, opBytes{0x16}}, {AMOVSLDUP, yxm, Pf3, opBytes{0x12}}, - {ARDTSCP, ynone, Pm, opBytes{0x01, 0xf9, 0}}, {ASTAC, ynone, Pm, opBytes{0x01, 0xcb, 0}}, {AUD1, ynone, Pm, opBytes{0xb9, 0}}, {AUD2, ynone, Pm, opBytes{0x0b, 0}}, + {AUMWAIT, ywrfsbase, Pf2, opBytes{0xae, 06}}, {ASYSENTER, ynone, Px, opBytes{0x0f, 0x34, 0}}, {ASYSENTER64, ynone, Pw, opBytes{0x0f, 0x34, 0}}, {ASYSEXIT, ynone, Px, opBytes{0x0f, 0x35, 0}}, diff --git a/src/cmd/internal/obj/x86/obj6.go b/src/cmd/internal/obj/x86/obj6.go index 4554d4a525..f28fa65e95 100644 --- a/src/cmd/internal/obj/x86/obj6.go +++ b/src/cmd/internal/obj/x86/obj6.go @@ -1136,8 +1136,10 @@ func stacksplit(ctxt *obj.Link, cursym *obj.LSym, p *obj.Prog, newprog obj.ProgA var unaryDst = map[obj.As]bool{ ABSWAPL: true, ABSWAPQ: true, + ACLDEMOTE: true, ACLFLUSH: true, ACLFLUSHOPT: true, + ACLWB: true, ACMPXCHG16B: true, ACMPXCHG8B: true, ADECB: true,