all: VBMI2 instructions (#363)

Adds the "Vector Bit Manipulation Instructions 2" instruction set.

These new instructions are added via the `opcodesextra` mechanism #345, since
they're missing from the opcodes database.

Contributed by @vsivsi. Extracted from #349 with simplifications.
Specifically, as prompted by the `dupl` linter we extract some common forms
lists into a helper `forms.go` file.

Co-authored-by: Vaughn Iverson <vsivsi@yahoo.com>
This commit is contained in:
Michael McLoughlin
2023-01-14 13:25:44 -08:00
committed by GitHub
parent 05ed388d0f
commit e2c0a40f50
11 changed files with 8609 additions and 400 deletions

View File

@@ -23,12 +23,12 @@ var vpopcntdq = []*inst.Instruction{
{
Opcode: "VPOPCNTD",
Summary: "Packed Population Count for Doubleword Integers",
Forms: vpopcntdqforms("m32bcst"),
Forms: vpopcntdqforms("/m32bcst"),
},
{
Opcode: "VPOPCNTQ",
Summary: "Packed Population Count for Quadword Integers",
Forms: vpopcntdqforms("m64bcst"),
Forms: vpopcntdqforms("/m64bcst"),
},
}
@@ -46,61 +46,4 @@ var vpopcntdq = []*inst.Instruction{
// {zcase: Zevex_rm_v_r, zoffset: 0, args: argList{Yzm, Yzr}},
// {zcase: Zevex_rm_k_r, zoffset: 3, args: argList{Yzm, Yknot0, Yzr}},
// }
func vpopcntdqforms(mbcst string) inst.Forms {
return inst.Forms{
// EVEX.128.66.0F38.W0 55 /r VPOPCNTD xmm1{k1}{z}, xmm2/m128/m32bcst
// EVEX.128.66.0F38.W1 55 /r VPOPCNTQ xmm1{k1}{z}, xmm2/m128/m64bcst
{
ISA: []string{"AVX512VL", "AVX512VPOPCNTDQ"},
Operands: []inst.Operand{
{Type: "m128/" + mbcst, Action: inst.R},
{Type: "xmm{k}{z}", Action: inst.W},
},
EncodingType: inst.EncodingTypeEVEX,
},
{
ISA: []string{"AVX512VL", "AVX512VPOPCNTDQ"},
Operands: []inst.Operand{
{Type: "xmm", Action: inst.R},
{Type: "xmm{k}{z}", Action: inst.W},
},
EncodingType: inst.EncodingTypeEVEX,
},
// EVEX.256.66.0F38.W0 55 /r VPOPCNTD ymm1{k1}{z}, ymm2/m256/m32bcst
// EVEX.256.66.0F38.W1 55 /r VPOPCNTQ ymm1{k1}{z}, ymm2/m256/m64bcst
{
ISA: []string{"AVX512VL", "AVX512VPOPCNTDQ"},
Operands: []inst.Operand{
{Type: "m256/" + mbcst, Action: inst.R},
{Type: "ymm{k}{z}", Action: inst.W},
},
EncodingType: inst.EncodingTypeEVEX,
},
{
ISA: []string{"AVX512VL", "AVX512VPOPCNTDQ"},
Operands: []inst.Operand{
{Type: "ymm", Action: inst.R},
{Type: "ymm{k}{z}", Action: inst.W},
},
EncodingType: inst.EncodingTypeEVEX,
},
// EVEX.512.66.0F38.W0 55 /r VPOPCNTD zmm1{k1}{z}, zmm2/m512/m32bcst
// EVEX.512.66.0F38.W1 55 /r VPOPCNTQ zmm1{k1}{z}, zmm2/m512/m64bcst
{
ISA: []string{"AVX512VPOPCNTDQ"},
Operands: []inst.Operand{
{Type: "m512/" + mbcst, Action: inst.R},
{Type: "zmm{k}{z}", Action: inst.W},
},
EncodingType: inst.EncodingTypeEVEX,
},
{
ISA: []string{"AVX512VPOPCNTDQ"},
Operands: []inst.Operand{
{Type: "zmm", Action: inst.R},
{Type: "zmm{k}{z}", Action: inst.W},
},
EncodingType: inst.EncodingTypeEVEX,
},
}
}
func vpopcntdqforms(bcst string) inst.Forms { return _yvexpandpd("AVX512VPOPCNTDQ", bcst) }