Commit 5ce715fd authored by Ilya Tocar's avatar Ilya Tocar

cmd/internal/obj/x86: add some missing AMD64 instructions

Add VBROADCASTSD, BROADCASTSS, MOVDDUP, MOVSHDUP, MOVSLDUP,
VMOVDDUP, VMOVSHDUP, VMOVSLDUP.

Fixes #16007

Change-Id: I9614e58eed6c1b6f299d9b4f0b1a7750aa7c1725
Reviewed-on: https://go-review.googlesource.com/31491
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarDavid Chase <drchase@google.com>
parent 692df217
......@@ -771,6 +771,9 @@ const (
AROUNDSS
AROUNDPD
AROUNDSD
AMOVDDUP
AMOVSHDUP
AMOVSLDUP
APSHUFD
APCLMULQDQ
......@@ -803,6 +806,11 @@ const (
AVPERM2I128
ARORXL
ARORXQ
AVBROADCASTSS
AVBROADCASTSD
AVMOVDDUP
AVMOVSHDUP
AVMOVSLDUP
// from 386
AJCXZW
......
......@@ -708,6 +708,9 @@ var Anames = []string{
"ROUNDSS",
"ROUNDPD",
"ROUNDSD",
"MOVDDUP",
"MOVSHDUP",
"MOVSLDUP",
"PSHUFD",
"PCLMULQDQ",
"VZEROUPPER",
......@@ -738,6 +741,11 @@ var Anames = []string{
"VPERM2I128",
"RORXL",
"RORXQ",
"VBROADCASTSS",
"VBROADCASTSD",
"VMOVDDUP",
"VMOVSHDUP",
"VMOVSLDUP",
"JCXZW",
"FCMOVCC",
"FCMOVCS",
......
......@@ -866,6 +866,10 @@ var yvex_vpbroadcast = []ytab{
{Yxm, Ynone, Yyr, Zvex_rm_v_r, 2},
}
var yvex_vpbroadcast_sd = []ytab{
{Yxm, Ynone, Yyr, Zvex_rm_v_r, 2},
}
var ymmxmm0f38 = []ytab{
{Ymm, Ynone, Ymr, Zlitm_r, 3},
{Yxm, Ynone, Yxr, Zlitm_r, 5},
......@@ -1630,6 +1634,9 @@ var optab =
{APSHUFD, yxshuf, Pq, [23]uint8{0x70, 0}},
{APCLMULQDQ, yxshuf, Pq, [23]uint8{0x3a, 0x44, 0}},
{APCMPESTRI, yxshuf, Pq, [23]uint8{0x3a, 0x61, 0}},
{AMOVDDUP, yxm, Pf2, [23]uint8{0x12}},
{AMOVSHDUP, yxm, Pf3, [23]uint8{0x16}},
{AMOVSLDUP, yxm, Pf3, [23]uint8{0x12}},
{AANDNL, yvex_r3, Pvex, [23]uint8{VEX_LZ_0F38_W0, 0xF2}},
{AANDNQ, yvex_r3, Pvex, [23]uint8{VEX_LZ_0F38_W1, 0xF2}},
......@@ -1678,6 +1685,11 @@ var optab =
{AVPERM2I128, yvex_yyi4, Pvex, [23]uint8{VEX_256_66_0F3A_WIG, 0x46}},
{ARORXL, yvex_ri3, Pvex, [23]uint8{VEX_LZ_F2_0F3A_W0, 0xf0}},
{ARORXQ, yvex_ri3, Pvex, [23]uint8{VEX_LZ_F2_0F3A_W1, 0xf0}},
{AVBROADCASTSD, yvex_vpbroadcast_sd, Pvex, [23]uint8{VEX_256_66_0F38_W0, 0x19}},
{AVBROADCASTSS, yvex_vpbroadcast, Pvex, [23]uint8{VEX_128_66_0F38_W0, 0x18, VEX_256_66_0F38_W0, 0x18}},
{AVMOVDDUP, yvex_xy2, Pvex, [23]uint8{VEX_128_F2_0F_WIG, 0x12, VEX_256_F2_0F_WIG, 0x12}},
{AVMOVSHDUP, yvex_xy2, Pvex, [23]uint8{VEX_128_F3_0F_WIG, 0x16, VEX_256_F3_0F_WIG, 0x16}},
{AVMOVSLDUP, yvex_xy2, Pvex, [23]uint8{VEX_128_F3_0F_WIG, 0x12, VEX_256_F3_0F_WIG, 0x12}},
{AXACQUIRE, ynone, Px, [23]uint8{0xf2}},
{AXRELEASE, ynone, Px, [23]uint8{0xf3}},
......@@ -3379,7 +3391,8 @@ func doasm(ctxt *obj.Link, p *obj.Prog) {
log.Fatalf("asmins bad table %v", p)
}
op = int(o.op[z])
if op == 0x0f {
// In vex case 0x0f is actually VEX_256_F2_0F_WIG
if op == 0x0f && o.prefix != Pvex {
ctxt.AsmBuf.Put1(byte(op))
z++
op = int(o.op[z])
......
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