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 (
AADDPS
AADDSD
AADDSS
AANDNL
AANDNQ
AANDNPD
AANDNPS
AANDPD
AANDPS
ABEXTRL
ABEXTRQ
ABLSIL
ABLSIQ
ABLSMSKL
ABLSMSKQ
ABLSRL
ABLSRQ
ABZHIL
ABZHIQ
ACMPPD
ACMPPS
ACMPSD
......@@ -588,6 +600,8 @@ const (
AMULPS
AMULSD
AMULSS
AMULXL
AMULXQ
AORPD
AORPS
APACKSSLW
......@@ -618,6 +632,10 @@ const (
APCMPGTB
APCMPGTL
APCMPGTW
APDEPL
APDEPQ
APEXTL
APEXTQ
APEXTRB
APEXTRD
APEXTRQ
......@@ -714,6 +732,12 @@ const (
ARCPSS
ARSQRTPS
ARSQRTSS
ASARXL
ASARXQ
ASHLXL
ASHLXQ
ASHRXL
ASHRXQ
ASHUFPD
ASHUFPS
ASQRTPD
......
......@@ -459,10 +459,22 @@ var Anames = []string{
"ADDPS",
"ADDSD",
"ADDSS",
"ANDNL",
"ANDNQ",
"ANDNPD",
"ANDNPS",
"ANDPD",
"ANDPS",
"BEXTRL",
"BEXTRQ",
"BLSIL",
"BLSIQ",
"BLSMSKL",
"BLSMSKQ",
"BLSRL",
"BLSRQ",
"BZHIL",
"BZHIQ",
"CMPPD",
"CMPPS",
"CMPSD",
......@@ -537,6 +549,8 @@ var Anames = []string{
"MULPS",
"MULSD",
"MULSS",
"MULXL",
"MULXQ",
"ORPD",
"ORPS",
"PACKSSLW",
......@@ -567,6 +581,10 @@ var Anames = []string{
"PCMPGTB",
"PCMPGTL",
"PCMPGTW",
"PDEPL",
"PDEPQ",
"PEXTL",
"PEXTQ",
"PEXTRB",
"PEXTRD",
"PEXTRQ",
......@@ -663,6 +681,12 @@ var Anames = []string{
"RCPSS",
"RSQRTPS",
"RSQRTSS",
"SARXL",
"SARXQ",
"SHLXL",
"SHLXQ",
"SHRXL",
"SHRXQ",
"SHUFPD",
"SHUFPS",
"SQRTPD",
......
......@@ -207,6 +207,7 @@ const (
Zbyte
Zvex_rm_v_r
Zvex_r_v_rm
Zvex_v_rm_r
Zmax
)
......@@ -850,6 +851,16 @@ var yvex_xy3 = []ytab{
{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{
{Yxm, Ynone, Yxr, Zvex_rm_v_r, 2},
{Yym, Ynone, Yyr, Zvex_rm_v_r, 2},
......@@ -1669,6 +1680,25 @@ var optab =
{APSHUFD, yxshuf, Pq, [23]uint8{0x70, 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}},
{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}},
......@@ -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])
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:
asmvex(ctxt, &p.To, p.From3, &p.From, o.op[z], o.op[z+1])
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