]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/asm: add missing x86 instructions
authorArtem Alekseev <artem.alekseev@intel.com>
Fri, 21 Jun 2019 08:15:21 +0000 (11:15 +0300)
committerCherry Zhang <cherryyz@google.com>
Thu, 17 Oct 2019 16:30:15 +0000 (16:30 +0000)
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: Cherry Zhang <cherryyz@google.com>
src/cmd/asm/internal/asm/testdata/amd64enc_extra.s
src/cmd/asm/internal/asm/testdata/amd64error.s
src/cmd/internal/obj/x86/aenum.go
src/cmd/internal/obj/x86/anames.go
src/cmd/internal/obj/x86/asm6.go
src/cmd/internal/obj/x86/obj6.go

index d7afecc23044d164691cac94b6f7e21a6b932b0f..a7d9bdac54566bbe0bd695563b544a09a8ce6a01 100644 (file)
@@ -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
index 93272e39d541de74e30fb041d2595eb0cb2648d4..7e91fb4e97a24db9ec00b0faf3047f750f57028e 100644 (file)
@@ -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
index 0377b39a4166d42dc5d96d43c4c6a6dd007e2dac..2c035641f557249b8127266bf1d2bd0bf5f95d2e 100644 (file)
@@ -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
index a928f67bae41c0437a5c4ab96f64b51865e9523f..e6c00bdbe0e9a88e8f827d294c8edf342c52d79a 100644 (file)
@@ -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",
index f5359493d063c95cab03d3ba82a08242998d8ee3..618e88212cff0c970607498f7c794e5d0b7446ce 100644 (file)
@@ -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}},
index 4554d4a525fb83049170dd2f9686943b56907732..f28fa65e95cc3568d33a6584a4a537376df9e22f 100644 (file)
@@ -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,