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:
committed by
GitHub
parent
a0ea0f3e6f
commit
946323570a
@@ -40,6 +40,13 @@ func (i Instruction) IsConditionalBranch() bool {
|
||||
return i.IsBranch() && i.Opcode != "JMP"
|
||||
}
|
||||
|
||||
// Clone the instruction.
|
||||
func (i Instruction) Clone() Instruction {
|
||||
c := i
|
||||
c.Forms = i.Forms.Clone()
|
||||
return c
|
||||
}
|
||||
|
||||
// Forms is a collection of instruction forms.
|
||||
type Forms []Form
|
||||
|
||||
@@ -78,6 +85,15 @@ func (fs Forms) IsNiladic() bool {
|
||||
return len(a) == 1 && a[0] == 0
|
||||
}
|
||||
|
||||
// Clone the instruction forms.
|
||||
func (fs Forms) Clone() Forms {
|
||||
cs := make(Forms, 0, len(fs))
|
||||
for _, f := range fs {
|
||||
cs = append(cs, f.Clone())
|
||||
}
|
||||
return cs
|
||||
}
|
||||
|
||||
// Form specifies one accepted set of operands for an instruction.
|
||||
type Form struct {
|
||||
// Instruction sets this instruction form requires.
|
||||
|
||||
Reference in New Issue
Block a user