reprospect.test.sass.instruction package

At first glance, examining generated SASS code may appear to be an esoteric task suited only to expert lab researchers — let alone testing it.

Yet, studying SASS — and assembly code in general — offers valuable insights. Indeed, modern HPC code bases rely on complex software stacks and compiler toolchains. While code correctness is often checked through regression testing, reaching and sustaining optimal performance as software and hardware evolve requires additional effort. This is usually achieved through verification of compile flags and ad hoc profiling and benchmarking. However, beyond runtime analysis, the SASS code already contains information about the available code paths and could itself be incorporated into testing. Still, the barrier to entry for meaningful SASS analysis is high: results can vary dramatically with compiler versions, optimization flags, and target architectures.

ReProspect provides a hierarchy of SASS instruction matchers that capture the components of an instruction (opcodes, modifiers and operands). Under the hood, they generate complex regular expression (regex) patterns. To accommodate for the evolving CUDA Instruction Set, some of these matchers take the target architecture as a parameter and adjust the regex patterns accordingly. In this way, ReProspect helps developers write assertions about expected instructions, while reducing the need to track low-level details of the evolving CUDA instruction set.

>>> from reprospect.tools.architecture import NVIDIAArch
>>> from reprospect.test.sass.instruction import LoadGlobalMatcher
>>> LoadGlobalMatcher(arch = NVIDIAArch.from_str('VOLTA70')).match(inst = 'LDG.E.SYS R15, [R8+0x10]')
InstructionMatch(opcode='LDG', modifiers=('E', 'SYS'), operands=('R15', '[R8+0x10]'), predicate=None, additional={'address': ['[R8+0x10]']})
>>> LoadGlobalMatcher(arch = NVIDIAArch.from_str('BLACKWELL120'), size = 128, readonly = True).match(inst = 'LDG.E.128.CONSTANT R2, desc[UR15][R6.64+0x12]')
InstructionMatch(opcode='LDG', modifiers=('E', '128', 'CONSTANT'), operands=('R2', 'desc[UR15][R6.64+0x12]'), predicate=None, additional={'address': ['desc[UR15][R6.64+0x12]']})

References:

class reprospect.test.sass.instruction.AddressMatcher(*, arch: NVIDIAArch, memory: MemorySpace = MemorySpace.GENERIC, reg: str | None = None, offset: str | None = None, desc_ureg: str | None = None, stride: StrideModifier | None = None)View on GitHub

Bases: object

Matcher for an address.

__init__(*, arch: NVIDIAArch, memory: MemorySpace = MemorySpace.GENERIC, reg: str | None = None, offset: str | None = None, desc_ureg: str | None = None, stride: StrideModifier | None = None) None

Method generated by attrs for class AddressMatcher.

arch: NVIDIAArch
classmethod build_desc_reg64_address(*, arch: NVIDIAArch, reg: str | None = None, offset: str | None = None, desc_ureg: str | None = None, captured: bool = False) strView on GitHub

Address operand with cache policy descriptor, such as:

desc[UR0][R0.64+0x10]
classmethod build_generic_or_global_address(*, arch: NVIDIAArch, reg: str | None = None, offset: str | None = None, desc_ureg: str | None = None, captured: bool = False) strView on GitHub

Generic or global memory address operand.

classmethod build_local_address(*, arch: NVIDIAArch, reg: str | None = None, offset: str | None = None, captured: bool = False) strView on GitHub

Local memory address operand.

classmethod build_pattern(*, arch: NVIDIAArch, memory: MemorySpace = MemorySpace.GENERIC, reg: str | None = None, offset: str | None = None, desc_ureg: str | None = None, stride: StrideModifier | None = None, captured: bool = False) strView on GitHub
classmethod build_pattern_desc_ureg(*, desc_ureg: str | None = None, captured: bool = True) strView on GitHub
classmethod build_pattern_offset(*, arch: NVIDIAArch, offset: str | None = None, captured: bool = True) strView on GitHub
classmethod build_pattern_reg(*, arch: NVIDIAArch, reg: str | None = None, captured: bool = True) strView on GitHub
classmethod build_pattern_stride(*, stride: StrideModifier | None = None, captured: bool = True) strView on GitHub
classmethod build_reg64_address(*, arch: NVIDIAArch, reg: str | None = None, offset: str | None = None, captured: bool = False) strView on GitHub

Address operand with .64 modifier appended to the register, such as:

[R1.64]
[R2.64+0x10]
[R14.64+UR6]
classmethod build_reg_address(*, arch: NVIDIAArch, reg: str | None = None, offset: str | None = None, captured: bool = False) strView on GitHub

Basic address operand, such as:

[R4]
[R2+0x10]
classmethod build_reg_stride_address(*, arch: NVIDIAArch, reg: str | None = None, offset: str | None = None, stride: StrideModifier | None = None, captured: bool = False) strView on GitHub

Address operand with stride modifier, such as:

[R49.X16]
[R2.X8+0x10]

As of reprospect.tools.architecture.NVIDIAFamily.HOPPER, it may be:

[R32+UR10+0x1c0]
classmethod build_shared_address(*, arch: NVIDIAArch, reg: str | None = None, offset: str | None = None, stride: StrideModifier | None = None, captured: bool = False) strView on GitHub

Shared memory address operand.

desc_ureg: str | None
match(address: str) GenericOrGlobalAddressMatch | SharedAddressMatch | LocalAddressMatch | NoneView on GitHub
memory: MemorySpace
offset: str | None
pattern: Pattern[str]
reg: str | None
stride: StrideModifier | None
class reprospect.test.sass.instruction.AnyMatcherView on GitHub

Bases: PatternMatcher

Match any instruction.

Note

The instruction is decomposed into its components.

Warning

As explained in https://github.com/cloudcores/CuAssembler/blob/96a9f72baf00f40b9b299653fcef8d3e2b4a3d49/CuAsm/CuInsParser.py#L251-LL258, nearly all operands are comma-separated. Notable exceptions:

RET.REL.NODEC R10 0x0
>>> from reprospect.test.sass.instruction import AnyMatcher
>>> AnyMatcher().match(inst = 'FADD.FTZ.RN R0, R1, R2')
InstructionMatch(opcode='FADD', modifiers=('FTZ', 'RN'), operands=('R0', 'R1', 'R2'), predicate=None, additional=None)
>>> AnyMatcher().match(inst = 'RET.REL.NODEC R4 0x0')
InstructionMatch(opcode='RET', modifiers=('REL', 'NODEC'), operands=('R4', '0x0'), predicate=None, additional=None)
PATTERN: Final[Pattern[str]] = regex.Regex('(?:(?P<predicate>@!?U?P(?:T|[0-9]+)))?\\s*(?P<opcode>[A-Z0-9]+)(?:\\.(?P<modifiers>[A-Z0-9_]+))*\\s*(?:(?P<operands>[\\w!\\.\\[\\]\\+\\-\\|~]+)(?:,?\\s*(?P<operands>[\\w!\\.\\[\\]\\+\\-\\|~]+))*)?', flags=regex.V0)
__init__() NoneView on GitHub
pattern: Final[Pattern[str]]
class reprospect.test.sass.instruction.ArchitectureAndVersionAwarePatternMatcher(arch: NVIDIAArch, version: Version | None = None)View on GitHub

Bases: ArchitectureAwarePatternMatcher

Base class for matchers that generate patterns based on CUDA version and architecture.

Note

The CUDA version is defaulted to the CUDA_VERSION environment variable. However, it must be noted that it is expected to be the version of ptxas.

The version is not always needed, but is useful for some SASS instructions that changed over the course of CUDA ISA evolution. For instance, under CUDA 12.6, an atomic add for int (at block scope) translates to:

ATOM.E.ADD.STRONG.CTA PT, RZ, [R2], R5

whereas for CUDA 12.8.1 or 13.0.0, it translates to:

ATOM.E.ADD.S32.STRONG.CTA PT, RZ, [R2], R5
__init__(arch: NVIDIAArch, version: Version | None = None) NoneView on GitHub
pattern: Final[Pattern[str]]
class reprospect.test.sass.instruction.ArchitectureAwarePatternMatcher(arch: NVIDIAArch)View on GitHub

Bases: PatternMatcher

Base class for matchers that generate patterns based on architecture.

__init__(arch: NVIDIAArch) NoneView on GitHub
pattern: Final[Pattern[str]]
class reprospect.test.sass.instruction.AtomicMatcher(arch: NVIDIAArch, operation: str = 'ADD', scope: ThreadScope | str | None = None, consistency: str = 'STRONG', dtype: tuple[str | None, int] | None = None, memory: MemorySpace | str = MemorySpace.GLOBAL, version: Version | None = None)View on GitHub

Bases: ArchitectureAndVersionAwarePatternMatcher

Matcher for atomic operations on:

  • generic memory (ATOM)

  • shared memory (ATOMS)

  • global memory (ATOMG)

Unlike RED, these operations capture the return value.

The ATOM opcode may take several modifiers:

References:

TEMPLATE: Final[str] = '{opcode} (?P<operands>P(?:T|\\d+)), (?P<operands>R(?:Z|\\d+)), {address}, (?P<operands>R(?:Z|\\d+))'
TEMPLATE_CAS: Final[str] = '{opcode} (?P<operands>P(?:T|\\d+)), (?P<operands>R(?:Z|\\d+)), {address}, (?P<operands>R[0-9]+), (?P<operands>R[0-9]+)'
__init__(arch: NVIDIAArch, operation: str = 'ADD', scope: ThreadScope | str | None = None, consistency: str = 'STRONG', dtype: tuple[str | None, int] | None = None, memory: MemorySpace | str = MemorySpace.GLOBAL, version: Version | None = None) NoneView on GitHub
Parameters:

dtype – For instance, (‘F’, 64) for a 64-bit floating-point or (S, 32) for a signed 32-bit integer.

consistency: Final[str]
dtype: Final[tuple[str | None, int] | None]
memory: Final[MemorySpace]
operation: Final[str]
scope: Final[str | None]
class reprospect.test.sass.instruction.BranchMatcher(offset: str | None = None, predicate: str | None = None)View on GitHub

Bases: PatternMatcher

Matcher for a BRA branch instruction.

Typically:

@!UP5 BRA 0x456
PATTERN: Final[Pattern[str]] = regex.Regex('(?:(?P<predicate>@!?U?P(?:T|[0-9]+)))?\\s*(?P<opcode>BRA)\\s*(?P<operands>0x[0-9A-Fa-f]+)', flags=regex.V0)
__init__(offset: str | None = None, predicate: str | None = None) NoneView on GitHub
pattern: Final[Pattern[str]]
class reprospect.test.sass.instruction.ConstantMatch(bank: str, offset: str, math: MathModifier | None = None)View on GitHub

Bases: object

Result of matching a constant memory location.

__init__(bank: str, offset: str, math: MathModifier | None = None) None
bank: str
math: MathModifier | None
offset: str
classmethod parse(bits: Match[str]) ConstantMatchView on GitHub
class reprospect.test.sass.instruction.ConstantMatcher(*, bank: str | None = None, offset: str | None = None, math: MathModifier | None = None)View on GitHub

Bases: object

Matcher for a constant memory location.

__init__(*, bank: str | None = None, offset: str | None = None, math: MathModifier | None = None) None

Method generated by attrs for class ConstantMatcher.

bank: str | None
classmethod build_pattern(*, bank: str | None = None, offset: str | None = None, math: MathModifier | None = None, captured: bool = True, capture_bank: bool = False, capture_offset: bool = False, capture_modifier_math: bool = False) strView on GitHub
match(constant: str) ConstantMatch | NoneView on GitHub
math: MathModifier | None
offset: str | None
pattern: Pattern[str]
class reprospect.test.sass.instruction.Fp32AddMatcherView on GitHub

Bases: PatternMatcher

Matcher for 32-bit floating-point add (FADD) instructions.

PATTERN: Final[Pattern[str]] = regex.Regex('(?P<opcode>FADD)(?:\\.(?P<modifiers>FTZ))?\\s*(?P<operands>(?P<dst>R[0-9]+)),?\\s*(?P<operands>(?:(?:!|\\-\\||\\-|\\~|\\|))?R(?:Z|\\d+)(?:\\|)?),?\\s*(?P<operands>(?:(?:(?:!|\\-\\||\\-|\\~|\\|))?R(?:Z|\\d+)(?:\\|)?|UR[0-9]+|c\\[0x[0-9]+\\]\\[(?:0x[0-9A-Fa-f]+|R(?:Z|\\d+)|UR[0-9]+)\\]|(?:-?\\d+)(?:\\.\\d*)?(?:[eE][-+]?\\d+)?))', flags=regex.V0)
__init__() NoneView on GitHub
pattern: Final[Pattern[str]]
class reprospect.test.sass.instruction.Fp64AddMatcherView on GitHub

Bases: PatternMatcher

Matcher for 64-bit floating-point add (DADD) instructions.

PATTERN: Final[Pattern[str]] = regex.Regex('(?P<opcode>DADD)(?:\\.(?P<modifiers>FTZ))?\\s*(?P<operands>(?P<dst>R[0-9]+)),?\\s*(?P<operands>(?:(?:!|\\-\\||\\-|\\~|\\|))?R(?:Z|\\d+)(?:\\|)?),?\\s*(?P<operands>(?:(?:(?:!|\\-\\||\\-|\\~|\\|))?R(?:Z|\\d+)(?:\\|)?|UR[0-9]+|c\\[0x[0-9]+\\]\\[(?:0x[0-9A-Fa-f]+|R(?:Z|\\d+)|UR[0-9]+)\\]|(?:-?\\d+)(?:\\.\\d*)?(?:[eE][-+]?\\d+)?))', flags=regex.V0)
__init__() NoneView on GitHub
pattern: Final[Pattern[str]]
class reprospect.test.sass.instruction.GenericOrGlobalAddressMatch(reg: str, offset: str | None = None, desc_ureg: str | None = None)View on GitHub

Bases: object

Generic or global address operand, such as:

desc[UR42][R8+0xf1]
__init__(reg: str, offset: str | None = None, desc_ureg: str | None = None) None
desc_ureg: str | None

reprospect.tools.sass.decode.RegisterType.UGPR from cache policy descriptor.

offset: str | None
classmethod parse(bits: Match[str]) GenericOrGlobalAddressMatchView on GitHub
reg: str
class reprospect.test.sass.instruction.InstructionMatch(opcode: str, modifiers: tuple[str, ...], operands: tuple[str, ...], predicate: str | None = None, additional: dict[str, list[str]] | None = None)View on GitHub

Bases: object

An instruction with parsed components.

__init__(opcode: str, modifiers: tuple[str, ...], operands: tuple[str, ...], predicate: str | None = None, additional: dict[str, list[str]] | None = None) None
additional: dict[str, list[str]] | None
modifiers: tuple[str, ...]
opcode: str
operands: tuple[str, ...]
static parse(*, bits: Match[str]) InstructionMatchView on GitHub

The only mandatory capture group is opcode.

predicate: str | None
class reprospect.test.sass.instruction.InstructionMatcherView on GitHub

Bases: ABC

Abstract base class for instruction matchers.

abstractmethod match(inst: Instruction | str) InstructionMatch | NoneView on GitHub

Check if the instruction matches.

class reprospect.test.sass.instruction.LoadConstantMatcher(*, uniform: bool | None = None, size: int | None = None)View on GitHub

Bases: PatternMatcher

Matcher for constant load (LDC) instructions, such as:

LDC.64 R2, c[0x0][0x388]
LDC R4, c[0x3][R0]
LDCU UR4, c[0x3][UR0]
CONSTANT: Final[str] = '(?P<operands>(?:(?:!|\\-\\||\\-|\\~|\\|))?c\\[(?P<bank>0x[0-9]+)\\]\\[(?P<offset>(?:0x[0-9A-Fa-f]+|R(?:Z|\\d+)|UR[0-9]+))\\])'
TEMPLATE: Final[str] = '{opcode} {dest}, (?P<operands>(?:(?:!|\\-\\||\\-|\\~|\\|))?c\\[(?P<bank>0x[0-9]+)\\]\\[(?P<offset>(?:0x[0-9A-Fa-f]+|R(?:Z|\\d+)|UR[0-9]+))\\])'
__init__(*, uniform: bool | None = None, size: int | None = None) NoneView on GitHub
Parameters:
  • size – Optional bit size (e.g., 32, 64, 128).

  • uniform – Optionally require uniformness.

pattern: Final[regex.Pattern[str]]
class reprospect.test.sass.instruction.LoadGlobalMatcher(arch: NVIDIAArch, *, size: int | None = None, readonly: bool | None = None, extend: ExtendBitsMethod | str | None = None)View on GitHub

Bases: LoadMatcher

Specialization of LoadMatcher for global memory (LDG).

__init__(arch: NVIDIAArch, *, size: int | None = None, readonly: bool | None = None, extend: ExtendBitsMethod | str | None = None) NoneView on GitHub
cache: str | ZeroOrOne | None
mop: Final[MemoryOp]
class reprospect.test.sass.instruction.LoadMatcher(arch: NVIDIAArch, *, size: int | None = None, readonly: bool | None = None, memory: MemorySpace | str = MemorySpace.GLOBAL, extend: ExtendBitsMethod | str | None = None)View on GitHub

Bases: ArchitectureAwarePatternMatcher

Architecture-dependent matcher for load instructions, such as:

LDG.E R2, desc[UR6][R2.64]
LD.E.64 R2, R4.64

Starting from BLACKWELL, 256-bit load instructions are available, such as:

LDG.E.ENL2.256.CONSTANT R12, R8, desc[UR4][R2.64]

References:

TEMPLATE: Final[str] = '{opcode} (?P<operands>R[0-9]+), {address}'
TEMPLATE_256: Final[str] = '{opcode} (?P<operands>R[0-9]+), (?P<operands>R[0-9]+), {address}'
__init__(arch: NVIDIAArch, *, size: int | None = None, readonly: bool | None = None, memory: MemorySpace | str = MemorySpace.GLOBAL, extend: ExtendBitsMethod | str | None = None) NoneView on GitHub
Parameters:
  • size – Optional bit size (e.g., 32, 64, 128).

  • readonly – Whether to append .CONSTANT modifier. If None, the modifier is matched optionally.

cache: str | ZeroOrOne | None
mop: Final[MemoryOp]
class reprospect.test.sass.instruction.LocalAddressMatch(reg: str, offset: str | None = None)View on GitHub

Bases: object

Local address operand, such as:

[R47]
__init__(reg: str, offset: str | None = None) None
offset: str | None
classmethod parse(bits: Match[str]) SelfView on GitHub
reg: str
class reprospect.test.sass.instruction.OpcodeModsMatcher(*, opcode: str, modifiers: Iterable[str | int | ZeroOrOne] | None = None, operands: bool = True)View on GitHub

Bases: PatternMatcher

Matcher that will collect all operands of an instruction.

Useful when the opcode and modifiers are known and the operands may need to be retrieved.

>>> from reprospect.test.sass.instruction import OpcodeModsMatcher
>>> OpcodeModsMatcher(opcode = 'ISETP', modifiers = ('NE', 'AND')).match(
...     'ISETP.NE.AND P2, PT, R4, RZ, PT'
... )
InstructionMatch(opcode='ISETP', modifiers=('NE', 'AND'), operands=('P2', 'PT', 'R4', 'RZ', 'PT'), predicate=None, additional=None)
__init__(*, opcode: str, modifiers: Iterable[str | int | ZeroOrOne] | None = None, operands: bool = True) NoneView on GitHub
pattern: Final[Pattern[str]]
class reprospect.test.sass.instruction.OpcodeModsWithOperandsMatcher(*, opcode: str, modifiers: Iterable[str | int | ZeroOrOne] | None = None, operands: Iterable[str | ZeroOrOne] | None = None)View on GitHub

Bases: PatternMatcher

Matcher that matches a given instruction and operands.

Similar to OpcodeModsMatcher, but the operands can be better constrained.

>>> from reprospect.test.sass.instruction import OpcodeModsWithOperandsMatcher, PatternBuilder
>>> from reprospect.test.sass.instruction.register import Register
>>> OpcodeModsWithOperandsMatcher(
...     opcode = 'ISETP',
...     modifiers = ('NE', 'AND'),
...     operands = (
...         Register.PRED,
...         Register.PREDT,
...         'R4',
...         Register.REGZ,
...         Register.PREDT,
...     )
... ).match('ISETP.NE.AND P2, PT, R4, RZ, PT')
InstructionMatch(opcode='ISETP', modifiers=('NE', 'AND'), operands=('P2', 'PT', 'R4', 'RZ', 'PT'), predicate=None, additional=None)

Note

Some operands can be optionally matched.

>>> from reprospect.test.sass.instruction import OpcodeModsWithOperandsMatcher, PatternBuilder
>>> from reprospect.test.sass.instruction.instruction import ZeroOrOne
>>> matcher = OpcodeModsWithOperandsMatcher(opcode = 'WHATEVER', operands = (
...     ZeroOrOne('R0'),
...     ZeroOrOne('R9'),
... ))
>>> matcher.match('WHATEVER')
InstructionMatch(opcode='WHATEVER', modifiers=(), operands=(), predicate=None, additional=None)
>>> matcher.match('WHATEVER R0')
InstructionMatch(opcode='WHATEVER', modifiers=(), operands=('R0',), predicate=None, additional=None)
>>> matcher.match('WHATEVER R0, R9')
InstructionMatch(opcode='WHATEVER', modifiers=(), operands=('R0', 'R9'), predicate=None, additional=None)
__init__(*, opcode: str, modifiers: Iterable[str | int | ZeroOrOne] | None = None, operands: Iterable[str | ZeroOrOne] | None = None) NoneView on GitHub
pattern: Final[Pattern[str]]
class reprospect.test.sass.instruction.PatternBuilderView on GitHub

Bases: object

Helper class to build patterns for instruction components.

HEXADECIMAL: Final[str] = '0x[0-9A-Fa-f]+'
static any(*args: str) strView on GitHub

Build a pattern matching any of args.

static group(s: int | str, group: str) strView on GitHub

Wrap a pattern in a named capture group.

static groups(s: int | str, groups: Iterable[str]) strView on GitHub

Wrap a pattern in named capture groups.

static zero_or_more(s: str) strView on GitHub

Build an optional non-capturing pattern that matches zero or more occurrences of the given pattern.

static zero_or_one(s: str) strView on GitHub

Build an optional non-capturing pattern that matches zero or one occurrence of the given pattern.

class reprospect.test.sass.instruction.PatternMatcher(pattern: str | Pattern[str])View on GitHub

Bases: InstructionMatcher

Regex-based (or pattern) matching.

Note

It is not decorated with dataclasses.dataclass() because of https://github.com/mypyc/mypyc/issues/1061.

__init__(pattern: str | Pattern[str]) NoneView on GitHub
classmethod build_pattern(*, opcode: str | None = None, modifiers: Iterable[str | int | ZeroOrOne] | None = None, operands: Iterable[str | ZeroOrOne] | None = None, predicate: str | bool | None = None) strView on GitHub
classmethod build_pattern_operands(operands: Iterable[str | ZeroOrOne] | None = None, *, captured: bool = True) str | NoneView on GitHub

Build an operands pattern.

Join multiple operands with a reprospect.test.sass.instruction.instruction.OPERAND_SEPARATOR separator. Operands wrapped in a reprospect.test.sass.instruction.instruction.ZeroOrOne instance are matched optionally.

match(inst: Instruction | str) InstructionMatch | NoneView on GitHub
pattern: Final[Pattern[str]]
class reprospect.test.sass.instruction.ReductionMatcher(arch: NVIDIAArch, operation: str = 'ADD', scope: ThreadScope | str | None = None, consistency: str = 'STRONG', dtype: tuple[str, int] | None = None)View on GitHub

Bases: ArchitectureAwarePatternMatcher

Matcher for reduction operations on generic memory (RED).

RED instructions are typically used when the atomic operation return value is not used. Otherwise, it would typically map to ATOM.

The RED opcode may take several modifiers:

References:

TEMPLATE: Final[str] = '{opcode} {address}, (?P<operands>R[0-9]+)'
__init__(arch: NVIDIAArch, operation: str = 'ADD', scope: ThreadScope | str | None = None, consistency: str = 'STRONG', dtype: tuple[str, int] | None = None) NoneView on GitHub
Parameters:

dtype – For instance, (‘F’, 64) for a 64-bit floating-point or (S, 32) for a signed 32-bit integer.

consistency: Final[str]
dtype: Final[tuple[str, int] | None]
operation: Final[str]
scope: Final[str | None]
class reprospect.test.sass.instruction.RegisterMatch(rtype: RegisterType, index: int = -1, reuse: bool = False, math: MathModifier | None = None)View on GitHub

Bases: object

If index is set to a negative value, it is a special register (e.g. RZ if rtype is reprospect.tools.sass.decode.RegisterType.GPR).

__init__(rtype: RegisterType, index: int = -1, reuse: bool = False, math: MathModifier | None = None) None
index: int
math: MathModifier | None
classmethod parse(bits: Match[str]) RegisterMatchView on GitHub
reuse: bool
rtype: RegisterType
class reprospect.test.sass.instruction.RegisterMatcher(*, rtype: RegisterType | None = None, special: bool | None = None, index: int | None = None, reuse: bool | None = None, math: MathModifier | bool | None = None)View on GitHub

Bases: object

Matcher for a register.

__init__(*, rtype: RegisterType | None = None, special: bool | None = None, index: int | None = None, reuse: bool | None = None, math: MathModifier | bool | None = None) None

Method generated by attrs for class RegisterMatcher.

classmethod build_pattern(*, rtype: RegisterType | None = None, special: bool | None = None, index: int | None = None, reuse: bool | None = None, math: MathModifier | bool | None = None, captured: bool = True, capture_math: bool = False, capture_reg: bool = False, capture_reuse: bool = False) strView on GitHub
classmethod build_pattern_modifier_math(*, math: MathModifier | bool | None = None, captured: bool = True) str | NoneView on GitHub
classmethod build_pattern_modifier_reuse(*, reuse: bool | None = None, captured: bool = True) str | NoneView on GitHub
classmethod build_pattern_reg(*, rtype: RegisterType | None = None, special: bool | None = None, index: int | None = None, captured: bool = True) strView on GitHub
index: int | None
match(reg: str) RegisterMatch | NoneView on GitHub
math: MathModifier | bool | None
pattern: Pattern[str]
reuse: bool | None
rtype: RegisterType | None
special: bool | None
class reprospect.test.sass.instruction.SharedAddressMatch(reg: str | None = None, offset: str | None = None, stride: StrideModifier | None = None)View on GitHub

Bases: object

Shared address operand, such as:

[R25.X8+0x800]
[0x10]
__init__(reg: str | None = None, offset: str | None = None, stride: StrideModifier | None = None) None
offset: str | None
classmethod parse(bits: Match[str]) SharedAddressMatchView on GitHub
reg: str | None
stride: StrideModifier | None
class reprospect.test.sass.instruction.StoreGlobalMatcher(arch: NVIDIAArch, size: int | None = None, extend: ExtendBitsMethod | str | None = None)View on GitHub

Bases: StoreMatcher

Specialization of StoreMatcher for global memory (STG).

__init__(arch: NVIDIAArch, size: int | None = None, extend: ExtendBitsMethod | str | None = None) NoneView on GitHub
mop: Final[MemoryOp]
class reprospect.test.sass.instruction.StoreMatcher(arch: NVIDIAArch, size: int | None = None, memory: MemorySpace | str = MemorySpace.GLOBAL, extend: ExtendBitsMethod | str | None = None)View on GitHub

Bases: ArchitectureAwarePatternMatcher

Architecture-dependent matcher for global store instructions, such as:

STG.E desc[UR6][R6.64], R15
ST.E.64 R4.64, R2

Starting from BLACKWELL, 256-bit store instructions are available, such as:

STG.E.ENL2.256 desc[UR4][R4.64], R8, R12
TEMPLATE: Final[str] = '{opcode} {address}, (?P<operands>R[0-9]+)'
TEMPLATE_256: Final[str] = '{opcode} {address}, (?P<operands>R[0-9]+), (?P<operands>R[0-9]+)'
__init__(arch: NVIDIAArch, size: int | None = None, memory: MemorySpace | str = MemorySpace.GLOBAL, extend: ExtendBitsMethod | str | None = None) NoneView on GitHub
Parameters:

size – Optional bit size (e.g., 32, 64, 128).

mop: Final[MemoryOp]

Submodules