Skip to main content

reg_resize_to_opsz

Function reg_resize_to_opsz 

Source
pub unsafe extern "C" fn reg_resize_to_opsz(
    reg: reg_id_t,
    sz: opnd_size_t,
) -> reg_id_t
Expand description

Given a general-purpose or SIMD register of any size, returns a register in the same class of the given size.

For example, given \p DR_REG_AX or \p DR_REG_RAX and \p OPSZ_1, this routine will return \p DR_REG_AL. Given \p DR_REG_XMM0 and \p OPSZ_64, it will return \p DR_REG_ZMM0.

Returns \p DR_REG_NULL when trying to get the 8-bit subregister of \p DR_REG_ESI, \p DR_REG_EDI, \p DR_REG_EBP, or \p DR_REG_ESP in 32-bit mode. For 64-bit versions of this library, if \p sz == OPSZ_8, returns the 64-bit version of \p reg.

MMX registers are not yet supported. Moreover, ARM is not yet supported for resizing SIMD registers.