all: add GFNI instructions (#344)

Adds support for the GFNI "Galois Field New Instructions" instruction set.

These instructions are not included in the Opcodes database, therefore they're
added using the "extras" mechanism introduced in #345.

For simplicity, the loading phase is updated slightly so that AVX-512 form
expansion rules are applied after extras are added to the list. This greatly
reduces the number of forms that have to be specified by hand.

Based on #343
Fixes #335

Co-authored-by: Klaus Post <klauspost@gmail.com>
This commit is contained in:
Michael McLoughlin
2022-11-27 18:53:46 -08:00
committed by GitHub
parent a0ea0f3e6f
commit 946323570a
10 changed files with 2362 additions and 398 deletions

View File

@@ -50572,6 +50572,816 @@ var Instructions = []Instruction{
},
},
},
{
Opcode: "VGF2P8AFFINEINVQB",
Summary: "Galois Field Affine Transformation Inverse",
Forms: []Form{
{
ISA: []string{"AVX", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m128", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "xmm", Action: 0x2},
},
EncodingType: 0x3,
},
{
ISA: []string{"AVX", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m256", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "ymm", Action: 0x2},
},
EncodingType: 0x3,
},
{
ISA: []string{"AVX", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "xmm", Action: 0x2},
},
EncodingType: 0x3,
},
{
ISA: []string{"AVX", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "ymm", Action: 0x2},
},
EncodingType: 0x3,
},
{
ISA: []string{"AVX512F", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m512", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "zmm", Action: 0x3},
},
EncodingType: 0x4,
},
{
ISA: []string{"AVX512F", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m512", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "zmm", Action: 0x2},
},
EncodingType: 0x4,
Zeroing: true,
},
{
ISA: []string{"AVX512F", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m512", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "zmm", Action: 0x2},
},
EncodingType: 0x4,
},
{
ISA: []string{"AVX512F", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m64", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "zmm", Action: 0x3},
},
EncodingType: 0x4,
Broadcast: true,
},
{
ISA: []string{"AVX512F", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m64", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "zmm", Action: 0x2},
},
EncodingType: 0x4,
Zeroing: true,
Broadcast: true,
},
{
ISA: []string{"AVX512F", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m64", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "zmm", Action: 0x2},
},
EncodingType: 0x4,
Broadcast: true,
},
{
ISA: []string{"AVX512F", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "zmm", Action: 0x3},
},
EncodingType: 0x4,
},
{
ISA: []string{"AVX512F", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "zmm", Action: 0x2},
},
EncodingType: 0x4,
Zeroing: true,
},
{
ISA: []string{"AVX512F", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "zmm", Action: 0x2},
},
EncodingType: 0x4,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m128", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "xmm", Action: 0x3},
},
EncodingType: 0x4,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m128", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "xmm", Action: 0x2},
},
EncodingType: 0x4,
Zeroing: true,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m256", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "ymm", Action: 0x3},
},
EncodingType: 0x4,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m256", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "ymm", Action: 0x2},
},
EncodingType: 0x4,
Zeroing: true,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m64", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "xmm", Action: 0x3},
},
EncodingType: 0x4,
Broadcast: true,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m64", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "xmm", Action: 0x2},
},
EncodingType: 0x4,
Zeroing: true,
Broadcast: true,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m64", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "xmm", Action: 0x2},
},
EncodingType: 0x4,
Broadcast: true,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m64", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "ymm", Action: 0x3},
},
EncodingType: 0x4,
Broadcast: true,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m64", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "ymm", Action: 0x2},
},
EncodingType: 0x4,
Zeroing: true,
Broadcast: true,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m64", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "ymm", Action: 0x2},
},
EncodingType: 0x4,
Broadcast: true,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "xmm", Action: 0x3},
},
EncodingType: 0x4,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "xmm", Action: 0x2},
},
EncodingType: 0x4,
Zeroing: true,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "ymm", Action: 0x3},
},
EncodingType: 0x4,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "ymm", Action: 0x2},
},
EncodingType: 0x4,
Zeroing: true,
},
},
},
{
Opcode: "VGF2P8AFFINEQB",
Summary: "Galois Field Affine Transformation",
Forms: []Form{
{
ISA: []string{"AVX", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m128", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "xmm", Action: 0x2},
},
EncodingType: 0x3,
},
{
ISA: []string{"AVX", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m256", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "ymm", Action: 0x2},
},
EncodingType: 0x3,
},
{
ISA: []string{"AVX", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "xmm", Action: 0x2},
},
EncodingType: 0x3,
},
{
ISA: []string{"AVX", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "ymm", Action: 0x2},
},
EncodingType: 0x3,
},
{
ISA: []string{"AVX512F", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m512", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "zmm", Action: 0x3},
},
EncodingType: 0x4,
},
{
ISA: []string{"AVX512F", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m512", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "zmm", Action: 0x2},
},
EncodingType: 0x4,
Zeroing: true,
},
{
ISA: []string{"AVX512F", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m512", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "zmm", Action: 0x2},
},
EncodingType: 0x4,
},
{
ISA: []string{"AVX512F", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m64", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "zmm", Action: 0x3},
},
EncodingType: 0x4,
Broadcast: true,
},
{
ISA: []string{"AVX512F", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m64", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "zmm", Action: 0x2},
},
EncodingType: 0x4,
Zeroing: true,
Broadcast: true,
},
{
ISA: []string{"AVX512F", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m64", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "zmm", Action: 0x2},
},
EncodingType: 0x4,
Broadcast: true,
},
{
ISA: []string{"AVX512F", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "zmm", Action: 0x3},
},
EncodingType: 0x4,
},
{
ISA: []string{"AVX512F", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "zmm", Action: 0x2},
},
EncodingType: 0x4,
Zeroing: true,
},
{
ISA: []string{"AVX512F", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "zmm", Action: 0x2},
},
EncodingType: 0x4,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m128", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "xmm", Action: 0x3},
},
EncodingType: 0x4,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m128", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "xmm", Action: 0x2},
},
EncodingType: 0x4,
Zeroing: true,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m256", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "ymm", Action: 0x3},
},
EncodingType: 0x4,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m256", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "ymm", Action: 0x2},
},
EncodingType: 0x4,
Zeroing: true,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m64", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "xmm", Action: 0x3},
},
EncodingType: 0x4,
Broadcast: true,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m64", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "xmm", Action: 0x2},
},
EncodingType: 0x4,
Zeroing: true,
Broadcast: true,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m64", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "xmm", Action: 0x2},
},
EncodingType: 0x4,
Broadcast: true,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m64", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "ymm", Action: 0x3},
},
EncodingType: 0x4,
Broadcast: true,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m64", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "ymm", Action: 0x2},
},
EncodingType: 0x4,
Zeroing: true,
Broadcast: true,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "m64", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "ymm", Action: 0x2},
},
EncodingType: 0x4,
Broadcast: true,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "xmm", Action: 0x3},
},
EncodingType: 0x4,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "xmm", Action: 0x2},
},
EncodingType: 0x4,
Zeroing: true,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "ymm", Action: 0x3},
},
EncodingType: 0x4,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "imm8", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "ymm", Action: 0x2},
},
EncodingType: 0x4,
Zeroing: true,
},
},
},
{
Opcode: "VGF2P8MULB",
Summary: "Galois Field Multiply Bytes",
Forms: []Form{
{
ISA: []string{"AVX", "GFNI"},
Operands: []Operand{
{Type: "m128", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "xmm", Action: 0x2},
},
EncodingType: 0x3,
},
{
ISA: []string{"AVX", "GFNI"},
Operands: []Operand{
{Type: "m256", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "ymm", Action: 0x2},
},
EncodingType: 0x3,
},
{
ISA: []string{"AVX", "GFNI"},
Operands: []Operand{
{Type: "xmm", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "xmm", Action: 0x2},
},
EncodingType: 0x3,
},
{
ISA: []string{"AVX", "GFNI"},
Operands: []Operand{
{Type: "ymm", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "ymm", Action: 0x2},
},
EncodingType: 0x3,
},
{
ISA: []string{"AVX512F", "GFNI"},
Operands: []Operand{
{Type: "m512", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "zmm", Action: 0x3},
},
EncodingType: 0x4,
},
{
ISA: []string{"AVX512F", "GFNI"},
Operands: []Operand{
{Type: "m512", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "zmm", Action: 0x2},
},
EncodingType: 0x4,
Zeroing: true,
},
{
ISA: []string{"AVX512F", "GFNI"},
Operands: []Operand{
{Type: "m512", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "zmm", Action: 0x2},
},
EncodingType: 0x4,
},
{
ISA: []string{"AVX512F", "GFNI"},
Operands: []Operand{
{Type: "zmm", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "zmm", Action: 0x3},
},
EncodingType: 0x4,
},
{
ISA: []string{"AVX512F", "GFNI"},
Operands: []Operand{
{Type: "zmm", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "zmm", Action: 0x2},
},
EncodingType: 0x4,
Zeroing: true,
},
{
ISA: []string{"AVX512F", "GFNI"},
Operands: []Operand{
{Type: "zmm", Action: 0x1},
{Type: "zmm", Action: 0x1},
{Type: "zmm", Action: 0x2},
},
EncodingType: 0x4,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "m128", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "xmm", Action: 0x3},
},
EncodingType: 0x4,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "m128", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "xmm", Action: 0x2},
},
EncodingType: 0x4,
Zeroing: true,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "m256", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "ymm", Action: 0x3},
},
EncodingType: 0x4,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "m256", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "ymm", Action: 0x2},
},
EncodingType: 0x4,
Zeroing: true,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "xmm", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "xmm", Action: 0x3},
},
EncodingType: 0x4,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "xmm", Action: 0x1},
{Type: "xmm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "xmm", Action: 0x2},
},
EncodingType: 0x4,
Zeroing: true,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "ymm", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "ymm", Action: 0x3},
},
EncodingType: 0x4,
},
{
ISA: []string{"AVX512VL", "GFNI"},
Operands: []Operand{
{Type: "ymm", Action: 0x1},
{Type: "ymm", Action: 0x1},
{Type: "k", Action: 0x1},
{Type: "ymm", Action: 0x2},
},
EncodingType: 0x4,
Zeroing: true,
},
},
},
{
Opcode: "VHADDPD",
Summary: "Packed Double-FP Horizontal Add",