Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all: add GFNI instructions #344

Merged
merged 10 commits into from
Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
340 changes: 340 additions & 0 deletions build/zinstructions.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions build/zinstructions_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions internal/inst/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down
Loading