Commit 0bae38e0 authored by Russ Cox's avatar Russ Cox

cmd/asm: add amd64 PDEP, PEXT, and related integer VEX instructions

Requested off-list.
Trivial to add and more importantly trivial to test.

ANDNL
ANDNQ
BEXTRL
BEXTRQ
BZHIL
BZHIQ
MULXL
MULXQ
PDEPL
PDEPQ
PEXTL
PEXTQ
SARXL
SARXQ
SHRXL
SHRXQ

Change-Id: I3d46a0f653b81dd003ff6d2a394d8ce96a573b63
Reviewed-on: https://go-review.googlesource.com/18857Reviewed-by: default avatarRob Pike <r@golang.org>
parent 863d9b66
...@@ -510,10 +510,22 @@ const ( ...@@ -510,10 +510,22 @@ const (
AADDPS AADDPS
AADDSD AADDSD
AADDSS AADDSS
AANDNL
AANDNQ
AANDNPD AANDNPD
AANDNPS AANDNPS
AANDPD AANDPD
AANDPS AANDPS
ABEXTRL
ABEXTRQ
ABLSIL
ABLSIQ
ABLSMSKL
ABLSMSKQ
ABLSRL
ABLSRQ
ABZHIL
ABZHIQ
ACMPPD ACMPPD
ACMPPS ACMPPS
ACMPSD ACMPSD
...@@ -588,6 +600,8 @@ const ( ...@@ -588,6 +600,8 @@ const (
AMULPS AMULPS
AMULSD AMULSD
AMULSS AMULSS
AMULXL
AMULXQ
AORPD AORPD
AORPS AORPS
APACKSSLW APACKSSLW
...@@ -618,6 +632,10 @@ const ( ...@@ -618,6 +632,10 @@ const (
APCMPGTB APCMPGTB
APCMPGTL APCMPGTL
APCMPGTW APCMPGTW
APDEPL
APDEPQ
APEXTL
APEXTQ
APEXTRB APEXTRB
APEXTRD APEXTRD
APEXTRQ APEXTRQ
...@@ -714,6 +732,12 @@ const ( ...@@ -714,6 +732,12 @@ const (
ARCPSS ARCPSS
ARSQRTPS ARSQRTPS
ARSQRTSS ARSQRTSS
ASARXL
ASARXQ
ASHLXL
ASHLXQ
ASHRXL
ASHRXQ
ASHUFPD ASHUFPD
ASHUFPS ASHUFPS
ASQRTPD ASQRTPD
......
...@@ -459,10 +459,22 @@ var Anames = []string{ ...@@ -459,10 +459,22 @@ var Anames = []string{
"ADDPS", "ADDPS",
"ADDSD", "ADDSD",
"ADDSS", "ADDSS",
"ANDNL",
"ANDNQ",
"ANDNPD", "ANDNPD",
"ANDNPS", "ANDNPS",
"ANDPD", "ANDPD",
"ANDPS", "ANDPS",
"BEXTRL",
"BEXTRQ",
"BLSIL",
"BLSIQ",
"BLSMSKL",
"BLSMSKQ",
"BLSRL",
"BLSRQ",
"BZHIL",
"BZHIQ",
"CMPPD", "CMPPD",
"CMPPS", "CMPPS",
"CMPSD", "CMPSD",
...@@ -537,6 +549,8 @@ var Anames = []string{ ...@@ -537,6 +549,8 @@ var Anames = []string{
"MULPS", "MULPS",
"MULSD", "MULSD",
"MULSS", "MULSS",
"MULXL",
"MULXQ",
"ORPD", "ORPD",
"ORPS", "ORPS",
"PACKSSLW", "PACKSSLW",
...@@ -567,6 +581,10 @@ var Anames = []string{ ...@@ -567,6 +581,10 @@ var Anames = []string{
"PCMPGTB", "PCMPGTB",
"PCMPGTL", "PCMPGTL",
"PCMPGTW", "PCMPGTW",
"PDEPL",
"PDEPQ",
"PEXTL",
"PEXTQ",
"PEXTRB", "PEXTRB",
"PEXTRD", "PEXTRD",
"PEXTRQ", "PEXTRQ",
...@@ -663,6 +681,12 @@ var Anames = []string{ ...@@ -663,6 +681,12 @@ var Anames = []string{
"RCPSS", "RCPSS",
"RSQRTPS", "RSQRTPS",
"RSQRTSS", "RSQRTSS",
"SARXL",
"SARXQ",
"SHLXL",
"SHLXQ",
"SHRXL",
"SHRXQ",
"SHUFPD", "SHUFPD",
"SHUFPS", "SHUFPS",
"SQRTPD", "SQRTPD",
......
...@@ -207,6 +207,7 @@ const ( ...@@ -207,6 +207,7 @@ const (
Zbyte Zbyte
Zvex_rm_v_r Zvex_rm_v_r
Zvex_r_v_rm Zvex_r_v_rm
Zvex_v_rm_r
Zmax Zmax
) )
...@@ -850,6 +851,16 @@ var yvex_xy3 = []ytab{ ...@@ -850,6 +851,16 @@ var yvex_xy3 = []ytab{
{Yym, Yyr, Yyr, Zvex_rm_v_r, 2}, {Yym, Yyr, Yyr, Zvex_rm_v_r, 2},
} }
var yvex_r3 = []ytab{
{Yml, Yrl, Yrl, Zvex_rm_v_r, 2},
{Yml, Yrl, Yrl, Zvex_rm_v_r, 2},
}
var yvex_vmr3 = []ytab{
{Yrl, Yml, Yrl, Zvex_v_rm_r, 2},
{Yrl, Yml, Yrl, Zvex_v_rm_r, 2},
}
var yvex_xy2 = []ytab{ var yvex_xy2 = []ytab{
{Yxm, Ynone, Yxr, Zvex_rm_v_r, 2}, {Yxm, Ynone, Yxr, Zvex_rm_v_r, 2},
{Yym, Ynone, Yyr, Zvex_rm_v_r, 2}, {Yym, Ynone, Yyr, Zvex_rm_v_r, 2},
...@@ -1669,6 +1680,25 @@ var optab = ...@@ -1669,6 +1680,25 @@ var optab =
{APSHUFD, yxshuf, Pq, [23]uint8{0x70, 0}}, {APSHUFD, yxshuf, Pq, [23]uint8{0x70, 0}},
{APCLMULQDQ, yxshuf, Pq, [23]uint8{0x3a, 0x44, 0}}, {APCLMULQDQ, yxshuf, Pq, [23]uint8{0x3a, 0x44, 0}},
{AANDNL, yvex_r3, Pvex, [23]uint8{VEX_LZ_0F38_W0, 0xF2}},
{AANDNQ, yvex_r3, Pvex, [23]uint8{VEX_LZ_0F38_W1, 0xF2}},
{ABEXTRL, yvex_vmr3, Pvex, [23]uint8{VEX_LZ_0F38_W0, 0xF7}},
{ABEXTRQ, yvex_vmr3, Pvex, [23]uint8{VEX_LZ_0F38_W1, 0xF7}},
{ABZHIL, yvex_vmr3, Pvex, [23]uint8{VEX_LZ_0F38_W0, 0xF5}},
{ABZHIQ, yvex_vmr3, Pvex, [23]uint8{VEX_LZ_0F38_W1, 0xF5}},
{AMULXL, yvex_r3, Pvex, [23]uint8{VEX_LZ_F2_0F38_W0, 0xF6}},
{AMULXQ, yvex_r3, Pvex, [23]uint8{VEX_LZ_F2_0F38_W1, 0xF6}},
{APDEPL, yvex_r3, Pvex, [23]uint8{VEX_LZ_F2_0F38_W0, 0xF5}},
{APDEPQ, yvex_r3, Pvex, [23]uint8{VEX_LZ_F2_0F38_W1, 0xF5}},
{APEXTL, yvex_r3, Pvex, [23]uint8{VEX_LZ_F3_0F38_W0, 0xF5}},
{APEXTQ, yvex_r3, Pvex, [23]uint8{VEX_LZ_F3_0F38_W1, 0xF5}},
{ASARXL, yvex_vmr3, Pvex, [23]uint8{VEX_LZ_F3_0F38_W0, 0xF7}},
{ASARXQ, yvex_vmr3, Pvex, [23]uint8{VEX_LZ_F3_0F38_W1, 0xF7}},
{ASHLXL, yvex_vmr3, Pvex, [23]uint8{VEX_LZ_66_0F38_W0, 0xF7}},
{ASHLXQ, yvex_vmr3, Pvex, [23]uint8{VEX_LZ_66_0F38_W1, 0xF7}},
{ASHRXL, yvex_vmr3, Pvex, [23]uint8{VEX_LZ_F2_0F38_W0, 0xF7}},
{ASHRXQ, yvex_vmr3, Pvex, [23]uint8{VEX_LZ_F2_0F38_W1, 0xF7}},
{AVZEROUPPER, ynone, Px, [23]uint8{0xc5, 0xf8, 0x77}}, {AVZEROUPPER, ynone, Px, [23]uint8{0xc5, 0xf8, 0x77}},
{AVMOVDQU, yvex_vmovdqa, Pvex, [23]uint8{VEX_128_F3_0F_WIG, 0x6F, VEX_128_F3_0F_WIG, 0x7F, VEX_256_F3_0F_WIG, 0x6F, VEX_256_F3_0F_WIG, 0x7F}}, {AVMOVDQU, yvex_vmovdqa, Pvex, [23]uint8{VEX_128_F3_0F_WIG, 0x6F, VEX_128_F3_0F_WIG, 0x7F, VEX_256_F3_0F_WIG, 0x6F, VEX_256_F3_0F_WIG, 0x7F}},
{AVMOVDQA, yvex_vmovdqa, Pvex, [23]uint8{VEX_128_66_0F_WIG, 0x6F, VEX_128_66_0F_WIG, 0x7F, VEX_256_66_0F_WIG, 0x6F, VEX_256_66_0F_WIG, 0x7F}}, {AVMOVDQA, yvex_vmovdqa, Pvex, [23]uint8{VEX_128_66_0F_WIG, 0x6F, VEX_128_66_0F_WIG, 0x7F, VEX_256_66_0F_WIG, 0x6F, VEX_256_66_0F_WIG, 0x7F}},
...@@ -3542,6 +3572,10 @@ func doasm(ctxt *obj.Link, p *obj.Prog) { ...@@ -3542,6 +3572,10 @@ func doasm(ctxt *obj.Link, p *obj.Prog) {
asmvex(ctxt, &p.From, p.From3, &p.To, o.op[z], o.op[z+1]) asmvex(ctxt, &p.From, p.From3, &p.To, o.op[z], o.op[z+1])
asmand(ctxt, p, &p.From, &p.To) asmand(ctxt, p, &p.From, &p.To)
case Zvex_v_rm_r:
asmvex(ctxt, p.From3, &p.From, &p.To, o.op[z], o.op[z+1])
asmand(ctxt, p, p.From3, &p.To)
case Zvex_r_v_rm: case Zvex_r_v_rm:
asmvex(ctxt, &p.To, p.From3, &p.From, o.op[z], o.op[z+1]) asmvex(ctxt, &p.To, p.From3, &p.From, o.op[z], o.op[z+1])
asmand(ctxt, p, &p.To, &p.From) asmand(ctxt, p, &p.To, &p.From)
......
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