reprospect.test.sass.instruction.integer module

Collection of integer instruction matchers.

class reprospect.test.sass.instruction.integer.IntAdd3Matcher(*, arch: NVIDIAArch, src_a: str = 'R[0-9]+', src_b: str = 'R[0-9]+', src_c: str = 'R(?:Z|\\d+)', dst: str = 'R[0-9]+')View on GitHub

Bases: OpcodeModsWithOperandsMatcher

Matcher for three 32-bit integer addition (IADD3).

IADD3 is architecture-dependent. Prior to reprospect.tools.architecture.NVIDIAFamily.BLACKWELL, it is:

IADD3 R7, R2, R7, RZ

and as of reprospect.tools.architecture.NVIDIAFamily.BLACKWELL:

IADD3 R17, PT, PT, R14, R11, R8
__init__(*, arch: NVIDIAArch, src_a: str = 'R[0-9]+', src_b: str = 'R[0-9]+', src_c: str = 'R(?:Z|\\d+)', dst: str = 'R[0-9]+') NoneView on GitHub
pattern: Final[Pattern[str]]
class reprospect.test.sass.instruction.integer.IntAddMatcher(*, src_a: str = 'R[0-9]+', src_b: str = 'R[0-9]+', dst: str = 'R[0-9]+')View on GitHub

Bases: OpcodeModsWithOperandsMatcher

Matcher for two 32-bit integer addition (IADD), such as:

IADD R14, R8, R11
__init__(*, src_a: str = 'R[0-9]+', src_b: str = 'R[0-9]+', dst: str = 'R[0-9]+') NoneView on GitHub
pattern: Final[Pattern[str]]
class reprospect.test.sass.instruction.integer.LEAMatcher(*, dest: str | None = None, index: str | None = None, base: str | None = None, shift: str | None = None)View on GitHub

Bases: PatternMatcher

Matcher for LEA instruction, such as:

LEA R24, R4, R10, 0x3

Note

LEA typically computes an integer linear expression of the form:

dst = base + (index << s)

where s is a shift encoded in the instruction. Therefore, it may act as a compact shift-then-add primitive.

References:

PATTERN: Final[Pattern[str]] = regex.Regex('(?P<opcode>LEA)\\s*(?P<operands>R[0-9]+),?\\s*(?P<operands>R[0-9]+),?\\s*(?P<operands>R[0-9]+),?\\s*(?P<operands>(?P<shift>0x[0-9]+))', flags=regex.V0)
SHIFT: Final[str] = '0x[0-9]+'
__init__(*, dest: str | None = None, index: str | None = None, base: str | None = None, shift: str | None = None) NoneView on GitHub
pattern: Final[Pattern[str]]