Skip to main content

parse_xreg

Function parse_xreg 

Source
pub fn parse_xreg(raw: &str) -> Option<String>
Expand description

Parse a raw operand string into a canonical AArch64 GPR name.

Accepts the textual forms r2 emits (x0, w0, xzr, wzr, optional whitespace, optional , from the operand splitter) and returns the lower-cased canonical name. Returns None for the stack-pointer aliases (sp, wsp) — patching them is unsafe in the general case (function epilogues, frame setup), and for any other shape (SIMD registers, memory operands, immediates).