decoder

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultMaxDepth is the maximum depth for the decoder tree
	DefaultMaxDepth = 31

	BitMaskStrategy = "mask"    // Use bitmask-based splitting
	EntropyStrategy = "entropy" // Use entropy-based splitting
)

Variables

This section is empty.

Functions

func MatchByPattern

func MatchByPattern(instructions []*ir.InstructionIR, word uint32) []*ir.InstructionIR

MatchByPattern scans a flat instruction list using BitPattern + bitdiffs (O(n)). Useful when a tree is not available or as a correctness oracle.

Types

type DecoderTreeBuilder

type DecoderTreeBuilder struct {
	// contains filtered or unexported fields
}

func (*DecoderTreeBuilder) BuildTree

func (b *DecoderTreeBuilder) BuildTree(instructions []*ir.InstructionIR, enabled FeatureMap) *ir.DecoderTree

BuildTree constructs a decoder tree for all instructions

type FeatureMap

type FeatureMap map[string]bool

FeatureMap defines which features are enabled.

type MatchResult

type MatchResult struct {
	Instruction *ir.InstructionIR
	Ambiguous   []*ir.InstructionIR
	Depth       int
}

MatchResult is the outcome of walking a decoder tree for one instruction word.

func Match

func Match(tree *ir.DecoderTree, word uint32) (MatchResult, error)

Match walks tree for word using mask/value child edges. Leaves with a single Instruction or Ambiguous set terminate the walk.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL