Skip to main content

Module args

Module args 

Source
Expand description

Instruction argument decoding (JAM Gray Paper Appendix A.5).

Handles register extraction, immediate decoding, and sign extension. Cherry-picked verbatim from v2 javm/src/args.rs. Pure decoding; no cap awareness.

Enums§

Args
Decoded instruction arguments.

Functions§

decode_args
Decode arguments based on instruction category.
decode_le
Decode a little-endian unsigned integer from a byte slice (E_l⁻¹).
read_le_imm
Read n bytes from code at offset as little-endian u64 (no sign extension). Public for use by the recompiler’s inline decode path (e.g., OneRegExtImm).
read_signed_imm
Read n bytes from code at offset, sign-extend, and return as u64. Public for use by the recompiler’s inline decode path.
sign_extend
Sign-extend a value from n bytes to 64 bits (eq A.16: Xₙ).
sign_extend_32
Sign-extend from 32 bits to 64 bits (X₄).
to_signed
Signed interpretation of a 64-bit register value (eq A.10: Z₈).
to_unsigned
Unsigned interpretation of a signed value (eq A.11: Z₈⁻¹).