Skip to content

Commit 2449444

Browse files
Artem Alekseevcherrymui
Artem Alekseev
authored andcommitted
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Cherry Zhang <[email protected]>
1 parent 00ea8e1 commit 2449444

File tree

6 files changed

+31
-1
lines changed

6 files changed

+31
-1
lines changed

src/cmd/asm/internal/asm/testdata/amd64enc_extra.s

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,5 +1049,11 @@ TEXT asmtest(SB),DUPOK|NOSPLIT,$0
10491049
VADDPD Z2, Z9, Z21 // 62e1b54858ea
10501050
VADDPD Z21, Z2, Z9 // 6231ed4858cd
10511051
VADDPD Z9, Z21, Z2 // 62d1d54058d1
1052+
1053+
CLWB (BX) // 660fae33
1054+
CLDEMOTE (BX) // 0f1c03
1055+
TPAUSE BX // 660faef3
1056+
UMONITOR BX // f30faef3
1057+
UMWAIT BX // f20faef3
10521058
// End of tests.
10531059
RET

src/cmd/asm/internal/asm/testdata/amd64error.s

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,12 @@ TEXT errors(SB),$0
132132
VADDPD.BCST X3, X2, K1, X1 // ERROR "illegal broadcast without memory argument"
133133
VADDPD.BCST X3, X2, K1, X1 // ERROR "illegal broadcast without memory argument"
134134
VADDPD.BCST X3, X2, K1, X1 // ERROR "illegal broadcast without memory argument"
135+
// CLWB instuctions:
136+
CLWB BX // ERROR "invalid instruction"
137+
// CLDEMOTE instructions:
138+
CLDEMOTE BX // ERROR "invalid instruction"
139+
// WAITPKG instructions:
140+
TPAUSE (BX) // ERROR "invalid instruction"
141+
UMONITOR (BX) // ERROR "invalid instruction"
142+
UMWAIT (BX) // ERROR "invalid instruction"
135143
RET

src/cmd/internal/obj/x86/aenum.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmd/internal/obj/x86/anames.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmd/internal/obj/x86/asm6.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,10 +983,12 @@ var optab =
983983
{ACLAC, ynone, Pm, opBytes{01, 0xca}},
984984
{ACLC, ynone, Px, opBytes{0xf8}},
985985
{ACLD, ynone, Px, opBytes{0xfc}},
986+
{ACLDEMOTE, yclflush, Pm, opBytes{0x1c, 00}},
986987
{ACLFLUSH, yclflush, Pm, opBytes{0xae, 07}},
987988
{ACLFLUSHOPT, yclflush, Pq, opBytes{0xae, 07}},
988989
{ACLI, ynone, Px, opBytes{0xfa}},
989990
{ACLTS, ynone, Pm, opBytes{0x06}},
991+
{ACLWB, yclflush, Pq, opBytes{0xae, 06}},
990992
{ACMC, ynone, Px, opBytes{0xf5}},
991993
{ACMOVLCC, yml_rl, Pm, opBytes{0x43}},
992994
{ACMOVLCS, yml_rl, Pm, opBytes{0x42}},
@@ -1500,13 +1502,15 @@ var optab =
15001502
{ATESTL, ytestl, Px, opBytes{0xa9, 0xf7, 00, 0x85, 0x85}},
15011503
{ATESTQ, ytestl, Pw, opBytes{0xa9, 0xf7, 00, 0x85, 0x85}},
15021504
{ATESTW, ytestl, Pe, opBytes{0xa9, 0xf7, 00, 0x85, 0x85}},
1505+
{ATPAUSE, ywrfsbase, Pq, opBytes{0xae, 06}},
15031506
{obj.ATEXT, ytext, Px, opBytes{}},
15041507
{AUCOMISD, yxm, Pe, opBytes{0x2e}},
15051508
{AUCOMISS, yxm, Pm, opBytes{0x2e}},
15061509
{AUNPCKHPD, yxm, Pe, opBytes{0x15}},
15071510
{AUNPCKHPS, yxm, Pm, opBytes{0x15}},
15081511
{AUNPCKLPD, yxm, Pe, opBytes{0x14}},
15091512
{AUNPCKLPS, yxm, Pm, opBytes{0x14}},
1513+
{AUMONITOR, ywrfsbase, Pf3, opBytes{0xae, 06}},
15101514
{AVERR, ydivl, Pm, opBytes{0x00, 04}},
15111515
{AVERW, ydivl, Pm, opBytes{0x00, 05}},
15121516
{AWAIT, ynone, Px, opBytes{0x9b}},
@@ -1691,11 +1695,11 @@ var optab =
16911695
{AMOVDDUP, yxm, Pf2, opBytes{0x12}},
16921696
{AMOVSHDUP, yxm, Pf3, opBytes{0x16}},
16931697
{AMOVSLDUP, yxm, Pf3, opBytes{0x12}},
1694-
16951698
{ARDTSCP, ynone, Pm, opBytes{0x01, 0xf9, 0}},
16961699
{ASTAC, ynone, Pm, opBytes{0x01, 0xcb, 0}},
16971700
{AUD1, ynone, Pm, opBytes{0xb9, 0}},
16981701
{AUD2, ynone, Pm, opBytes{0x0b, 0}},
1702+
{AUMWAIT, ywrfsbase, Pf2, opBytes{0xae, 06}},
16991703
{ASYSENTER, ynone, Px, opBytes{0x0f, 0x34, 0}},
17001704
{ASYSENTER64, ynone, Pw, opBytes{0x0f, 0x34, 0}},
17011705
{ASYSEXIT, ynone, Px, opBytes{0x0f, 0x35, 0}},

src/cmd/internal/obj/x86/obj6.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,8 +1136,10 @@ func stacksplit(ctxt *obj.Link, cursym *obj.LSym, p *obj.Prog, newprog obj.ProgA
11361136
var unaryDst = map[obj.As]bool{
11371137
ABSWAPL: true,
11381138
ABSWAPQ: true,
1139+
ACLDEMOTE: true,
11391140
ACLFLUSH: true,
11401141
ACLFLUSHOPT: true,
1142+
ACLWB: true,
11411143
ACMPXCHG16B: true,
11421144
ACMPXCHG8B: true,
11431145
ADECB: true,

0 commit comments

Comments
 (0)