pub struct Ins {
pub code: u32,
pub op: Opcode,
}Expand description
A PowerPC instruction.
Fields§
§code: u32§op: OpcodeImplementations§
Source§impl Ins
impl Ins
Sourcepub fn new(code: u32, extensions: Extensions) -> Self
pub fn new(code: u32, extensions: Extensions) -> Self
Create a new instruction from its raw code.
Sourcepub fn parse_simplified(self, out: &mut ParsedIns)
pub fn parse_simplified(self, out: &mut ParsedIns)
Parse the instruction into a simplified mnemonic, if any match.
Sourcepub fn simplified(self) -> ParsedIns
pub fn simplified(self) -> ParsedIns
Returns the simplified form of the instruction, if any match.
Sourcepub fn parse_basic(self, out: &mut ParsedIns)
pub fn parse_basic(self, out: &mut ParsedIns)
Parse the instruction into its basic form.
Sourcepub fn parse_defs(self, out: &mut Arguments)
pub fn parse_defs(self, out: &mut Arguments)
Emits all registers defined by the instruction into the given argument list.
Sourcepub fn parse_uses(self, out: &mut Arguments)
pub fn parse_uses(self, out: &mut Arguments)
Emits all registers used by the instruction into the given argument list.
Sourcepub fn branch_offset(&self) -> Option<i32>
pub fn branch_offset(&self) -> Option<i32>
Returns the relative branch offset of the instruction, if any.
Sourcepub fn branch_dest(&self, addr: u32) -> Option<u32>
pub fn branch_dest(&self, addr: u32) -> Option<u32>
Returns the absolute branch destination of the instruction, if any.
Sourcepub fn is_direct_branch(&self) -> bool
pub fn is_direct_branch(&self) -> bool
Whether the instruction is a direct branch.
Sourcepub fn is_unconditional_branch(&self) -> bool
pub fn is_unconditional_branch(&self) -> bool
Whether the instruction is an unconditional branch.
Sourcepub fn is_conditional_branch(&self) -> bool
pub fn is_conditional_branch(&self) -> bool
Whether the instruction is a conditional branch.
Source§impl Ins
impl Ins
Sourcepub const fn field_simm(&self) -> i16
pub const fn field_simm(&self) -> i16
simm: Signed Immediate
Sourcepub const fn field_uimm(&self) -> u16
pub const fn field_uimm(&self) -> u16
uimm: Unsigned Immediate
Sourcepub const fn field_offset(&self) -> i16
pub const fn field_offset(&self) -> i16
offset: Branch Offset
Sourcepub const fn field_crbd(&self) -> u8
pub const fn field_crbd(&self) -> u8
crbD: Condition Register Bit Destination
Sourcepub const fn field_crba(&self) -> u8
pub const fn field_crba(&self) -> u8
crbA: Condition Register Bit A
Sourcepub const fn field_crbb(&self) -> u8
pub const fn field_crbb(&self) -> u8
crbB: Condition Register Bit B
Sourcepub const fn field_crfd(&self) -> u8
pub const fn field_crfd(&self) -> u8
crfD: Condition Register Field Destination
Sourcepub const fn field_crfs(&self) -> u8
pub const fn field_crfs(&self) -> u8
crfS: Condition Register Field Source
Sourcepub const fn field_mtfsf_fm(&self) -> u8
pub const fn field_mtfsf_fm(&self) -> u8
mtfsf_FM: Field Mask for mtfsf
Sourcepub const fn field_mtfsf_imm(&self) -> u8
pub const fn field_mtfsf_imm(&self) -> u8
mtfsf_IMM: Immediate for mtfsfi
Sourcepub const fn field_spr_sprg(&self) -> u8
pub const fn field_spr_sprg(&self) -> u8
spr_SPRG: SPRG index for m[tf]sprg
Sourcepub const fn field_spr_bat(&self) -> u8
pub const fn field_spr_bat(&self) -> u8
spr_BAT: IBAT/DBAT index for m[tf][id]bat[ul]
Sourcepub const fn field_sync_l(&self) -> u8
pub const fn field_sync_l(&self) -> u8
sync_L: L field for sync
Sourcepub const fn field_ds(&self) -> i16
pub const fn field_ds(&self) -> i16
ds: Load/Store Double Word Offset (for 64-bit instructions)
Sourcepub const fn field_sh64(&self) -> u8
pub const fn field_sh64(&self) -> u8
SH64: Shift Amount (for 64-bit instructions)
Sourcepub const fn field_mb64(&self) -> u8
pub const fn field_mb64(&self) -> u8
MB64: Mask Begin (for 64-bit instructions)
Sourcepub const fn field_me64(&self) -> u8
pub const fn field_me64(&self) -> u8
ME64: Mask End (for 64-bit instructions)
Sourcepub const fn field_mtmsrd_l(&self) -> u8
pub const fn field_mtmsrd_l(&self) -> u8
mtmsrd_L: L field for mtmsrd
Sourcepub const fn field_ps_offset(&self) -> i16
pub const fn field_ps_offset(&self) -> i16
ps_offset: Paired Single Offset
Sourcepub const fn field_ps_i(&self) -> u8
pub const fn field_ps_i(&self) -> u8
ps_I
Sourcepub const fn field_ps_ix(&self) -> u8
pub const fn field_ps_ix(&self) -> u8
ps_IX
Sourcepub const fn field_ps_w(&self) -> u8
pub const fn field_ps_w(&self) -> u8
ps_W
Sourcepub const fn field_ps_wx(&self) -> u8
pub const fn field_ps_wx(&self) -> u8
ps_WX
Sourcepub const fn field_vsimm(&self) -> i8
pub const fn field_vsimm(&self) -> i8
vsimm: Vector Signed Immediate
Sourcepub const fn field_vuimm(&self) -> u8
pub const fn field_vuimm(&self) -> u8
vuimm: Vector Unsigned Immediate
Sourcepub const fn field_ds_a(&self) -> u8
pub const fn field_ds_a(&self) -> u8
ds_A: All field for ds instructions
Sourcepub const fn field_strm(&self) -> u8
pub const fn field_strm(&self) -> u8
STRM: Stream ID
Sourcepub const fn field_vds128(&self) -> u8
pub const fn field_vds128(&self) -> u8
VDS128: VMX128 Source/Dest Register
Sourcepub const fn field_va128(&self) -> u8
pub const fn field_va128(&self) -> u8
VA128: VMX128 Register A
Sourcepub const fn field_vb128(&self) -> u8
pub const fn field_vb128(&self) -> u8
VB128: VMX128 Register B
Sourcepub const fn field_vc128(&self) -> u8
pub const fn field_vc128(&self) -> u8
VC128: VMX128 Register C
Sourcepub const fn field_perm(&self) -> u8
pub const fn field_perm(&self) -> u8
PERM: VMX128 Permutation
Sourcepub const fn field_d3dtype(&self) -> u8
pub const fn field_d3dtype(&self) -> u8
D3DType: the packed data type
Sourcepub const fn field_vmask(&self) -> u8
pub const fn field_vmask(&self) -> u8
VMASK: the pack mask
Sourcepub const fn field_zimm(&self) -> u8
pub const fn field_zimm(&self) -> u8
Zimm: amount to rotate/shift left
Sourcepub const fn field_oe(&self) -> bool
pub const fn field_oe(&self) -> bool
OE: Field used by XO-form instructions to enable setting OV and SO in the XER.
Sourcepub const fn field_bp_nd(&self) -> bool
pub const fn field_bp_nd(&self) -> bool
BP_ND: Predict branch to be taken (implicit dest for LR/CTR)
Sourcepub const fn field_rcav(&self) -> bool
pub const fn field_rcav(&self) -> bool
RcAV: Record Bit (AltiVec)
Sourcepub const fn field_rc128(&self) -> bool
pub const fn field_rc128(&self) -> bool
Rc128: Record Bit (VMX128)