use super::iced_constants::IcedConstants;
use super::iced_error::IcedError;
#[cfg(feature = "instr_info")]
use super::info::enums::*;
use super::*;
#[cfg(all(not(any(feature = "gas", feature = "intel", feature = "masm", feature = "nasm")), feature = "fast_fmt"))]
#[cfg(not(feature = "std"))]
use alloc::string::String;
#[cfg(any(feature = "gas", feature = "intel", feature = "masm", feature = "nasm", feature = "fast_fmt"))]
use core::fmt;
use core::hash::{Hash, Hasher};
#[cfg(feature = "encoder")]
use core::ptr;
use core::{mem, slice, u16, u32, u64};
pub(crate) struct MemoryFlags;
#[allow(dead_code)]
impl MemoryFlags {
pub(crate) const SCALE_MASK: u32 = 0x0000_0003;
pub(crate) const DISPL_SIZE_SHIFT: u32 = 0x0000_0002;
pub(crate) const DISPL_SIZE_MASK: u32 = 0x0000_0007;
pub(crate) const SEGMENT_PREFIX_SHIFT: u32 = 0x0000_0005;
pub(crate) const SEGMENT_PREFIX_MASK: u32 = 0x0000_0007;
pub(crate) const BROADCAST: u32 = 0x0000_8000;
}
pub(crate) struct OpKindFlags;
#[allow(dead_code)]
impl OpKindFlags {
pub(crate) const OP_KIND_BITS: u32 = 0x0000_0005;
pub(crate) const OP_KIND_MASK: u32 = 0x0000_001F;
pub(crate) const OP1_KIND_SHIFT: u32 = 0x0000_0005;
pub(crate) const OP2_KIND_SHIFT: u32 = 0x0000_000A;
pub(crate) const OP3_KIND_SHIFT: u32 = 0x0000_000F;
pub(crate) const DATA_LENGTH_MASK: u32 = 0x0000_000F;
pub(crate) const DATA_LENGTH_SHIFT: u32 = 0x0000_0014;
pub(crate) const CODE_SIZE_MASK: u32 = 0x0000_0003;
pub(crate) const CODE_SIZE_SHIFT: u32 = 0x0000_001E;
pub(crate) const EQUALS_IGNORE_MASK: u32 = 0xC000_0000;
}
pub(crate) struct CodeFlags;
#[allow(dead_code)]
impl CodeFlags {
pub(crate) const CODE_BITS: u32 = 0x0000_000D;
pub(crate) const CODE_MASK: u32 = 0x0000_1FFF;
pub(crate) const ROUNDING_CONTROL_MASK: u32 = 0x0000_0007;
pub(crate) const ROUNDING_CONTROL_SHIFT: u32 = 0x0000_000D;
pub(crate) const OP_MASK_MASK: u32 = 0x0000_0007;
pub(crate) const OP_MASK_SHIFT: u32 = 0x0000_0010;
pub(crate) const INSTR_LENGTH_MASK: u32 = 0x0000_000F;
pub(crate) const INSTR_LENGTH_SHIFT: u32 = 0x0000_0013;
pub(crate) const SUPPRESS_ALL_EXCEPTIONS: u32 = 0x0200_0000;
pub(crate) const ZEROING_MASKING: u32 = 0x0400_0000;
pub(crate) const XACQUIRE_PREFIX: u32 = 0x0800_0000;
pub(crate) const XRELEASE_PREFIX: u32 = 0x1000_0000;
pub(crate) const REPE_PREFIX: u32 = 0x2000_0000;
pub(crate) const REPNE_PREFIX: u32 = 0x4000_0000;
pub(crate) const LOCK_PREFIX: u32 = 0x8000_0000;
pub(crate) const EQUALS_IGNORE_MASK: u32 = 0x0078_0000;
}
#[derive(Debug, Default, Copy, Clone)]
pub struct Instruction {
pub(crate) next_rip: u64,
pub(crate) code_flags: u32,
pub(crate) op_kind_flags: u32,
pub(crate) immediate: u32,
pub(crate) mem_displ: u32,
pub(crate) memory_flags: u16,
pub(crate) mem_base_reg: u8,
pub(crate) mem_index_reg: u8,
pub(crate) reg0: u8,
pub(crate) reg1: u8,
pub(crate) reg2: u8,
pub(crate) reg3: u8,
}
#[cfg(test)]
pub(crate) const INSTRUCTION_TOTAL_SIZE: usize = 32;
#[cfg_attr(feature = "cargo-clippy", allow(clippy::len_without_is_empty))]
impl Instruction {
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn new() -> Self {
Instruction::default()
}
#[cfg_attr(has_must_use, must_use)]
#[allow(trivial_casts)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn eq_all_bits(&self, other: &Self) -> bool {
unsafe {
let a: *const u8 = self as *const Self as *const u8;
let b: *const u8 = other as *const Self as *const u8;
let sa = slice::from_raw_parts(a, mem::size_of::<Self>());
let sb = slice::from_raw_parts(b, mem::size_of::<Self>());
sa == sb
}
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn ip16(&self) -> u16 {
(self.next_rip as u16).wrapping_sub(self.len() as u16)
}
#[inline]
pub fn set_ip16(&mut self, new_value: u16) {
self.next_rip = (new_value as u64).wrapping_add(self.len() as u64);
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn ip32(&self) -> u32 {
(self.next_rip as u32).wrapping_sub(self.len() as u32)
}
#[inline]
pub fn set_ip32(&mut self, new_value: u32) {
self.next_rip = (new_value as u64).wrapping_add(self.len() as u64);
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn ip(&self) -> u64 {
self.next_rip.wrapping_sub(self.len() as u64)
}
#[inline]
pub fn set_ip(&mut self, new_value: u64) {
self.next_rip = new_value.wrapping_add(self.len() as u64);
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn next_ip16(&self) -> u16 {
self.next_rip as u16
}
#[inline]
pub fn set_next_ip16(&mut self, new_value: u16) {
self.next_rip = new_value as u64;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn next_ip32(&self) -> u32 {
self.next_rip as u32
}
#[inline]
pub fn set_next_ip32(&mut self, new_value: u32) {
self.next_rip = new_value as u64;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn next_ip(&self) -> u64 {
self.next_rip
}
#[inline]
pub fn set_next_ip(&mut self, new_value: u64) {
self.next_rip = new_value;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn code_size(&self) -> CodeSize {
unsafe { mem::transmute(((self.op_kind_flags >> OpKindFlags::CODE_SIZE_SHIFT) & OpKindFlags::CODE_SIZE_MASK) as u8) }
}
#[inline]
pub fn set_code_size(&mut self, new_value: CodeSize) {
self.op_kind_flags = (self.op_kind_flags & !(OpKindFlags::CODE_SIZE_MASK << OpKindFlags::CODE_SIZE_SHIFT))
| (((new_value as u32) & OpKindFlags::CODE_SIZE_MASK) << OpKindFlags::CODE_SIZE_SHIFT);
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn is_invalid(&self) -> bool {
const_assert_eq!(0, Code::INVALID as u32);
(self.code_flags & CodeFlags::CODE_MASK) == 0
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn code(&self) -> Code {
unsafe { mem::transmute((self.code_flags & CodeFlags::CODE_MASK) as u16) }
}
#[inline]
pub fn set_code(&mut self, new_value: Code) {
self.code_flags = (self.code_flags & !CodeFlags::CODE_MASK) | new_value as u32;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn mnemonic(&self) -> Mnemonic {
self.code().mnemonic()
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn op_count(&self) -> u32 {
unsafe { *instruction_op_counts::OP_COUNT.get_unchecked((self.code_flags & CodeFlags::CODE_MASK) as usize) as u32 }
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn len(&self) -> usize {
((self.code_flags >> CodeFlags::INSTR_LENGTH_SHIFT) & CodeFlags::INSTR_LENGTH_MASK) as usize
}
#[inline]
pub fn set_len(&mut self, new_value: usize) {
self.code_flags = (self.code_flags & !(CodeFlags::INSTR_LENGTH_MASK << CodeFlags::INSTR_LENGTH_SHIFT))
| (((new_value as u32) & CodeFlags::INSTR_LENGTH_MASK) << CodeFlags::INSTR_LENGTH_SHIFT);
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn has_xacquire_prefix(&self) -> bool {
(self.code_flags & CodeFlags::XACQUIRE_PREFIX) != 0
}
#[inline]
pub fn set_has_xacquire_prefix(&mut self, new_value: bool) {
if new_value {
self.code_flags |= CodeFlags::XACQUIRE_PREFIX;
} else {
self.code_flags &= !CodeFlags::XACQUIRE_PREFIX;
}
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn has_xrelease_prefix(&self) -> bool {
(self.code_flags & CodeFlags::XRELEASE_PREFIX) != 0
}
#[inline]
pub fn set_has_xrelease_prefix(&mut self, new_value: bool) {
if new_value {
self.code_flags |= CodeFlags::XRELEASE_PREFIX;
} else {
self.code_flags &= !CodeFlags::XRELEASE_PREFIX;
}
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn has_rep_prefix(&self) -> bool {
(self.code_flags & CodeFlags::REPE_PREFIX) != 0
}
#[inline]
pub fn set_has_rep_prefix(&mut self, new_value: bool) {
if new_value {
self.code_flags |= CodeFlags::REPE_PREFIX;
} else {
self.code_flags &= !CodeFlags::REPE_PREFIX;
}
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn has_repe_prefix(&self) -> bool {
(self.code_flags & CodeFlags::REPE_PREFIX) != 0
}
#[inline]
pub fn set_has_repe_prefix(&mut self, new_value: bool) {
if new_value {
self.code_flags |= CodeFlags::REPE_PREFIX;
} else {
self.code_flags &= !CodeFlags::REPE_PREFIX;
}
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn has_repne_prefix(&self) -> bool {
(self.code_flags & CodeFlags::REPNE_PREFIX) != 0
}
#[inline]
pub fn set_has_repne_prefix(&mut self, new_value: bool) {
if new_value {
self.code_flags |= CodeFlags::REPNE_PREFIX;
} else {
self.code_flags &= !CodeFlags::REPNE_PREFIX;
}
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn has_lock_prefix(&self) -> bool {
(self.code_flags & CodeFlags::LOCK_PREFIX) != 0
}
#[inline]
pub fn set_has_lock_prefix(&mut self, new_value: bool) {
if new_value {
self.code_flags |= CodeFlags::LOCK_PREFIX;
} else {
self.code_flags &= !CodeFlags::LOCK_PREFIX;
}
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn op0_kind(&self) -> OpKind {
unsafe { mem::transmute((self.op_kind_flags & OpKindFlags::OP_KIND_MASK) as u8) }
}
#[inline]
pub fn set_op0_kind(&mut self, new_value: OpKind) {
self.op_kind_flags = (self.op_kind_flags & !OpKindFlags::OP_KIND_MASK) | ((new_value as u32) & OpKindFlags::OP_KIND_MASK);
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn op1_kind(&self) -> OpKind {
unsafe { mem::transmute(((self.op_kind_flags >> OpKindFlags::OP1_KIND_SHIFT) & OpKindFlags::OP_KIND_MASK) as u8) }
}
#[inline]
pub fn set_op1_kind(&mut self, new_value: OpKind) {
self.op_kind_flags = (self.op_kind_flags & !(OpKindFlags::OP_KIND_MASK << OpKindFlags::OP1_KIND_SHIFT))
| (((new_value as u32) & OpKindFlags::OP_KIND_MASK) << OpKindFlags::OP1_KIND_SHIFT);
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn op2_kind(&self) -> OpKind {
unsafe { mem::transmute(((self.op_kind_flags >> OpKindFlags::OP2_KIND_SHIFT) & OpKindFlags::OP_KIND_MASK) as u8) }
}
#[inline]
pub fn set_op2_kind(&mut self, new_value: OpKind) {
self.op_kind_flags = (self.op_kind_flags & !(OpKindFlags::OP_KIND_MASK << OpKindFlags::OP2_KIND_SHIFT))
| (((new_value as u32) & OpKindFlags::OP_KIND_MASK) << OpKindFlags::OP2_KIND_SHIFT);
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn op3_kind(&self) -> OpKind {
unsafe { mem::transmute(((self.op_kind_flags >> OpKindFlags::OP3_KIND_SHIFT) & OpKindFlags::OP_KIND_MASK) as u8) }
}
#[inline]
pub fn set_op3_kind(&mut self, new_value: OpKind) {
self.op_kind_flags = (self.op_kind_flags & !(OpKindFlags::OP_KIND_MASK << OpKindFlags::OP3_KIND_SHIFT))
| (((new_value as u32) & OpKindFlags::OP_KIND_MASK) << OpKindFlags::OP3_KIND_SHIFT);
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::unused_self))]
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn op4_kind(&self) -> OpKind {
OpKind::Immediate8
}
#[deprecated(since = "1.10.0", note = "Use try_set_op4_kind() instead")]
#[inline]
pub fn set_op4_kind(&mut self, new_value: OpKind) {
self.try_set_op4_kind(new_value).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::unused_self))]
#[inline]
pub fn try_set_op4_kind(&mut self, new_value: OpKind) -> Result<(), IcedError> {
if new_value != OpKind::Immediate8 {
Err(IcedError::new("Invalid opkind"))
} else {
Ok(())
}
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[deprecated(since = "1.10.0", note = "Use try_op_kind() instead")]
pub fn op_kind(&self, operand: u32) -> OpKind {
self.try_op_kind(operand).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn try_op_kind(&self, operand: u32) -> Result<OpKind, IcedError> {
const_assert_eq!(5, IcedConstants::MAX_OP_COUNT);
match operand {
0 => Ok(self.op0_kind()),
1 => Ok(self.op1_kind()),
2 => Ok(self.op2_kind()),
3 => Ok(self.op3_kind()),
4 => Ok(self.op4_kind()),
_ => Err(IcedError::new("Invalid operand")),
}
}
#[deprecated(since = "1.10.0", note = "Use try_set_op_kind() instead")]
#[inline]
pub fn set_op_kind(&mut self, operand: u32, op_kind: OpKind) {
self.try_set_op_kind(operand, op_kind).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn try_set_op_kind(&mut self, operand: u32, op_kind: OpKind) -> Result<(), IcedError> {
const_assert_eq!(5, IcedConstants::MAX_OP_COUNT);
match operand {
0 => self.set_op0_kind(op_kind),
1 => self.set_op1_kind(op_kind),
2 => self.set_op2_kind(op_kind),
3 => self.set_op3_kind(op_kind),
4 => return self.try_set_op4_kind(op_kind),
_ => return Err(IcedError::new("Invalid operand")),
};
Ok(())
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn has_segment_prefix(&self) -> bool {
(((self.memory_flags as u32) >> MemoryFlags::SEGMENT_PREFIX_SHIFT) & MemoryFlags::SEGMENT_PREFIX_MASK).wrapping_sub(1) < 6
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn segment_prefix(&self) -> Register {
let index = (((self.memory_flags as u32) >> MemoryFlags::SEGMENT_PREFIX_SHIFT) & MemoryFlags::SEGMENT_PREFIX_MASK).wrapping_sub(1);
if index < 6 {
unsafe { mem::transmute((Register::ES as u32 + index) as u8) }
} else {
Register::None
}
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn set_segment_prefix(&mut self, new_value: Register) {
let enc_value =
if new_value == Register::None { 0 } else { (((new_value as u32) - (Register::ES as u32)) + 1) & MemoryFlags::SEGMENT_PREFIX_MASK };
self.memory_flags = (((self.memory_flags as u32) & !(MemoryFlags::SEGMENT_PREFIX_MASK << MemoryFlags::SEGMENT_PREFIX_SHIFT))
| (enc_value << MemoryFlags::SEGMENT_PREFIX_SHIFT)) as u16;
}
#[cfg_attr(has_must_use, must_use)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn memory_segment(&self) -> Register {
let seg_reg = self.segment_prefix();
if seg_reg != Register::None {
return seg_reg;
}
match self.memory_base() {
Register::BP | Register::EBP | Register::ESP | Register::RBP | Register::RSP => Register::SS,
_ => Register::DS,
}
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn memory_displ_size(&self) -> u32 {
let size = ((self.memory_flags as u32) >> MemoryFlags::DISPL_SIZE_SHIFT) & MemoryFlags::DISPL_SIZE_MASK;
if size <= 2 {
size
} else if size == 3 {
4
} else {
8
}
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn set_memory_displ_size(&mut self, new_value: u32) {
let enc_value = match new_value {
0 => 0,
1 => 1,
2 => 2,
4 => 3,
_ => 4,
};
self.memory_flags = (((self.memory_flags as u32) & !(MemoryFlags::DISPL_SIZE_MASK << MemoryFlags::DISPL_SIZE_SHIFT))
| (enc_value << MemoryFlags::DISPL_SIZE_SHIFT)) as u16;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn is_broadcast(&self) -> bool {
(self.memory_flags & (MemoryFlags::BROADCAST as u16)) != 0
}
#[inline]
pub fn set_is_broadcast(&mut self, new_value: bool) {
if new_value {
self.memory_flags |= MemoryFlags::BROADCAST as u16;
} else {
self.memory_flags &= !(MemoryFlags::BROADCAST as u16);
}
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn memory_size(&self) -> MemorySize {
let mut index = self.code() as usize;
if self.is_broadcast() {
index += IcedConstants::CODE_ENUM_COUNT;
}
unsafe { *instruction_memory_sizes::SIZES.get_unchecked(index) }
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn memory_index_scale(&self) -> u32 {
1 << (self.memory_flags as u32 & MemoryFlags::SCALE_MASK)
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn set_memory_index_scale(&mut self, new_value: u32) {
match new_value {
1 => self.memory_flags &= !3,
2 => self.memory_flags = (self.memory_flags & !(MemoryFlags::SCALE_MASK as u16)) | 1,
4 => self.memory_flags = (self.memory_flags & !(MemoryFlags::SCALE_MASK as u16)) | 2,
_ => {
debug_assert_eq!(8, new_value);
self.memory_flags |= 3;
}
}
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn memory_displacement(&self) -> u32 {
self.mem_displ
}
#[inline]
pub fn set_memory_displacement(&mut self, new_value: u32) {
self.mem_displ = new_value;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn memory_displacement64(&self) -> u64 {
self.mem_displ as i32 as u64
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn try_immediate(&self, operand: u32) -> Result<u64, IcedError> {
Ok(match self.try_op_kind(operand)? {
OpKind::Immediate8 => self.immediate8() as u64,
OpKind::Immediate8_2nd => self.immediate8_2nd() as u64,
OpKind::Immediate16 => self.immediate16() as u64,
OpKind::Immediate32 => self.immediate32() as u64,
OpKind::Immediate64 => self.immediate64(),
OpKind::Immediate8to16 => self.immediate8to16() as u64,
OpKind::Immediate8to32 => self.immediate8to32() as u64,
OpKind::Immediate8to64 => self.immediate8to64() as u64,
OpKind::Immediate32to64 => self.immediate32to64() as u64,
_ => return Err(IcedError::new("Not an immediate operand")),
})
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn immediate(&self, operand: u32) -> u64 {
self.try_immediate(operand).unwrap()
}
#[inline]
#[deprecated(since = "1.10.0", note = "Use try_set_immediate_i32() instead")]
pub fn set_immediate_i32(&mut self, operand: u32, new_value: i32) {
self.try_set_immediate_i32(operand, new_value).unwrap();
}
#[inline]
pub fn try_set_immediate_i32(&mut self, operand: u32, new_value: i32) -> Result<(), IcedError> {
self.try_set_immediate_u64(operand, new_value as u64)
}
#[inline]
#[deprecated(since = "1.10.0", note = "Use try_set_immediate_u32() instead")]
pub fn set_immediate_u32(&mut self, operand: u32, new_value: u32) {
self.try_set_immediate_u32(operand, new_value).unwrap();
}
#[inline]
pub fn try_set_immediate_u32(&mut self, operand: u32, new_value: u32) -> Result<(), IcedError> {
self.try_set_immediate_u64(operand, new_value as u64)
}
#[inline]
#[deprecated(since = "1.10.0", note = "Use try_set_immediate_i64() instead")]
pub fn set_immediate_i64(&mut self, operand: u32, new_value: i64) {
self.try_set_immediate_i64(operand, new_value).unwrap()
}
#[inline]
pub fn try_set_immediate_i64(&mut self, operand: u32, new_value: i64) -> Result<(), IcedError> {
self.try_set_immediate_u64(operand, new_value as u64)
}
#[inline]
#[deprecated(since = "1.10.0", note = "Use try_set_immediate_u64() instead")]
pub fn set_immediate_u64(&mut self, operand: u32, new_value: u64) {
self.try_set_immediate_u64(operand, new_value).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn try_set_immediate_u64(&mut self, operand: u32, new_value: u64) -> Result<(), IcedError> {
match self.try_op_kind(operand)? {
OpKind::Immediate8 | OpKind::Immediate8to16 | OpKind::Immediate8to32 | OpKind::Immediate8to64 => self.immediate = new_value as u8 as u32,
OpKind::Immediate8_2nd => self.mem_displ = new_value as u8 as u32,
OpKind::Immediate16 => self.immediate = new_value as u16 as u32,
OpKind::Immediate32to64 | OpKind::Immediate32 => self.immediate = new_value as u32,
OpKind::Immediate64 => self.set_immediate64(new_value),
_ => return Err(IcedError::new("Not an immediate operand")),
}
Ok(())
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn immediate8(&self) -> u8 {
self.immediate as u8
}
#[inline]
pub fn set_immediate8(&mut self, new_value: u8) {
self.immediate = new_value as u32;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn immediate8_2nd(&self) -> u8 {
self.mem_displ as u8
}
#[inline]
pub fn set_immediate8_2nd(&mut self, new_value: u8) {
self.mem_displ = new_value as u32;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn immediate16(&self) -> u16 {
self.immediate as u16
}
#[inline]
pub fn set_immediate16(&mut self, new_value: u16) {
self.immediate = new_value as u32;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn immediate32(&self) -> u32 {
self.immediate
}
#[inline]
pub fn set_immediate32(&mut self, new_value: u32) {
self.immediate = new_value;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn immediate64(&self) -> u64 {
((self.mem_displ as u64) << 32) | (self.immediate as u64)
}
#[inline]
pub fn set_immediate64(&mut self, new_value: u64) {
self.immediate = new_value as u32;
self.mem_displ = (new_value >> 32) as u32;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn immediate8to16(&self) -> i16 {
self.immediate as i8 as i16
}
#[inline]
pub fn set_immediate8to16(&mut self, new_value: i16) {
self.immediate = new_value as i8 as u32;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn immediate8to32(&self) -> i32 {
self.immediate as i8 as i32
}
#[inline]
pub fn set_immediate8to32(&mut self, new_value: i32) {
self.immediate = new_value as i8 as u32;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn immediate8to64(&self) -> i64 {
self.immediate as i8 as i64
}
#[inline]
pub fn set_immediate8to64(&mut self, new_value: i64) {
self.immediate = new_value as i8 as u32;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn immediate32to64(&self) -> i64 {
self.immediate as i32 as i64
}
#[inline]
pub fn set_immediate32to64(&mut self, new_value: i64) {
self.immediate = new_value as u32;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn memory_address64(&self) -> u64 {
((self.mem_displ as u64) << 32) | self.immediate as u64
}
#[inline]
pub fn set_memory_address64(&mut self, new_value: u64) {
self.immediate = new_value as u32;
self.mem_displ = (new_value >> 32) as u32;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn near_branch16(&self) -> u16 {
self.immediate as u16
}
#[inline]
pub fn set_near_branch16(&mut self, new_value: u16) {
self.immediate = new_value as u32;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn near_branch32(&self) -> u32 {
self.immediate
}
#[inline]
pub fn set_near_branch32(&mut self, new_value: u32) {
self.immediate = new_value;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn near_branch64(&self) -> u64 {
((self.mem_displ as u64) << 32) | self.immediate as u64
}
#[inline]
pub fn set_near_branch64(&mut self, new_value: u64) {
self.immediate = new_value as u32;
self.mem_displ = (new_value >> 32) as u32;
}
#[cfg_attr(has_must_use, must_use)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn near_branch_target(&self) -> u64 {
match self.op0_kind() {
OpKind::NearBranch16 => self.near_branch16() as u64,
OpKind::NearBranch32 => self.near_branch32() as u64,
OpKind::NearBranch64 => self.near_branch64(),
_ => 0,
}
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn far_branch16(&self) -> u16 {
self.immediate as u16
}
#[inline]
pub fn set_far_branch16(&mut self, new_value: u16) {
self.immediate = new_value as u32;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn far_branch32(&self) -> u32 {
self.immediate
}
#[inline]
pub fn set_far_branch32(&mut self, new_value: u32) {
self.immediate = new_value;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn far_branch_selector(&self) -> u16 {
self.mem_displ as u16
}
#[inline]
pub fn set_far_branch_selector(&mut self, new_value: u16) {
self.mem_displ = new_value as u32;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn memory_base(&self) -> Register {
unsafe { mem::transmute(self.mem_base_reg) }
}
#[inline]
pub fn set_memory_base(&mut self, new_value: Register) {
self.mem_base_reg = new_value as u8;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn memory_index(&self) -> Register {
unsafe { mem::transmute(self.mem_index_reg) }
}
#[inline]
pub fn set_memory_index(&mut self, new_value: Register) {
self.mem_index_reg = new_value as u8;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn op0_register(&self) -> Register {
unsafe { mem::transmute(self.reg0) }
}
#[inline]
pub fn set_op0_register(&mut self, new_value: Register) {
self.reg0 = new_value as u8;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn op1_register(&self) -> Register {
unsafe { mem::transmute(self.reg1) }
}
#[inline]
pub fn set_op1_register(&mut self, new_value: Register) {
self.reg1 = new_value as u8;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn op2_register(&self) -> Register {
unsafe { mem::transmute(self.reg2) }
}
#[inline]
pub fn set_op2_register(&mut self, new_value: Register) {
self.reg2 = new_value as u8;
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn op3_register(&self) -> Register {
unsafe { mem::transmute(self.reg3) }
}
#[inline]
pub fn set_op3_register(&mut self, new_value: Register) {
self.reg3 = new_value as u8;
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::unused_self))]
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn op4_register(&self) -> Register {
Register::None
}
#[inline]
#[deprecated(since = "1.10.0", note = "Use try_set_op4_register() instead")]
pub fn set_op4_register(&mut self, new_value: Register) {
self.try_set_op4_register(new_value).unwrap();
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::unused_self))]
#[inline]
pub fn try_set_op4_register(&mut self, new_value: Register) -> Result<(), IcedError> {
if new_value != Register::None {
Err(IcedError::new("Invalid register"))
} else {
Ok(())
}
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[deprecated(since = "1.10.0", note = "Use try_op_register() instead")]
pub fn op_register(&self, operand: u32) -> Register {
self.try_op_register(operand).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn try_op_register(&self, operand: u32) -> Result<Register, IcedError> {
const_assert_eq!(5, IcedConstants::MAX_OP_COUNT);
match operand {
0 => Ok(self.op0_register()),
1 => Ok(self.op1_register()),
2 => Ok(self.op2_register()),
3 => Ok(self.op3_register()),
4 => Ok(self.op4_register()),
_ => Err(IcedError::new("Invalid operand")),
}
}
#[inline]
#[deprecated(since = "1.10.0", note = "Use try_set_op_register() instead")]
pub fn set_op_register(&mut self, operand: u32, new_value: Register) {
self.try_set_op_register(operand, new_value).unwrap();
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn try_set_op_register(&mut self, operand: u32, new_value: Register) -> Result<(), IcedError> {
const_assert_eq!(5, IcedConstants::MAX_OP_COUNT);
match operand {
0 => self.set_op0_register(new_value),
1 => self.set_op1_register(new_value),
2 => self.set_op2_register(new_value),
3 => self.set_op3_register(new_value),
4 => return self.try_set_op4_register(new_value),
_ => return Err(IcedError::new("Invalid operand")),
}
Ok(())
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn op_mask(&self) -> Register {
let r = (self.code_flags >> CodeFlags::OP_MASK_SHIFT) & CodeFlags::OP_MASK_MASK;
if r == 0 {
Register::None
} else {
unsafe { mem::transmute((r + Register::K0 as u32) as u8) }
}
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn set_op_mask(&mut self, new_value: Register) {
let r = if new_value == Register::None { 0 } else { (new_value as u32 - Register::K0 as u32) & CodeFlags::OP_MASK_MASK };
self.code_flags = (self.code_flags & !(CodeFlags::OP_MASK_MASK << CodeFlags::OP_MASK_SHIFT)) | (r << CodeFlags::OP_MASK_SHIFT);
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn has_op_mask(&self) -> bool {
(self.code_flags & (CodeFlags::OP_MASK_MASK << CodeFlags::OP_MASK_SHIFT)) != 0
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn zeroing_masking(&self) -> bool {
(self.code_flags & CodeFlags::ZEROING_MASKING) != 0
}
#[inline]
pub fn set_zeroing_masking(&mut self, new_value: bool) {
if new_value {
self.code_flags |= CodeFlags::ZEROING_MASKING;
} else {
self.code_flags &= !CodeFlags::ZEROING_MASKING;
}
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn merging_masking(&self) -> bool {
(self.code_flags & CodeFlags::ZEROING_MASKING) == 0
}
#[inline]
pub fn set_merging_masking(&mut self, new_value: bool) {
if new_value {
self.code_flags &= !CodeFlags::ZEROING_MASKING;
} else {
self.code_flags |= CodeFlags::ZEROING_MASKING;
}
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn rounding_control(&self) -> RoundingControl {
unsafe { mem::transmute(((self.code_flags >> CodeFlags::ROUNDING_CONTROL_SHIFT) & CodeFlags::ROUNDING_CONTROL_MASK) as u8) }
}
#[inline]
pub fn set_rounding_control(&mut self, new_value: RoundingControl) {
self.code_flags = (self.code_flags & !(CodeFlags::ROUNDING_CONTROL_MASK << CodeFlags::ROUNDING_CONTROL_SHIFT))
| ((new_value as u32 & CodeFlags::ROUNDING_CONTROL_MASK) << CodeFlags::ROUNDING_CONTROL_SHIFT);
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn declare_data_len(&self) -> usize {
(((self.op_kind_flags >> OpKindFlags::DATA_LENGTH_SHIFT) & OpKindFlags::DATA_LENGTH_MASK) + 1) as usize
}
#[inline]
pub fn set_declare_data_len(&mut self, new_value: usize) {
self.op_kind_flags = (self.op_kind_flags & !(OpKindFlags::DATA_LENGTH_MASK << OpKindFlags::DATA_LENGTH_SHIFT))
| ((((new_value as u32) - 1) & OpKindFlags::DATA_LENGTH_MASK) << OpKindFlags::DATA_LENGTH_SHIFT);
}
#[deprecated(since = "1.10.0", note = "Use try_set_declare_byte_value_i8() instead")]
#[inline]
pub fn set_declare_byte_value_i8(&mut self, index: usize, new_value: i8) {
self.try_set_declare_byte_value_i8(index, new_value).unwrap();
}
#[inline]
pub fn try_set_declare_byte_value_i8(&mut self, index: usize, new_value: i8) -> Result<(), IcedError> {
self.try_set_declare_byte_value(index, new_value as u8)
}
#[deprecated(since = "1.10.0", note = "Use try_set_declare_byte_value() instead")]
#[inline]
pub fn set_declare_byte_value(&mut self, index: usize, new_value: u8) {
self.try_set_declare_byte_value(index, new_value).unwrap();
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn try_set_declare_byte_value(&mut self, index: usize, new_value: u8) -> Result<(), IcedError> {
if cfg!(feature = "db") {
match index {
0 => self.reg0 = new_value,
1 => self.reg1 = new_value,
2 => self.reg2 = new_value,
3 => self.reg3 = new_value,
4 => self.immediate = (self.immediate & 0xFFFF_FF00) | new_value as u32,
5 => self.immediate = (self.immediate & 0xFFFF_00FF) | ((new_value as u32) << 8),
6 => self.immediate = (self.immediate & 0xFF00_FFFF) | ((new_value as u32) << 16),
7 => self.immediate = (self.immediate & 0x00FF_FFFF) | ((new_value as u32) << 24),
8 => self.mem_displ = (self.mem_displ & 0xFFFF_FF00) | new_value as u32,
9 => self.mem_displ = (self.mem_displ & 0xFFFF_00FF) | ((new_value as u32) << 8),
10 => self.mem_displ = (self.mem_displ & 0xFF00_FFFF) | ((new_value as u32) << 16),
11 => self.mem_displ = (self.mem_displ & 0x00FF_FFFF) | ((new_value as u32) << 24),
12 => self.mem_base_reg = new_value,
13 => self.mem_index_reg = new_value,
14 => self.op_kind_flags = (self.op_kind_flags & 0xFFFF_FF00) | new_value as u32,
15 => self.op_kind_flags = (self.op_kind_flags & 0xFFFF_00FF) | ((new_value as u32) << 8),
_ => return Err(IcedError::new("Invalid index")),
}
Ok(())
} else {
Err(IcedError::new("`db` feature wasn't enabled"))
}
}
#[cfg_attr(has_must_use, must_use)]
#[deprecated(since = "1.10.0", note = "Use try_get_declare_byte_value() instead")]
#[inline]
pub fn get_declare_byte_value(&self, index: usize) -> u8 {
self.try_get_declare_byte_value(index).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn try_get_declare_byte_value(&self, index: usize) -> Result<u8, IcedError> {
Ok(match index {
0 => self.reg0,
1 => self.reg1,
2 => self.reg2,
3 => self.reg3,
4 => self.immediate as u8,
5 => (self.immediate >> 8) as u8,
6 => (self.immediate >> 16) as u8,
7 => (self.immediate >> 24) as u8,
8 => self.mem_displ as u8,
9 => (self.mem_displ >> 8) as u8,
10 => (self.mem_displ >> 16) as u8,
11 => (self.mem_displ >> 24) as u8,
12 => self.mem_base_reg,
13 => self.mem_index_reg,
14 => self.op_kind_flags as u8,
15 => (self.op_kind_flags >> 8) as u8,
_ => return Err(IcedError::new("Invalid index")),
})
}
#[deprecated(since = "1.10.0", note = "Use try_set_declare_word_value_i16() instead")]
#[inline]
pub fn set_declare_word_value_i16(&mut self, index: usize, new_value: i16) {
self.try_set_declare_word_value_i16(index, new_value).unwrap();
}
#[inline]
pub fn try_set_declare_word_value_i16(&mut self, index: usize, new_value: i16) -> Result<(), IcedError> {
self.try_set_declare_word_value(index, new_value as u16)
}
#[deprecated(since = "1.10.0", note = "Use try_set_declare_word_value() instead")]
#[inline]
pub fn set_declare_word_value(&mut self, index: usize, new_value: u16) {
self.try_set_declare_word_value(index, new_value).unwrap();
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn try_set_declare_word_value(&mut self, index: usize, new_value: u16) -> Result<(), IcedError> {
if cfg!(feature = "db") {
match index {
0 => {
self.reg0 = new_value as u8;
self.reg1 = (new_value >> 8) as u8;
}
1 => {
self.reg2 = new_value as u8;
self.reg3 = (new_value >> 8) as u8;
}
2 => self.immediate = (self.immediate & 0xFFFF_0000) | new_value as u32,
3 => self.immediate = self.immediate as u16 as u32 | (new_value as u32) << 16,
4 => self.mem_displ = (self.mem_displ & 0xFFFF_0000) | new_value as u32,
5 => self.mem_displ = self.mem_displ as u16 as u32 | (new_value as u32) << 16,
6 => {
self.mem_base_reg = new_value as u8;
self.mem_index_reg = (new_value >> 8) as u8;
}
7 => self.op_kind_flags = (self.op_kind_flags & 0xFFFF_0000) | new_value as u32,
_ => return Err(IcedError::new("Invalid index")),
}
Ok(())
} else {
Err(IcedError::new("`db` feature wasn't enabled"))
}
}
#[cfg_attr(has_must_use, must_use)]
#[deprecated(since = "1.10.0", note = "Use try_get_declare_word_value() instead")]
#[inline]
pub fn get_declare_word_value(&self, index: usize) -> u16 {
self.try_get_declare_word_value(index).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn try_get_declare_word_value(&self, index: usize) -> Result<u16, IcedError> {
Ok(match index {
0 => self.reg0 as u16 | ((self.reg1 as u16) << 8),
1 => self.reg2 as u16 | ((self.reg3 as u16) << 8),
2 => self.immediate as u16,
3 => (self.immediate >> 16) as u16,
4 => self.mem_displ as u16,
5 => (self.mem_displ >> 16) as u16,
6 => self.mem_base_reg as u16 | ((self.mem_index_reg as u16) << 8),
7 => self.op_kind_flags as u16,
_ => return Err(IcedError::new("Invalid index")),
})
}
#[deprecated(since = "1.10.0", note = "Use try_set_declare_dword_value_i32() instead")]
#[inline]
pub fn set_declare_dword_value_i32(&mut self, index: usize, new_value: i32) {
self.try_set_declare_dword_value_i32(index, new_value).unwrap();
}
#[inline]
pub fn try_set_declare_dword_value_i32(&mut self, index: usize, new_value: i32) -> Result<(), IcedError> {
self.try_set_declare_dword_value(index, new_value as u32)
}
#[deprecated(since = "1.10.0", note = "Use try_set_declare_dword_value() instead")]
#[inline]
pub fn set_declare_dword_value(&mut self, index: usize, new_value: u32) {
self.try_set_declare_dword_value(index, new_value).unwrap();
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn try_set_declare_dword_value(&mut self, index: usize, new_value: u32) -> Result<(), IcedError> {
if cfg!(feature = "db") {
match index {
0 => {
self.reg0 = new_value as u8;
self.reg1 = (new_value >> 8) as u8;
self.reg2 = (new_value >> 16) as u8;
self.reg3 = (new_value >> 24) as u8;
}
1 => self.immediate = new_value,
2 => self.mem_displ = new_value,
3 => {
self.mem_base_reg = new_value as u8;
self.mem_index_reg = (new_value >> 8) as u8;
self.op_kind_flags = (self.op_kind_flags & 0xFFFF_0000) | (new_value >> 16);
}
_ => return Err(IcedError::new("Invalid index")),
}
Ok(())
} else {
Err(IcedError::new("`db` feature wasn't enabled"))
}
}
#[cfg_attr(has_must_use, must_use)]
#[deprecated(since = "1.10.0", note = "Use try_get_declare_dword_value() instead")]
#[inline]
pub fn get_declare_dword_value(&self, index: usize) -> u32 {
self.try_get_declare_dword_value(index).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn try_get_declare_dword_value(&self, index: usize) -> Result<u32, IcedError> {
Ok(match index {
0 => self.reg0 as u32 | ((self.reg1 as u32) << 8) | ((self.reg2 as u32) << 16) | ((self.reg3 as u32) << 24),
1 => self.immediate,
2 => self.mem_displ,
3 => self.mem_base_reg as u32 | ((self.mem_index_reg as u32) << 8) | (self.op_kind_flags << 16),
_ => return Err(IcedError::new("Invalid index")),
})
}
#[deprecated(since = "1.10.0", note = "Use try_set_declare_qword_value_i64() instead")]
#[inline]
pub fn set_declare_qword_value_i64(&mut self, index: usize, new_value: i64) {
self.try_set_declare_qword_value_i64(index, new_value).unwrap();
}
#[inline]
pub fn try_set_declare_qword_value_i64(&mut self, index: usize, new_value: i64) -> Result<(), IcedError> {
self.try_set_declare_qword_value(index, new_value as u64)
}
#[deprecated(since = "1.10.0", note = "Use try_set_declare_qword_value() instead")]
#[inline]
pub fn set_declare_qword_value(&mut self, index: usize, new_value: u64) {
self.try_set_declare_qword_value(index, new_value).unwrap();
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn try_set_declare_qword_value(&mut self, index: usize, new_value: u64) -> Result<(), IcedError> {
if cfg!(feature = "db") {
match index {
0 => {
self.reg0 = new_value as u8;
self.reg1 = (new_value >> 8) as u8;
self.reg2 = (new_value >> 16) as u8;
self.reg3 = (new_value >> 24) as u8;
self.immediate = (new_value >> 32) as u32;
}
1 => {
self.mem_displ = new_value as u32;
self.mem_base_reg = (new_value >> 32) as u8;
self.mem_index_reg = (new_value >> 40) as u8;
self.op_kind_flags = (self.op_kind_flags & 0xFFFF_0000) | (new_value >> 48) as u32;
}
_ => return Err(IcedError::new("Invalid index")),
}
Ok(())
} else {
Err(IcedError::new("`db` feature wasn't enabled"))
}
}
#[cfg_attr(has_must_use, must_use)]
#[deprecated(since = "1.10.0", note = "Use try_get_declare_qword_value() instead")]
#[inline]
pub fn get_declare_qword_value(&self, index: usize) -> u64 {
self.try_get_declare_qword_value(index).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn try_get_declare_qword_value(&self, index: usize) -> Result<u64, IcedError> {
Ok(match index {
0 => {
self.reg0 as u64
| ((self.reg1 as u64) << 8)
| ((self.reg2 as u64) << 16)
| ((self.reg3 as u64) << 24)
| ((self.immediate as u64) << 32)
}
1 => {
self.mem_displ as u64 | ((self.mem_base_reg as u64) << 32) | ((self.mem_index_reg as u64) << 40) | ((self.op_kind_flags as u64) << 48)
}
_ => return Err(IcedError::new("Invalid index")),
})
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn is_vsib(&self) -> bool {
self.vsib().is_some()
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn is_vsib32(&self) -> bool {
if let Some(is_vsib64) = self.vsib() {
!is_vsib64
} else {
false
}
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn is_vsib64(&self) -> bool {
if let Some(is_vsib64) = self.vsib() {
is_vsib64
} else {
false
}
}
#[cfg_attr(has_must_use, must_use)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::match_single_binding))]
pub fn vsib(&self) -> Option<bool> {
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
match self.code() {
Code::VEX_Vpgatherdd_xmm_vm32x_xmm
| Code::VEX_Vpgatherdd_ymm_vm32y_ymm
| Code::VEX_Vpgatherdq_xmm_vm32x_xmm
| Code::VEX_Vpgatherdq_ymm_vm32x_ymm
| Code::EVEX_Vpgatherdd_xmm_k1_vm32x
| Code::EVEX_Vpgatherdd_ymm_k1_vm32y
| Code::EVEX_Vpgatherdd_zmm_k1_vm32z
| Code::EVEX_Vpgatherdq_xmm_k1_vm32x
| Code::EVEX_Vpgatherdq_ymm_k1_vm32x
| Code::EVEX_Vpgatherdq_zmm_k1_vm32y
| Code::VEX_Vgatherdps_xmm_vm32x_xmm
| Code::VEX_Vgatherdps_ymm_vm32y_ymm
| Code::VEX_Vgatherdpd_xmm_vm32x_xmm
| Code::VEX_Vgatherdpd_ymm_vm32x_ymm
| Code::EVEX_Vgatherdps_xmm_k1_vm32x
| Code::EVEX_Vgatherdps_ymm_k1_vm32y
| Code::EVEX_Vgatherdps_zmm_k1_vm32z
| Code::EVEX_Vgatherdpd_xmm_k1_vm32x
| Code::EVEX_Vgatherdpd_ymm_k1_vm32x
| Code::EVEX_Vgatherdpd_zmm_k1_vm32y
| Code::EVEX_Vpscatterdd_vm32x_k1_xmm
| Code::EVEX_Vpscatterdd_vm32y_k1_ymm
| Code::EVEX_Vpscatterdd_vm32z_k1_zmm
| Code::EVEX_Vpscatterdq_vm32x_k1_xmm
| Code::EVEX_Vpscatterdq_vm32x_k1_ymm
| Code::EVEX_Vpscatterdq_vm32y_k1_zmm
| Code::EVEX_Vscatterdps_vm32x_k1_xmm
| Code::EVEX_Vscatterdps_vm32y_k1_ymm
| Code::EVEX_Vscatterdps_vm32z_k1_zmm
| Code::EVEX_Vscatterdpd_vm32x_k1_xmm
| Code::EVEX_Vscatterdpd_vm32x_k1_ymm
| Code::EVEX_Vscatterdpd_vm32y_k1_zmm
| Code::EVEX_Vgatherpf0dps_vm32z_k1
| Code::EVEX_Vgatherpf0dpd_vm32y_k1
| Code::EVEX_Vgatherpf1dps_vm32z_k1
| Code::EVEX_Vgatherpf1dpd_vm32y_k1
| Code::EVEX_Vscatterpf0dps_vm32z_k1
| Code::EVEX_Vscatterpf0dpd_vm32y_k1
| Code::EVEX_Vscatterpf1dps_vm32z_k1
| Code::EVEX_Vscatterpf1dpd_vm32y_k1
=> Some(false),
Code::VEX_Vpgatherqd_xmm_vm64x_xmm
| Code::VEX_Vpgatherqd_xmm_vm64y_xmm
| Code::VEX_Vpgatherqq_xmm_vm64x_xmm
| Code::VEX_Vpgatherqq_ymm_vm64y_ymm
| Code::EVEX_Vpgatherqd_xmm_k1_vm64x
| Code::EVEX_Vpgatherqd_xmm_k1_vm64y
| Code::EVEX_Vpgatherqd_ymm_k1_vm64z
| Code::EVEX_Vpgatherqq_xmm_k1_vm64x
| Code::EVEX_Vpgatherqq_ymm_k1_vm64y
| Code::EVEX_Vpgatherqq_zmm_k1_vm64z
| Code::VEX_Vgatherqps_xmm_vm64x_xmm
| Code::VEX_Vgatherqps_xmm_vm64y_xmm
| Code::VEX_Vgatherqpd_xmm_vm64x_xmm
| Code::VEX_Vgatherqpd_ymm_vm64y_ymm
| Code::EVEX_Vgatherqps_xmm_k1_vm64x
| Code::EVEX_Vgatherqps_xmm_k1_vm64y
| Code::EVEX_Vgatherqps_ymm_k1_vm64z
| Code::EVEX_Vgatherqpd_xmm_k1_vm64x
| Code::EVEX_Vgatherqpd_ymm_k1_vm64y
| Code::EVEX_Vgatherqpd_zmm_k1_vm64z
| Code::EVEX_Vpscatterqd_vm64x_k1_xmm
| Code::EVEX_Vpscatterqd_vm64y_k1_xmm
| Code::EVEX_Vpscatterqd_vm64z_k1_ymm
| Code::EVEX_Vpscatterqq_vm64x_k1_xmm
| Code::EVEX_Vpscatterqq_vm64y_k1_ymm
| Code::EVEX_Vpscatterqq_vm64z_k1_zmm
| Code::EVEX_Vscatterqps_vm64x_k1_xmm
| Code::EVEX_Vscatterqps_vm64y_k1_xmm
| Code::EVEX_Vscatterqps_vm64z_k1_ymm
| Code::EVEX_Vscatterqpd_vm64x_k1_xmm
| Code::EVEX_Vscatterqpd_vm64y_k1_ymm
| Code::EVEX_Vscatterqpd_vm64z_k1_zmm
| Code::EVEX_Vgatherpf0qps_vm64z_k1
| Code::EVEX_Vgatherpf0qpd_vm64z_k1
| Code::EVEX_Vgatherpf1qps_vm64z_k1
| Code::EVEX_Vgatherpf1qpd_vm64z_k1
| Code::EVEX_Vscatterpf0qps_vm64z_k1
| Code::EVEX_Vscatterpf0qpd_vm64z_k1
| Code::EVEX_Vscatterpf1qps_vm64z_k1
| Code::EVEX_Vscatterpf1qpd_vm64z_k1
=> Some(true),
_ => None,
}
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn suppress_all_exceptions(&self) -> bool {
(self.code_flags & CodeFlags::SUPPRESS_ALL_EXCEPTIONS) != 0
}
#[inline]
pub fn set_suppress_all_exceptions(&mut self, new_value: bool) {
if new_value {
self.code_flags |= CodeFlags::SUPPRESS_ALL_EXCEPTIONS;
} else {
self.code_flags &= !CodeFlags::SUPPRESS_ALL_EXCEPTIONS;
}
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn is_ip_rel_memory_operand(&self) -> bool {
let base_reg = self.memory_base();
base_reg == Register::RIP || base_reg == Register::EIP
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn ip_rel_memory_address(&self) -> u64 {
let mut result = self.next_ip().wrapping_add(self.memory_displacement() as i32 as u64);
if self.memory_base() == Register::EIP {
result = result as u32 as u64;
}
result
}
#[cfg_attr(has_must_use, must_use)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn try_virtual_address<F>(&self, operand: u32, element_index: usize, mut get_register_value: F) -> Option<u64>
where
F: FnMut(Register, usize, usize) -> Option<u64>,
{
let op_kind = match self.try_op_kind(operand) {
Err(_) => return None,
Ok(op_kind) => op_kind,
};
Some(match op_kind {
OpKind::Register
| OpKind::NearBranch16
| OpKind::NearBranch32
| OpKind::NearBranch64
| OpKind::FarBranch16
| OpKind::FarBranch32
| OpKind::Immediate8
| OpKind::Immediate8_2nd
| OpKind::Immediate16
| OpKind::Immediate32
| OpKind::Immediate64
| OpKind::Immediate8to16
| OpKind::Immediate8to32
| OpKind::Immediate8to64
| OpKind::Immediate32to64 => 0,
OpKind::MemorySegSI => {
let v1 = match get_register_value(self.memory_segment(), 0, 0) {
Some(v) => v,
None => return None,
};
let v2 = match get_register_value(Register::SI, 0, 0) {
Some(v) => v,
None => return None,
};
v1.wrapping_add(v2 as u16 as u64)
}
OpKind::MemorySegESI => {
let v1 = match get_register_value(self.memory_segment(), 0, 0) {
Some(v) => v,
None => return None,
};
let v2 = match get_register_value(Register::ESI, 0, 0) {
Some(v) => v,
None => return None,
};
v1.wrapping_add(v2 as u32 as u64)
}
OpKind::MemorySegRSI => {
let v1 = match get_register_value(self.memory_segment(), 0, 0) {
Some(v) => v,
None => return None,
};
let v2 = match get_register_value(Register::RSI, 0, 0) {
Some(v) => v,
None => return None,
};
v1.wrapping_add(v2)
}
OpKind::MemorySegDI => {
let v1 = match get_register_value(self.memory_segment(), 0, 0) {
Some(v) => v,
None => return None,
};
let v2 = match get_register_value(Register::DI, 0, 0) {
Some(v) => v,
None => return None,
};
v1.wrapping_add(v2 as u16 as u64)
}
OpKind::MemorySegEDI => {
let v1 = match get_register_value(self.memory_segment(), 0, 0) {
Some(v) => v,
None => return None,
};
let v2 = match get_register_value(Register::EDI, 0, 0) {
Some(v) => v,
None => return None,
};
v1.wrapping_add(v2 as u32 as u64)
}
OpKind::MemorySegRDI => {
let v1 = match get_register_value(self.memory_segment(), 0, 0) {
Some(v) => v,
None => return None,
};
let v2 = match get_register_value(Register::RDI, 0, 0) {
Some(v) => v,
None => return None,
};
v1.wrapping_add(v2)
}
OpKind::MemoryESDI => {
let v1 = match get_register_value(Register::ES, 0, 0) {
Some(v) => v,
None => return None,
};
let v2 = match get_register_value(Register::DI, 0, 0) {
Some(v) => v,
None => return None,
};
v1.wrapping_add(v2 as u16 as u64)
}
OpKind::MemoryESEDI => {
let v1 = match get_register_value(Register::ES, 0, 0) {
Some(v) => v,
None => return None,
};
let v2 = match get_register_value(Register::EDI, 0, 0) {
Some(v) => v,
None => return None,
};
v1.wrapping_add(v2 as u32 as u64)
}
OpKind::MemoryESRDI => {
let v1 = match get_register_value(Register::ES, 0, 0) {
Some(v) => v,
None => return None,
};
let v2 = match get_register_value(Register::RDI, 0, 0) {
Some(v) => v,
None => return None,
};
v1.wrapping_add(v2)
}
OpKind::Memory64 => {
let v1 = match get_register_value(self.memory_segment(), 0, 0) {
Some(v) => v,
None => return None,
};
v1.wrapping_add(self.memory_address64())
}
OpKind::Memory => {
let base_reg = self.memory_base();
let index_reg = self.memory_index();
let addr_size =
super::instruction_internal::get_address_size_in_bytes(base_reg, index_reg, self.memory_displ_size(), self.code_size());
let mut offset = self.memory_displacement() as u64;
let offset_mask = match addr_size {
8 => {
offset = offset as i32 as u64;
u64::MAX
}
4 => u32::MAX as u64,
_ => {
debug_assert_eq!(2, addr_size);
u16::MAX as u64
}
};
match base_reg {
Register::None => {}
Register::RIP => offset = offset.wrapping_add(self.next_ip()),
Register::EIP => offset = offset.wrapping_add(self.next_ip32() as u64),
_ => {
let v1 = match get_register_value(base_reg, 0, 0) {
Some(v) => v,
None => return None,
};
offset = offset.wrapping_add(v1)
}
}
let code = self.code();
if index_reg != Register::None && !code.ignores_index() && !code.is_tile_stride_index() {
if let Some(is_vsib64) = self.vsib() {
if is_vsib64 {
let v1 = match get_register_value(index_reg, element_index, 8) {
Some(v) => v,
None => return None,
};
offset = offset.wrapping_add(v1 << super::instruction_internal::internal_get_memory_index_scale(self));
} else {
let v1 = match get_register_value(index_reg, element_index, 4) {
Some(v) => v,
None => return None,
};
offset = offset.wrapping_add((v1 as i32 as u64) << super::instruction_internal::internal_get_memory_index_scale(self));
}
} else {
let v1 = match get_register_value(index_reg, 0, 0) {
Some(v) => v,
None => return None,
};
offset = offset.wrapping_add(v1 << super::instruction_internal::internal_get_memory_index_scale(self));
}
}
offset &= offset_mask;
if !code.ignores_segment() {
match get_register_value(self.memory_segment(), 0, 0) {
Some(v) => v.wrapping_add(offset),
None => return None,
}
} else {
offset
}
}
})
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn virtual_address<F>(&self, operand: u32, element_index: usize, mut get_register_value: F) -> u64
where
F: FnMut(Register, usize, usize) -> u64,
{
self.try_virtual_address(operand, element_index, |x, y, z| Some(get_register_value(x, y, z))).unwrap()
}
}
#[cfg(feature = "instr_info")]
#[derive(Debug, Default, Copy, Clone, Eq, PartialEq, Hash)]
pub struct FpuStackIncrementInfo {
increment: i32,
conditional: bool,
writes_top: bool,
}
#[cfg(feature = "instr_info")]
impl FpuStackIncrementInfo {
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn new(increment: i32, conditional: bool, writes_top: bool) -> Self {
Self { increment, conditional, writes_top }
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn increment(&self) -> i32 {
self.increment
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn conditional(&self) -> bool {
self.conditional
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn writes_top(&self) -> bool {
self.writes_top
}
}
#[cfg(feature = "instr_info")]
impl Instruction {
#[cfg_attr(has_must_use, must_use)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn stack_pointer_increment(&self) -> i32 {
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::match_single_binding))]
match self.code() {
Code::Pushad => -32,
Code::Pushaw
| Code::Call_m1664 => -16,
Code::Push_r64
| Code::Pushq_imm32
| Code::Pushq_imm8
| Code::Call_ptr1632
| Code::Pushfq
| Code::Call_rel32_64
| Code::Call_rm64
| Code::Call_m1632
| Code::Push_rm64
| Code::Pushq_FS
| Code::Pushq_GS => -8,
Code::Pushd_ES
| Code::Pushd_CS
| Code::Pushd_SS
| Code::Pushd_DS
| Code::Push_r32
| Code::Pushd_imm32
| Code::Pushd_imm8
| Code::Call_ptr1616
| Code::Pushfd
| Code::Call_rel32_32
| Code::Call_rm32
| Code::Call_m1616
| Code::Push_rm32
| Code::Pushd_FS
| Code::Pushd_GS => -4,
Code::Pushw_ES
| Code::Pushw_CS
| Code::Pushw_SS
| Code::Pushw_DS
| Code::Push_r16
| Code::Push_imm16
| Code::Pushw_imm8
| Code::Pushfw
| Code::Call_rel16
| Code::Call_rm16
| Code::Push_rm16
| Code::Pushw_FS
| Code::Pushw_GS => -2,
Code::Popw_ES
| Code::Popw_CS
| Code::Popw_SS
| Code::Popw_DS
| Code::Pop_r16
| Code::Pop_rm16
| Code::Popfw
| Code::Retnw
| Code::Popw_FS
| Code::Popw_GS => 2,
Code::Popd_ES
| Code::Popd_SS
| Code::Popd_DS
| Code::Pop_r32
| Code::Pop_rm32
| Code::Popfd
| Code::Retnd
| Code::Retfw
| Code::Popd_FS
| Code::Popd_GS => 4,
Code::Pop_r64
| Code::Pop_rm64
| Code::Popfq
| Code::Retnq
| Code::Retfd
| Code::Popq_FS
| Code::Popq_GS => 8,
Code::Popaw
| Code::Retfq => 16,
Code::Uiret => 24,
Code::Popad => 32,
Code::Iretq => 40,
Code::Enterw_imm16_imm8 => -(2 + (self.immediate8_2nd() as i32 & 0x1F) * 2 + self.immediate16() as i32),
Code::Enterd_imm16_imm8 => -(4 + (self.immediate8_2nd() as i32 & 0x1F) * 4 + self.immediate16() as i32),
Code::Enterq_imm16_imm8 => -(8 + (self.immediate8_2nd() as i32 & 0x1F) * 8 + self.immediate16() as i32),
Code::Iretw => if self.code_size() == CodeSize::Code64 { 2 * 5 } else { 2 * 3 },
Code::Iretd => if self.code_size() == CodeSize::Code64 { 4 * 5 } else { 4 * 3 },
Code::Retnw_imm16 => 2 + self.immediate16() as i32,
Code::Retnd_imm16
| Code::Retfw_imm16 => 4 + self.immediate16() as i32,
Code::Retnq_imm16
| Code::Retfd_imm16 => 8 + self.immediate16() as i32,
Code::Retfq_imm16 => 16 + self.immediate16() as i32,
_ => 0,
}
}
#[cfg_attr(has_must_use, must_use)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn fpu_stack_increment_info(&self) -> FpuStackIncrementInfo {
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::match_single_binding))]
match self.code() {
Code::Fld_m32fp
| Code::Fld_sti
| Code::Fld1
| Code::Fldl2t
| Code::Fldl2e
| Code::Fldpi
| Code::Fldlg2
| Code::Fldln2
| Code::Fldz
| Code::Fxtract
| Code::Fdecstp
| Code::Fild_m32int
| Code::Fld_m80fp
| Code::Fld_m64fp
| Code::Fild_m16int
| Code::Fbld_m80bcd
| Code::Fild_m64int
=> FpuStackIncrementInfo { increment: -1, conditional: false, writes_top: true },
Code::Fptan
| Code::Fsincos
=> FpuStackIncrementInfo { increment: -1, conditional: true, writes_top: true },
Code::Fldenv_m14byte
| Code::Fldenv_m28byte
| Code::Fninit
| Code::Finit
| Code::Frstor_m94byte
| Code::Frstor_m108byte
| Code::Fnsave_m94byte
| Code::Fsave_m94byte
| Code::Fnsave_m108byte
| Code::Fsave_m108byte
=> FpuStackIncrementInfo { increment: 0, conditional: false, writes_top: true },
Code::Fcomp_m32fp
| Code::Fcomp_st0_sti
| Code::Fstp_m32fp
| Code::Fstpnce_sti
| Code::Fyl2x
| Code::Fpatan
| Code::Fincstp
| Code::Fyl2xp1
| Code::Ficomp_m32int
| Code::Fisttp_m32int
| Code::Fistp_m32int
| Code::Fstp_m80fp
| Code::Fcomp_m64fp
| Code::Fcomp_st0_sti_DCD8
| Code::Fisttp_m64int
| Code::Fstp_m64fp
| Code::Fstp_sti
| Code::Fucomp_st0_sti
| Code::Ficomp_m16int
| Code::Faddp_sti_st0
| Code::Fmulp_sti_st0
| Code::Fcomp_st0_sti_DED0
| Code::Fsubrp_sti_st0
| Code::Fsubp_sti_st0
| Code::Fdivrp_sti_st0
| Code::Fdivp_sti_st0
| Code::Fisttp_m16int
| Code::Fistp_m16int
| Code::Fbstp_m80bcd
| Code::Fistp_m64int
| Code::Ffreep_sti
| Code::Fstp_sti_DFD0
| Code::Fstp_sti_DFD8
| Code::Fucomip_st0_sti
| Code::Fcomip_st0_sti
| Code::Ftstp
=> FpuStackIncrementInfo { increment: 1, conditional: false, writes_top: true },
Code::Fucompp
| Code::Fcompp
=> FpuStackIncrementInfo { increment: 2, conditional: false, writes_top: true },
_ => FpuStackIncrementInfo::default(),
}
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn encoding(&self) -> EncodingKind {
self.code().encoding()
}
#[cfg_attr(has_must_use, must_use)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
pub fn cpuid_features(&self) -> &'static [CpuidFeature] {
let flags2 = unsafe { *super::info::info_table::TABLE.get_unchecked((self.code() as usize) * 2 + 1) };
let index = ((flags2 >> InfoFlags2::CPUID_FEATURE_INTERNAL_SHIFT) & InfoFlags2::CPUID_FEATURE_INTERNAL_MASK) as usize;
unsafe { *super::info::cpuid_table::CPUID.get_unchecked(index) }
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn flow_control(&self) -> FlowControl {
self.code().flow_control()
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn is_privileged(&self) -> bool {
self.code().is_privileged()
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn is_stack_instruction(&self) -> bool {
self.code().is_stack_instruction()
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn is_save_restore_instruction(&self) -> bool {
self.code().is_save_restore_instruction()
}
#[cfg_attr(has_must_use, must_use)]
fn rflags_info(&self) -> usize {
let flags1 = unsafe { *super::info::info_table::TABLE.get_unchecked((self.code() as usize) * 2) };
let implied_access = (flags1 >> InfoFlags1::IMPLIED_ACCESS_SHIFT) & InfoFlags1::IMPLIED_ACCESS_MASK;
const_assert!(ImpliedAccess::Shift_Ib_MASK1FMOD9 as u32 + 1 == ImpliedAccess::Shift_Ib_MASK1FMOD11 as u32);
const_assert!(ImpliedAccess::Shift_Ib_MASK1FMOD9 as u32 + 2 == ImpliedAccess::Shift_Ib_MASK1F as u32);
const_assert!(ImpliedAccess::Shift_Ib_MASK1FMOD9 as u32 + 3 == ImpliedAccess::Shift_Ib_MASK3F as u32);
const_assert!(ImpliedAccess::Shift_Ib_MASK1FMOD9 as u32 + 4 == ImpliedAccess::Clear_rflags as u32);
let result = ((flags1 >> InfoFlags1::RFLAGS_INFO_SHIFT) & InfoFlags1::RFLAGS_INFO_MASK) as usize;
let e = implied_access.wrapping_sub(ImpliedAccess::Shift_Ib_MASK1FMOD9 as u32);
match e {
0 | 1 => {
const_assert_eq!(0, ImpliedAccess::Shift_Ib_MASK1FMOD9 as u32 - ImpliedAccess::Shift_Ib_MASK1FMOD9 as u32);
const_assert_eq!(1, ImpliedAccess::Shift_Ib_MASK1FMOD11 as u32 - ImpliedAccess::Shift_Ib_MASK1FMOD9 as u32);
let m = if e == 0 { 9 } else { 17 };
match (self.immediate8() & 0x1F) % m {
0 => return RflagsInfo::None as usize,
1 => return RflagsInfo::R_c_W_co as usize,
_ => {}
}
}
2 | 3 => {
const_assert_eq!(2, ImpliedAccess::Shift_Ib_MASK1F as u32 - ImpliedAccess::Shift_Ib_MASK1FMOD9 as u32);
const_assert_eq!(3, ImpliedAccess::Shift_Ib_MASK3F as u32 - ImpliedAccess::Shift_Ib_MASK1FMOD9 as u32);
let mask = if e == 2 { 0x1F } else { 0x3F };
match self.immediate8() & mask {
0 => return RflagsInfo::None as usize,
1 => {
if result == RflagsInfo::W_c_U_o as usize {
return RflagsInfo::W_co as usize;
} else if result == RflagsInfo::R_c_W_c_U_o as usize {
return RflagsInfo::R_c_W_co as usize;
} else {
debug_assert_eq!(RflagsInfo::W_cpsz_U_ao as usize, result);
return RflagsInfo::W_copsz_U_a as usize;
}
}
_ => {}
}
}
4 => {
const_assert_eq!(4, ImpliedAccess::Clear_rflags as u32 - ImpliedAccess::Shift_Ib_MASK1FMOD9 as u32);
if self.op0_register() == self.op1_register() && self.op0_kind() == OpKind::Register && self.op1_kind() == OpKind::Register {
if self.code().mnemonic() == Mnemonic::Xor {
return RflagsInfo::C_cos_S_pz_U_a as usize;
} else {
return RflagsInfo::C_acos_S_pz as usize;
}
}
}
_ => {}
}
result
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn rflags_read(&self) -> u32 {
unsafe { *super::info::rflags_table::FLAGS_READ.get_unchecked(self.rflags_info()) as u32 }
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn rflags_written(&self) -> u32 {
unsafe { *super::info::rflags_table::FLAGS_WRITTEN.get_unchecked(self.rflags_info()) as u32 }
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn rflags_cleared(&self) -> u32 {
unsafe { *super::info::rflags_table::FLAGS_CLEARED.get_unchecked(self.rflags_info()) as u32 }
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn rflags_set(&self) -> u32 {
unsafe { *super::info::rflags_table::FLAGS_SET.get_unchecked(self.rflags_info()) as u32 }
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn rflags_undefined(&self) -> u32 {
unsafe { *super::info::rflags_table::FLAGS_UNDEFINED.get_unchecked(self.rflags_info()) as u32 }
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn rflags_modified(&self) -> u32 {
unsafe { *super::info::rflags_table::FLAGS_MODIFIED.get_unchecked(self.rflags_info()) as u32 }
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn is_jcc_short_or_near(&self) -> bool {
self.code().is_jcc_short_or_near()
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn is_jcc_near(&self) -> bool {
self.code().is_jcc_near()
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn is_jcc_short(&self) -> bool {
self.code().is_jcc_short()
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn is_jmp_short(&self) -> bool {
self.code().is_jmp_short()
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn is_jmp_near(&self) -> bool {
self.code().is_jmp_near()
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn is_jmp_short_or_near(&self) -> bool {
self.code().is_jmp_short_or_near()
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn is_jmp_far(&self) -> bool {
self.code().is_jmp_far()
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn is_call_near(&self) -> bool {
self.code().is_call_near()
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn is_call_far(&self) -> bool {
self.code().is_call_far()
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn is_jmp_near_indirect(&self) -> bool {
self.code().is_jmp_near_indirect()
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn is_jmp_far_indirect(&self) -> bool {
self.code().is_jmp_far_indirect()
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn is_call_near_indirect(&self) -> bool {
self.code().is_call_near_indirect()
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn is_call_far_indirect(&self) -> bool {
self.code().is_call_far_indirect()
}
#[inline]
pub fn negate_condition_code(&mut self) {
let t = self.code().negate_condition_code();
self.set_code(t)
}
#[inline]
pub fn as_short_branch(&mut self) {
let t = self.code().as_short_branch();
self.set_code(t)
}
#[inline]
pub fn as_near_branch(&mut self) {
let t = self.code().as_near_branch();
self.set_code(t)
}
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn condition_code(&self) -> ConditionCode {
self.code().condition_code()
}
}
#[cfg(all(feature = "encoder", feature = "op_code_info"))]
impl Instruction {
#[cfg_attr(has_must_use, must_use)]
#[inline]
pub fn op_code(&self) -> &'static OpCodeInfo {
self.code().op_code()
}
}
#[cfg(feature = "encoder")]
impl Instruction {
#[cfg_attr(has_must_use, must_use)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with(code: Code) -> Self {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
debug_assert_eq!(0, instruction.op_count());
instruction
}
#[cfg_attr(has_must_use, must_use)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg(code: Code, register: Register) -> Self {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register);
debug_assert_eq!(1, instruction.op_count());
instruction
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_i32(code: Code, immediate: i32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
super::instruction_internal::initialize_signed_immediate(&mut instruction, 0, immediate as i64)?;
debug_assert_eq!(1, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_i32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_i32(code: Code, immediate: i32) -> Self {
Instruction::try_with_i32(code, immediate).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_u32(code: Code, immediate: u32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
super::instruction_internal::initialize_unsigned_immediate(&mut instruction, 0, immediate as u64)?;
debug_assert_eq!(1, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_u32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_u32(code: Code, immediate: u32) -> Self {
Instruction::try_with_u32(code, immediate).unwrap()
}
#[cfg_attr(has_must_use, must_use)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_mem(code: Code, memory: MemoryOperand) -> Self {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
super::instruction_internal::internal_set_op0_kind(&mut instruction, OpKind::Memory);
super::instruction_internal::internal_set_memory_base(&mut instruction, memory.base);
super::instruction_internal::internal_set_memory_index(&mut instruction, memory.index);
instruction.set_memory_index_scale(memory.scale);
instruction.set_memory_displ_size(memory.displ_size);
instruction.set_memory_displacement(memory.displacement as u32);
instruction.set_is_broadcast(memory.is_broadcast);
instruction.set_segment_prefix(memory.segment_prefix);
debug_assert_eq!(1, instruction.op_count());
instruction
}
#[cfg_attr(has_must_use, must_use)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_reg(code: Code, register1: Register, register2: Register) -> Self {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register1);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register2);
debug_assert_eq!(2, instruction.op_count());
instruction
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_reg_i32(code: Code, register: Register, immediate: i32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register);
super::instruction_internal::initialize_signed_immediate(&mut instruction, 1, immediate as i64)?;
debug_assert_eq!(2, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_reg_i32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_i32(code: Code, register: Register, immediate: i32) -> Self {
Instruction::try_with_reg_i32(code, register, immediate).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_reg_u32(code: Code, register: Register, immediate: u32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register);
super::instruction_internal::initialize_unsigned_immediate(&mut instruction, 1, immediate as u64)?;
debug_assert_eq!(2, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_reg_u32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_u32(code: Code, register: Register, immediate: u32) -> Self {
Instruction::try_with_reg_u32(code, register, immediate).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_reg_i64(code: Code, register: Register, immediate: i64) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register);
super::instruction_internal::initialize_signed_immediate(&mut instruction, 1, immediate)?;
debug_assert_eq!(2, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_reg_i64() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_i64(code: Code, register: Register, immediate: i64) -> Self {
Instruction::try_with_reg_i64(code, register, immediate).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_reg_u64(code: Code, register: Register, immediate: u64) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register);
super::instruction_internal::initialize_unsigned_immediate(&mut instruction, 1, immediate)?;
debug_assert_eq!(2, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_reg_u64() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_u64(code: Code, register: Register, immediate: u64) -> Self {
Instruction::try_with_reg_u64(code, register, immediate).unwrap()
}
#[cfg_attr(has_must_use, must_use)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_mem(code: Code, register: Register, memory: MemoryOperand) -> Self {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register);
super::instruction_internal::internal_set_op1_kind(&mut instruction, OpKind::Memory);
super::instruction_internal::internal_set_memory_base(&mut instruction, memory.base);
super::instruction_internal::internal_set_memory_index(&mut instruction, memory.index);
instruction.set_memory_index_scale(memory.scale);
instruction.set_memory_displ_size(memory.displ_size);
instruction.set_memory_displacement(memory.displacement as u32);
instruction.set_is_broadcast(memory.is_broadcast);
instruction.set_segment_prefix(memory.segment_prefix);
debug_assert_eq!(2, instruction.op_count());
instruction
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_i32_reg(code: Code, immediate: i32, register: Register) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
super::instruction_internal::initialize_signed_immediate(&mut instruction, 0, immediate as i64)?;
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register);
debug_assert_eq!(2, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_i32_reg() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_i32_reg(code: Code, immediate: i32, register: Register) -> Self {
Instruction::try_with_i32_reg(code, immediate, register).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_u32_reg(code: Code, immediate: u32, register: Register) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
super::instruction_internal::initialize_unsigned_immediate(&mut instruction, 0, immediate as u64)?;
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register);
debug_assert_eq!(2, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_u32_reg() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_u32_reg(code: Code, immediate: u32, register: Register) -> Self {
Instruction::try_with_u32_reg(code, immediate, register).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_i32_i32(code: Code, immediate1: i32, immediate2: i32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
super::instruction_internal::initialize_signed_immediate(&mut instruction, 0, immediate1 as i64)?;
super::instruction_internal::initialize_signed_immediate(&mut instruction, 1, immediate2 as i64)?;
debug_assert_eq!(2, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_i32_i32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_i32_i32(code: Code, immediate1: i32, immediate2: i32) -> Self {
Instruction::try_with_i32_i32(code, immediate1, immediate2).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_u32_u32(code: Code, immediate1: u32, immediate2: u32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
super::instruction_internal::initialize_unsigned_immediate(&mut instruction, 0, immediate1 as u64)?;
super::instruction_internal::initialize_unsigned_immediate(&mut instruction, 1, immediate2 as u64)?;
debug_assert_eq!(2, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_u32_u32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_u32_u32(code: Code, immediate1: u32, immediate2: u32) -> Self {
Instruction::try_with_u32_u32(code, immediate1, immediate2).unwrap()
}
#[cfg_attr(has_must_use, must_use)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_mem_reg(code: Code, memory: MemoryOperand, register: Register) -> Self {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
super::instruction_internal::internal_set_op0_kind(&mut instruction, OpKind::Memory);
super::instruction_internal::internal_set_memory_base(&mut instruction, memory.base);
super::instruction_internal::internal_set_memory_index(&mut instruction, memory.index);
instruction.set_memory_index_scale(memory.scale);
instruction.set_memory_displ_size(memory.displ_size);
instruction.set_memory_displacement(memory.displacement as u32);
instruction.set_is_broadcast(memory.is_broadcast);
instruction.set_segment_prefix(memory.segment_prefix);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register);
debug_assert_eq!(2, instruction.op_count());
instruction
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_mem_i32(code: Code, memory: MemoryOperand, immediate: i32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
super::instruction_internal::internal_set_op0_kind(&mut instruction, OpKind::Memory);
super::instruction_internal::internal_set_memory_base(&mut instruction, memory.base);
super::instruction_internal::internal_set_memory_index(&mut instruction, memory.index);
instruction.set_memory_index_scale(memory.scale);
instruction.set_memory_displ_size(memory.displ_size);
instruction.set_memory_displacement(memory.displacement as u32);
instruction.set_is_broadcast(memory.is_broadcast);
instruction.set_segment_prefix(memory.segment_prefix);
super::instruction_internal::initialize_signed_immediate(&mut instruction, 1, immediate as i64)?;
debug_assert_eq!(2, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_mem_i32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_mem_i32(code: Code, memory: MemoryOperand, immediate: i32) -> Self {
Instruction::try_with_mem_i32(code, memory, immediate).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_mem_u32(code: Code, memory: MemoryOperand, immediate: u32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
super::instruction_internal::internal_set_op0_kind(&mut instruction, OpKind::Memory);
super::instruction_internal::internal_set_memory_base(&mut instruction, memory.base);
super::instruction_internal::internal_set_memory_index(&mut instruction, memory.index);
instruction.set_memory_index_scale(memory.scale);
instruction.set_memory_displ_size(memory.displ_size);
instruction.set_memory_displacement(memory.displacement as u32);
instruction.set_is_broadcast(memory.is_broadcast);
instruction.set_segment_prefix(memory.segment_prefix);
super::instruction_internal::initialize_unsigned_immediate(&mut instruction, 1, immediate as u64)?;
debug_assert_eq!(2, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_mem_u32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_mem_u32(code: Code, memory: MemoryOperand, immediate: u32) -> Self {
Instruction::try_with_mem_u32(code, memory, immediate).unwrap()
}
#[cfg_attr(has_must_use, must_use)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_reg_reg(code: Code, register1: Register, register2: Register, register3: Register) -> Self {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register1);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register2);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op2_register(&mut instruction, register3);
debug_assert_eq!(3, instruction.op_count());
instruction
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_reg_reg_i32(code: Code, register1: Register, register2: Register, immediate: i32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register1);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register2);
super::instruction_internal::initialize_signed_immediate(&mut instruction, 2, immediate as i64)?;
debug_assert_eq!(3, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_reg_reg_i32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_reg_i32(code: Code, register1: Register, register2: Register, immediate: i32) -> Self {
Instruction::try_with_reg_reg_i32(code, register1, register2, immediate).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_reg_reg_u32(code: Code, register1: Register, register2: Register, immediate: u32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register1);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register2);
super::instruction_internal::initialize_unsigned_immediate(&mut instruction, 2, immediate as u64)?;
debug_assert_eq!(3, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_reg_reg_u32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_reg_u32(code: Code, register1: Register, register2: Register, immediate: u32) -> Self {
Instruction::try_with_reg_reg_u32(code, register1, register2, immediate).unwrap()
}
#[cfg_attr(has_must_use, must_use)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_reg_mem(code: Code, register1: Register, register2: Register, memory: MemoryOperand) -> Self {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register1);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register2);
super::instruction_internal::internal_set_op2_kind(&mut instruction, OpKind::Memory);
super::instruction_internal::internal_set_memory_base(&mut instruction, memory.base);
super::instruction_internal::internal_set_memory_index(&mut instruction, memory.index);
instruction.set_memory_index_scale(memory.scale);
instruction.set_memory_displ_size(memory.displ_size);
instruction.set_memory_displacement(memory.displacement as u32);
instruction.set_is_broadcast(memory.is_broadcast);
instruction.set_segment_prefix(memory.segment_prefix);
debug_assert_eq!(3, instruction.op_count());
instruction
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_reg_i32_i32(code: Code, register: Register, immediate1: i32, immediate2: i32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register);
super::instruction_internal::initialize_signed_immediate(&mut instruction, 1, immediate1 as i64)?;
super::instruction_internal::initialize_signed_immediate(&mut instruction, 2, immediate2 as i64)?;
debug_assert_eq!(3, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_reg_i32_i32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_i32_i32(code: Code, register: Register, immediate1: i32, immediate2: i32) -> Self {
Instruction::try_with_reg_i32_i32(code, register, immediate1, immediate2).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_reg_u32_u32(code: Code, register: Register, immediate1: u32, immediate2: u32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register);
super::instruction_internal::initialize_unsigned_immediate(&mut instruction, 1, immediate1 as u64)?;
super::instruction_internal::initialize_unsigned_immediate(&mut instruction, 2, immediate2 as u64)?;
debug_assert_eq!(3, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_reg_u32_u32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_u32_u32(code: Code, register: Register, immediate1: u32, immediate2: u32) -> Self {
Instruction::try_with_reg_u32_u32(code, register, immediate1, immediate2).unwrap()
}
#[cfg_attr(has_must_use, must_use)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_mem_reg(code: Code, register1: Register, memory: MemoryOperand, register2: Register) -> Self {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register1);
super::instruction_internal::internal_set_op1_kind(&mut instruction, OpKind::Memory);
super::instruction_internal::internal_set_memory_base(&mut instruction, memory.base);
super::instruction_internal::internal_set_memory_index(&mut instruction, memory.index);
instruction.set_memory_index_scale(memory.scale);
instruction.set_memory_displ_size(memory.displ_size);
instruction.set_memory_displacement(memory.displacement as u32);
instruction.set_is_broadcast(memory.is_broadcast);
instruction.set_segment_prefix(memory.segment_prefix);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op2_register(&mut instruction, register2);
debug_assert_eq!(3, instruction.op_count());
instruction
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_reg_mem_i32(code: Code, register: Register, memory: MemoryOperand, immediate: i32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register);
super::instruction_internal::internal_set_op1_kind(&mut instruction, OpKind::Memory);
super::instruction_internal::internal_set_memory_base(&mut instruction, memory.base);
super::instruction_internal::internal_set_memory_index(&mut instruction, memory.index);
instruction.set_memory_index_scale(memory.scale);
instruction.set_memory_displ_size(memory.displ_size);
instruction.set_memory_displacement(memory.displacement as u32);
instruction.set_is_broadcast(memory.is_broadcast);
instruction.set_segment_prefix(memory.segment_prefix);
super::instruction_internal::initialize_signed_immediate(&mut instruction, 2, immediate as i64)?;
debug_assert_eq!(3, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_reg_mem_i32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_mem_i32(code: Code, register: Register, memory: MemoryOperand, immediate: i32) -> Self {
Instruction::try_with_reg_mem_i32(code, register, memory, immediate).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_reg_mem_u32(code: Code, register: Register, memory: MemoryOperand, immediate: u32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register);
super::instruction_internal::internal_set_op1_kind(&mut instruction, OpKind::Memory);
super::instruction_internal::internal_set_memory_base(&mut instruction, memory.base);
super::instruction_internal::internal_set_memory_index(&mut instruction, memory.index);
instruction.set_memory_index_scale(memory.scale);
instruction.set_memory_displ_size(memory.displ_size);
instruction.set_memory_displacement(memory.displacement as u32);
instruction.set_is_broadcast(memory.is_broadcast);
instruction.set_segment_prefix(memory.segment_prefix);
super::instruction_internal::initialize_unsigned_immediate(&mut instruction, 2, immediate as u64)?;
debug_assert_eq!(3, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_reg_mem_u32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_mem_u32(code: Code, register: Register, memory: MemoryOperand, immediate: u32) -> Self {
Instruction::try_with_reg_mem_u32(code, register, memory, immediate).unwrap()
}
#[cfg_attr(has_must_use, must_use)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_mem_reg_reg(code: Code, memory: MemoryOperand, register1: Register, register2: Register) -> Self {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
super::instruction_internal::internal_set_op0_kind(&mut instruction, OpKind::Memory);
super::instruction_internal::internal_set_memory_base(&mut instruction, memory.base);
super::instruction_internal::internal_set_memory_index(&mut instruction, memory.index);
instruction.set_memory_index_scale(memory.scale);
instruction.set_memory_displ_size(memory.displ_size);
instruction.set_memory_displacement(memory.displacement as u32);
instruction.set_is_broadcast(memory.is_broadcast);
instruction.set_segment_prefix(memory.segment_prefix);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register1);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op2_register(&mut instruction, register2);
debug_assert_eq!(3, instruction.op_count());
instruction
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_mem_reg_i32(code: Code, memory: MemoryOperand, register: Register, immediate: i32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
super::instruction_internal::internal_set_op0_kind(&mut instruction, OpKind::Memory);
super::instruction_internal::internal_set_memory_base(&mut instruction, memory.base);
super::instruction_internal::internal_set_memory_index(&mut instruction, memory.index);
instruction.set_memory_index_scale(memory.scale);
instruction.set_memory_displ_size(memory.displ_size);
instruction.set_memory_displacement(memory.displacement as u32);
instruction.set_is_broadcast(memory.is_broadcast);
instruction.set_segment_prefix(memory.segment_prefix);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register);
super::instruction_internal::initialize_signed_immediate(&mut instruction, 2, immediate as i64)?;
debug_assert_eq!(3, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_mem_reg_i32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_mem_reg_i32(code: Code, memory: MemoryOperand, register: Register, immediate: i32) -> Self {
Instruction::try_with_mem_reg_i32(code, memory, register, immediate).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_mem_reg_u32(code: Code, memory: MemoryOperand, register: Register, immediate: u32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
super::instruction_internal::internal_set_op0_kind(&mut instruction, OpKind::Memory);
super::instruction_internal::internal_set_memory_base(&mut instruction, memory.base);
super::instruction_internal::internal_set_memory_index(&mut instruction, memory.index);
instruction.set_memory_index_scale(memory.scale);
instruction.set_memory_displ_size(memory.displ_size);
instruction.set_memory_displacement(memory.displacement as u32);
instruction.set_is_broadcast(memory.is_broadcast);
instruction.set_segment_prefix(memory.segment_prefix);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register);
super::instruction_internal::initialize_unsigned_immediate(&mut instruction, 2, immediate as u64)?;
debug_assert_eq!(3, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_mem_reg_u32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_mem_reg_u32(code: Code, memory: MemoryOperand, register: Register, immediate: u32) -> Self {
Instruction::try_with_mem_reg_u32(code, memory, register, immediate).unwrap()
}
#[cfg_attr(has_must_use, must_use)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_reg_reg_reg(code: Code, register1: Register, register2: Register, register3: Register, register4: Register) -> Self {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register1);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register2);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op2_register(&mut instruction, register3);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op3_register(&mut instruction, register4);
debug_assert_eq!(4, instruction.op_count());
instruction
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_reg_reg_reg_i32(code: Code, register1: Register, register2: Register, register3: Register, immediate: i32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register1);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register2);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op2_register(&mut instruction, register3);
super::instruction_internal::initialize_signed_immediate(&mut instruction, 3, immediate as i64)?;
debug_assert_eq!(4, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_reg_reg_reg_i32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_reg_reg_i32(code: Code, register1: Register, register2: Register, register3: Register, immediate: i32) -> Self {
Instruction::try_with_reg_reg_reg_i32(code, register1, register2, register3, immediate).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_reg_reg_reg_u32(code: Code, register1: Register, register2: Register, register3: Register, immediate: u32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register1);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register2);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op2_register(&mut instruction, register3);
super::instruction_internal::initialize_unsigned_immediate(&mut instruction, 3, immediate as u64)?;
debug_assert_eq!(4, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_reg_reg_reg_u32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_reg_reg_u32(code: Code, register1: Register, register2: Register, register3: Register, immediate: u32) -> Self {
Instruction::try_with_reg_reg_reg_u32(code, register1, register2, register3, immediate).unwrap()
}
#[cfg_attr(has_must_use, must_use)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_reg_reg_mem(code: Code, register1: Register, register2: Register, register3: Register, memory: MemoryOperand) -> Self {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register1);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register2);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op2_register(&mut instruction, register3);
super::instruction_internal::internal_set_op3_kind(&mut instruction, OpKind::Memory);
super::instruction_internal::internal_set_memory_base(&mut instruction, memory.base);
super::instruction_internal::internal_set_memory_index(&mut instruction, memory.index);
instruction.set_memory_index_scale(memory.scale);
instruction.set_memory_displ_size(memory.displ_size);
instruction.set_memory_displacement(memory.displacement as u32);
instruction.set_is_broadcast(memory.is_broadcast);
instruction.set_segment_prefix(memory.segment_prefix);
debug_assert_eq!(4, instruction.op_count());
instruction
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_reg_reg_i32_i32(code: Code, register1: Register, register2: Register, immediate1: i32, immediate2: i32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register1);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register2);
super::instruction_internal::initialize_signed_immediate(&mut instruction, 2, immediate1 as i64)?;
super::instruction_internal::initialize_signed_immediate(&mut instruction, 3, immediate2 as i64)?;
debug_assert_eq!(4, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_reg_reg_i32_i32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_reg_i32_i32(code: Code, register1: Register, register2: Register, immediate1: i32, immediate2: i32) -> Self {
Instruction::try_with_reg_reg_i32_i32(code, register1, register2, immediate1, immediate2).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_reg_reg_u32_u32(code: Code, register1: Register, register2: Register, immediate1: u32, immediate2: u32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register1);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register2);
super::instruction_internal::initialize_unsigned_immediate(&mut instruction, 2, immediate1 as u64)?;
super::instruction_internal::initialize_unsigned_immediate(&mut instruction, 3, immediate2 as u64)?;
debug_assert_eq!(4, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_reg_reg_u32_u32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_reg_u32_u32(code: Code, register1: Register, register2: Register, immediate1: u32, immediate2: u32) -> Self {
Instruction::try_with_reg_reg_u32_u32(code, register1, register2, immediate1, immediate2).unwrap()
}
#[cfg_attr(has_must_use, must_use)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_reg_mem_reg(code: Code, register1: Register, register2: Register, memory: MemoryOperand, register3: Register) -> Self {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register1);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register2);
super::instruction_internal::internal_set_op2_kind(&mut instruction, OpKind::Memory);
super::instruction_internal::internal_set_memory_base(&mut instruction, memory.base);
super::instruction_internal::internal_set_memory_index(&mut instruction, memory.index);
instruction.set_memory_index_scale(memory.scale);
instruction.set_memory_displ_size(memory.displ_size);
instruction.set_memory_displacement(memory.displacement as u32);
instruction.set_is_broadcast(memory.is_broadcast);
instruction.set_segment_prefix(memory.segment_prefix);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op3_register(&mut instruction, register3);
debug_assert_eq!(4, instruction.op_count());
instruction
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_reg_reg_mem_i32(code: Code, register1: Register, register2: Register, memory: MemoryOperand, immediate: i32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register1);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register2);
super::instruction_internal::internal_set_op2_kind(&mut instruction, OpKind::Memory);
super::instruction_internal::internal_set_memory_base(&mut instruction, memory.base);
super::instruction_internal::internal_set_memory_index(&mut instruction, memory.index);
instruction.set_memory_index_scale(memory.scale);
instruction.set_memory_displ_size(memory.displ_size);
instruction.set_memory_displacement(memory.displacement as u32);
instruction.set_is_broadcast(memory.is_broadcast);
instruction.set_segment_prefix(memory.segment_prefix);
super::instruction_internal::initialize_signed_immediate(&mut instruction, 3, immediate as i64)?;
debug_assert_eq!(4, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_reg_reg_mem_i32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_reg_mem_i32(code: Code, register1: Register, register2: Register, memory: MemoryOperand, immediate: i32) -> Self {
Instruction::try_with_reg_reg_mem_i32(code, register1, register2, memory, immediate).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_reg_reg_mem_u32(code: Code, register1: Register, register2: Register, memory: MemoryOperand, immediate: u32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register1);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register2);
super::instruction_internal::internal_set_op2_kind(&mut instruction, OpKind::Memory);
super::instruction_internal::internal_set_memory_base(&mut instruction, memory.base);
super::instruction_internal::internal_set_memory_index(&mut instruction, memory.index);
instruction.set_memory_index_scale(memory.scale);
instruction.set_memory_displ_size(memory.displ_size);
instruction.set_memory_displacement(memory.displacement as u32);
instruction.set_is_broadcast(memory.is_broadcast);
instruction.set_segment_prefix(memory.segment_prefix);
super::instruction_internal::initialize_unsigned_immediate(&mut instruction, 3, immediate as u64)?;
debug_assert_eq!(4, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_reg_reg_mem_u32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_reg_mem_u32(code: Code, register1: Register, register2: Register, memory: MemoryOperand, immediate: u32) -> Self {
Instruction::try_with_reg_reg_mem_u32(code, register1, register2, memory, immediate).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_reg_reg_reg_reg_i32(code: Code, register1: Register, register2: Register, register3: Register, register4: Register, immediate: i32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register1);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register2);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op2_register(&mut instruction, register3);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op3_register(&mut instruction, register4);
super::instruction_internal::initialize_signed_immediate(&mut instruction, 4, immediate as i64)?;
debug_assert_eq!(5, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_reg_reg_reg_reg_i32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_reg_reg_reg_i32(code: Code, register1: Register, register2: Register, register3: Register, register4: Register, immediate: i32) -> Self {
Instruction::try_with_reg_reg_reg_reg_i32(code, register1, register2, register3, register4, immediate).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_reg_reg_reg_reg_u32(code: Code, register1: Register, register2: Register, register3: Register, register4: Register, immediate: u32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register1);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register2);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op2_register(&mut instruction, register3);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op3_register(&mut instruction, register4);
super::instruction_internal::initialize_unsigned_immediate(&mut instruction, 4, immediate as u64)?;
debug_assert_eq!(5, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_reg_reg_reg_reg_u32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_reg_reg_reg_u32(code: Code, register1: Register, register2: Register, register3: Register, register4: Register, immediate: u32) -> Self {
Instruction::try_with_reg_reg_reg_reg_u32(code, register1, register2, register3, register4, immediate).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_reg_reg_reg_mem_i32(code: Code, register1: Register, register2: Register, register3: Register, memory: MemoryOperand, immediate: i32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register1);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register2);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op2_register(&mut instruction, register3);
super::instruction_internal::internal_set_op3_kind(&mut instruction, OpKind::Memory);
super::instruction_internal::internal_set_memory_base(&mut instruction, memory.base);
super::instruction_internal::internal_set_memory_index(&mut instruction, memory.index);
instruction.set_memory_index_scale(memory.scale);
instruction.set_memory_displ_size(memory.displ_size);
instruction.set_memory_displacement(memory.displacement as u32);
instruction.set_is_broadcast(memory.is_broadcast);
instruction.set_segment_prefix(memory.segment_prefix);
super::instruction_internal::initialize_signed_immediate(&mut instruction, 4, immediate as i64)?;
debug_assert_eq!(5, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_reg_reg_reg_mem_i32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_reg_reg_mem_i32(code: Code, register1: Register, register2: Register, register3: Register, memory: MemoryOperand, immediate: i32) -> Self {
Instruction::try_with_reg_reg_reg_mem_i32(code, register1, register2, register3, memory, immediate).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_reg_reg_reg_mem_u32(code: Code, register1: Register, register2: Register, register3: Register, memory: MemoryOperand, immediate: u32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register1);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register2);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op2_register(&mut instruction, register3);
super::instruction_internal::internal_set_op3_kind(&mut instruction, OpKind::Memory);
super::instruction_internal::internal_set_memory_base(&mut instruction, memory.base);
super::instruction_internal::internal_set_memory_index(&mut instruction, memory.index);
instruction.set_memory_index_scale(memory.scale);
instruction.set_memory_displ_size(memory.displ_size);
instruction.set_memory_displacement(memory.displacement as u32);
instruction.set_is_broadcast(memory.is_broadcast);
instruction.set_segment_prefix(memory.segment_prefix);
super::instruction_internal::initialize_unsigned_immediate(&mut instruction, 4, immediate as u64)?;
debug_assert_eq!(5, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_reg_reg_reg_mem_u32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_reg_reg_mem_u32(code: Code, register1: Register, register2: Register, register3: Register, memory: MemoryOperand, immediate: u32) -> Self {
Instruction::try_with_reg_reg_reg_mem_u32(code, register1, register2, register3, memory, immediate).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_reg_reg_mem_reg_i32(code: Code, register1: Register, register2: Register, memory: MemoryOperand, register3: Register, immediate: i32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register1);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register2);
super::instruction_internal::internal_set_op2_kind(&mut instruction, OpKind::Memory);
super::instruction_internal::internal_set_memory_base(&mut instruction, memory.base);
super::instruction_internal::internal_set_memory_index(&mut instruction, memory.index);
instruction.set_memory_index_scale(memory.scale);
instruction.set_memory_displ_size(memory.displ_size);
instruction.set_memory_displacement(memory.displacement as u32);
instruction.set_is_broadcast(memory.is_broadcast);
instruction.set_segment_prefix(memory.segment_prefix);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op3_register(&mut instruction, register3);
super::instruction_internal::initialize_signed_immediate(&mut instruction, 4, immediate as i64)?;
debug_assert_eq!(5, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_reg_reg_mem_reg_i32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_reg_mem_reg_i32(code: Code, register1: Register, register2: Register, memory: MemoryOperand, register3: Register, immediate: i32) -> Self {
Instruction::try_with_reg_reg_mem_reg_i32(code, register1, register2, memory, register3, immediate).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_reg_reg_mem_reg_u32(code: Code, register1: Register, register2: Register, memory: MemoryOperand, register3: Register, immediate: u32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register1);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register2);
super::instruction_internal::internal_set_op2_kind(&mut instruction, OpKind::Memory);
super::instruction_internal::internal_set_memory_base(&mut instruction, memory.base);
super::instruction_internal::internal_set_memory_index(&mut instruction, memory.index);
instruction.set_memory_index_scale(memory.scale);
instruction.set_memory_displ_size(memory.displ_size);
instruction.set_memory_displacement(memory.displacement as u32);
instruction.set_is_broadcast(memory.is_broadcast);
instruction.set_segment_prefix(memory.segment_prefix);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op3_register(&mut instruction, register3);
super::instruction_internal::initialize_unsigned_immediate(&mut instruction, 4, immediate as u64)?;
debug_assert_eq!(5, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_reg_reg_mem_reg_u32() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_reg_mem_reg_u32(code: Code, register1: Register, register2: Register, memory: MemoryOperand, register3: Register, immediate: u32) -> Self {
Instruction::try_with_reg_reg_mem_reg_u32(code, register1, register2, memory, register3, immediate).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_branch(code: Code, target: u64) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
super::instruction_internal::internal_set_op0_kind(&mut instruction, super::instruction_internal::get_near_branch_op_kind(code, 0)?);
instruction.set_near_branch64(target);
debug_assert_eq!(1, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_branch() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_branch(code: Code, target: u64) -> Self {
Instruction::try_with_branch(code, target).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_far_branch(code: Code, selector: u16, offset: u32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
super::instruction_internal::internal_set_op0_kind(&mut instruction, super::instruction_internal::get_far_branch_op_kind(code, 0)?);
instruction.set_far_branch_selector(selector);
instruction.set_far_branch32(offset);
debug_assert_eq!(1, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_far_branch() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_far_branch(code: Code, selector: u16, offset: u32) -> Self {
Instruction::try_with_far_branch(code, selector, offset).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_xbegin(bitness: u32, target: u64) -> Result<Self, IcedError> {
let mut instruction = Self::default();
match bitness {
16 => {
super::instruction_internal::internal_set_code(&mut instruction, Code::Xbegin_rel16);
super::instruction_internal::internal_set_op0_kind(&mut instruction, OpKind::NearBranch32);
instruction.set_near_branch32(target as u32);
}
32 => {
super::instruction_internal::internal_set_code(&mut instruction, Code::Xbegin_rel32);
super::instruction_internal::internal_set_op0_kind(&mut instruction, OpKind::NearBranch32);
instruction.set_near_branch32(target as u32);
}
64 => {
super::instruction_internal::internal_set_code(&mut instruction, Code::Xbegin_rel32);
super::instruction_internal::internal_set_op0_kind(&mut instruction, OpKind::NearBranch64);
instruction.set_near_branch64(target);
}
_ => return Err(IcedError::new("Invalid bitness")),
}
debug_assert_eq!(1, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_xbegin() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_xbegin(bitness: u32, target: u64) -> Self {
Instruction::try_with_xbegin(bitness, target).unwrap()
}
#[cfg_attr(has_must_use, must_use)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_reg_mem64(code: Code, register: Register, address: u64, segment_prefix: Register) -> Self {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
super::instruction_internal::internal_set_op1_kind(&mut instruction, OpKind::Memory64);
instruction.set_memory_address64(address);
super::instruction_internal::internal_set_memory_displ_size(&mut instruction, 4);
instruction.set_segment_prefix(segment_prefix);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op0_register(&mut instruction, register);
debug_assert_eq!(2, instruction.op_count());
instruction
}
#[cfg_attr(has_must_use, must_use)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_mem64_reg(code: Code, address: u64, register: Register, segment_prefix: Register) -> Self {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, code);
super::instruction_internal::internal_set_op0_kind(&mut instruction, OpKind::Memory64);
instruction.set_memory_address64(address);
super::instruction_internal::internal_set_memory_displ_size(&mut instruction, 4);
instruction.set_segment_prefix(segment_prefix);
const_assert_eq!(0, OpKind::Register as u32);
super::instruction_internal::internal_set_op1_register(&mut instruction, register);
debug_assert_eq!(2, instruction.op_count());
instruction
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_outsb(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_segrsi(Code::Outsb_DX_m8, address_size, Register::DX, segment_prefix, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_outsb() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_outsb(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_outsb(address_size, segment_prefix, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_rep_outsb(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_segrsi(Code::Outsb_DX_m8, address_size, Register::DX, Register::None, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_rep_outsb() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_rep_outsb(address_size: u32) -> Self {
Instruction::try_with_rep_outsb(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_outsw(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_segrsi(Code::Outsw_DX_m16, address_size, Register::DX, segment_prefix, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_outsw() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_outsw(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_outsw(address_size, segment_prefix, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_rep_outsw(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_segrsi(Code::Outsw_DX_m16, address_size, Register::DX, Register::None, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_rep_outsw() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_rep_outsw(address_size: u32) -> Self {
Instruction::try_with_rep_outsw(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_outsd(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_segrsi(Code::Outsd_DX_m32, address_size, Register::DX, segment_prefix, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_outsd() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_outsd(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_outsd(address_size, segment_prefix, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_rep_outsd(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_segrsi(Code::Outsd_DX_m32, address_size, Register::DX, Register::None, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_rep_outsd() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_rep_outsd(address_size: u32) -> Self {
Instruction::try_with_rep_outsd(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_lodsb(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_segrsi(Code::Lodsb_AL_m8, address_size, Register::AL, segment_prefix, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_lodsb() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_lodsb(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_lodsb(address_size, segment_prefix, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_rep_lodsb(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_segrsi(Code::Lodsb_AL_m8, address_size, Register::AL, Register::None, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_rep_lodsb() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_rep_lodsb(address_size: u32) -> Self {
Instruction::try_with_rep_lodsb(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_lodsw(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_segrsi(Code::Lodsw_AX_m16, address_size, Register::AX, segment_prefix, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_lodsw() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_lodsw(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_lodsw(address_size, segment_prefix, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_rep_lodsw(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_segrsi(Code::Lodsw_AX_m16, address_size, Register::AX, Register::None, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_rep_lodsw() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_rep_lodsw(address_size: u32) -> Self {
Instruction::try_with_rep_lodsw(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_lodsd(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_segrsi(Code::Lodsd_EAX_m32, address_size, Register::EAX, segment_prefix, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_lodsd() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_lodsd(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_lodsd(address_size, segment_prefix, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_rep_lodsd(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_segrsi(Code::Lodsd_EAX_m32, address_size, Register::EAX, Register::None, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_rep_lodsd() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_rep_lodsd(address_size: u32) -> Self {
Instruction::try_with_rep_lodsd(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_lodsq(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_segrsi(Code::Lodsq_RAX_m64, address_size, Register::RAX, segment_prefix, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_lodsq() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_lodsq(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_lodsq(address_size, segment_prefix, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_rep_lodsq(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_segrsi(Code::Lodsq_RAX_m64, address_size, Register::RAX, Register::None, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_rep_lodsq() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_rep_lodsq(address_size: u32) -> Self {
Instruction::try_with_rep_lodsq(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_scasb(address_size: u32, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_esrdi(Code::Scasb_AL_m8, address_size, Register::AL, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_scasb() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_scasb(address_size: u32, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_scasb(address_size, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_repe_scasb(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_esrdi(Code::Scasb_AL_m8, address_size, Register::AL, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_repe_scasb() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_repe_scasb(address_size: u32) -> Self {
Instruction::try_with_repe_scasb(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_repne_scasb(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_esrdi(Code::Scasb_AL_m8, address_size, Register::AL, RepPrefixKind::Repne)
}
#[deprecated(since = "1.10.0", note = "Use try_with_repne_scasb() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_repne_scasb(address_size: u32) -> Self {
Instruction::try_with_repne_scasb(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_scasw(address_size: u32, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_esrdi(Code::Scasw_AX_m16, address_size, Register::AX, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_scasw() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_scasw(address_size: u32, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_scasw(address_size, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_repe_scasw(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_esrdi(Code::Scasw_AX_m16, address_size, Register::AX, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_repe_scasw() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_repe_scasw(address_size: u32) -> Self {
Instruction::try_with_repe_scasw(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_repne_scasw(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_esrdi(Code::Scasw_AX_m16, address_size, Register::AX, RepPrefixKind::Repne)
}
#[deprecated(since = "1.10.0", note = "Use try_with_repne_scasw() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_repne_scasw(address_size: u32) -> Self {
Instruction::try_with_repne_scasw(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_scasd(address_size: u32, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_esrdi(Code::Scasd_EAX_m32, address_size, Register::EAX, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_scasd() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_scasd(address_size: u32, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_scasd(address_size, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_repe_scasd(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_esrdi(Code::Scasd_EAX_m32, address_size, Register::EAX, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_repe_scasd() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_repe_scasd(address_size: u32) -> Self {
Instruction::try_with_repe_scasd(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_repne_scasd(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_esrdi(Code::Scasd_EAX_m32, address_size, Register::EAX, RepPrefixKind::Repne)
}
#[deprecated(since = "1.10.0", note = "Use try_with_repne_scasd() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_repne_scasd(address_size: u32) -> Self {
Instruction::try_with_repne_scasd(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_scasq(address_size: u32, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_esrdi(Code::Scasq_RAX_m64, address_size, Register::RAX, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_scasq() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_scasq(address_size: u32, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_scasq(address_size, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_repe_scasq(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_esrdi(Code::Scasq_RAX_m64, address_size, Register::RAX, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_repe_scasq() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_repe_scasq(address_size: u32) -> Self {
Instruction::try_with_repe_scasq(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_repne_scasq(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_reg_esrdi(Code::Scasq_RAX_m64, address_size, Register::RAX, RepPrefixKind::Repne)
}
#[deprecated(since = "1.10.0", note = "Use try_with_repne_scasq() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_repne_scasq(address_size: u32) -> Self {
Instruction::try_with_repne_scasq(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_insb(address_size: u32, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_esrdi_reg(Code::Insb_m8_DX, address_size, Register::DX, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_insb() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_insb(address_size: u32, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_insb(address_size, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_rep_insb(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_esrdi_reg(Code::Insb_m8_DX, address_size, Register::DX, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_rep_insb() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_rep_insb(address_size: u32) -> Self {
Instruction::try_with_rep_insb(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_insw(address_size: u32, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_esrdi_reg(Code::Insw_m16_DX, address_size, Register::DX, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_insw() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_insw(address_size: u32, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_insw(address_size, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_rep_insw(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_esrdi_reg(Code::Insw_m16_DX, address_size, Register::DX, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_rep_insw() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_rep_insw(address_size: u32) -> Self {
Instruction::try_with_rep_insw(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_insd(address_size: u32, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_esrdi_reg(Code::Insd_m32_DX, address_size, Register::DX, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_insd() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_insd(address_size: u32, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_insd(address_size, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_rep_insd(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_esrdi_reg(Code::Insd_m32_DX, address_size, Register::DX, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_rep_insd() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_rep_insd(address_size: u32) -> Self {
Instruction::try_with_rep_insd(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_stosb(address_size: u32, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_esrdi_reg(Code::Stosb_m8_AL, address_size, Register::AL, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_stosb() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_stosb(address_size: u32, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_stosb(address_size, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_rep_stosb(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_esrdi_reg(Code::Stosb_m8_AL, address_size, Register::AL, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_rep_stosb() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_rep_stosb(address_size: u32) -> Self {
Instruction::try_with_rep_stosb(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_stosw(address_size: u32, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_esrdi_reg(Code::Stosw_m16_AX, address_size, Register::AX, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_stosw() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_stosw(address_size: u32, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_stosw(address_size, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_rep_stosw(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_esrdi_reg(Code::Stosw_m16_AX, address_size, Register::AX, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_rep_stosw() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_rep_stosw(address_size: u32) -> Self {
Instruction::try_with_rep_stosw(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_stosd(address_size: u32, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_esrdi_reg(Code::Stosd_m32_EAX, address_size, Register::EAX, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_stosd() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_stosd(address_size: u32, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_stosd(address_size, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_rep_stosd(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_esrdi_reg(Code::Stosd_m32_EAX, address_size, Register::EAX, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_rep_stosd() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_rep_stosd(address_size: u32) -> Self {
Instruction::try_with_rep_stosd(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_stosq(address_size: u32, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_esrdi_reg(Code::Stosq_m64_RAX, address_size, Register::RAX, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_stosq() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_stosq(address_size: u32, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_stosq(address_size, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_rep_stosq(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_esrdi_reg(Code::Stosq_m64_RAX, address_size, Register::RAX, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_rep_stosq() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_rep_stosq(address_size: u32) -> Self {
Instruction::try_with_rep_stosq(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_cmpsb(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_segrsi_esrdi(Code::Cmpsb_m8_m8, address_size, segment_prefix, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_cmpsb() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_cmpsb(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_cmpsb(address_size, segment_prefix, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_repe_cmpsb(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_segrsi_esrdi(Code::Cmpsb_m8_m8, address_size, Register::None, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_repe_cmpsb() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_repe_cmpsb(address_size: u32) -> Self {
Instruction::try_with_repe_cmpsb(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_repne_cmpsb(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_segrsi_esrdi(Code::Cmpsb_m8_m8, address_size, Register::None, RepPrefixKind::Repne)
}
#[deprecated(since = "1.10.0", note = "Use try_with_repne_cmpsb() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_repne_cmpsb(address_size: u32) -> Self {
Instruction::try_with_repne_cmpsb(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_cmpsw(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_segrsi_esrdi(Code::Cmpsw_m16_m16, address_size, segment_prefix, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_cmpsw() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_cmpsw(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_cmpsw(address_size, segment_prefix, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_repe_cmpsw(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_segrsi_esrdi(Code::Cmpsw_m16_m16, address_size, Register::None, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_repe_cmpsw() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_repe_cmpsw(address_size: u32) -> Self {
Instruction::try_with_repe_cmpsw(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_repne_cmpsw(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_segrsi_esrdi(Code::Cmpsw_m16_m16, address_size, Register::None, RepPrefixKind::Repne)
}
#[deprecated(since = "1.10.0", note = "Use try_with_repne_cmpsw() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_repne_cmpsw(address_size: u32) -> Self {
Instruction::try_with_repne_cmpsw(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_cmpsd(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_segrsi_esrdi(Code::Cmpsd_m32_m32, address_size, segment_prefix, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_cmpsd() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_cmpsd(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_cmpsd(address_size, segment_prefix, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_repe_cmpsd(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_segrsi_esrdi(Code::Cmpsd_m32_m32, address_size, Register::None, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_repe_cmpsd() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_repe_cmpsd(address_size: u32) -> Self {
Instruction::try_with_repe_cmpsd(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_repne_cmpsd(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_segrsi_esrdi(Code::Cmpsd_m32_m32, address_size, Register::None, RepPrefixKind::Repne)
}
#[deprecated(since = "1.10.0", note = "Use try_with_repne_cmpsd() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_repne_cmpsd(address_size: u32) -> Self {
Instruction::try_with_repne_cmpsd(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_cmpsq(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_segrsi_esrdi(Code::Cmpsq_m64_m64, address_size, segment_prefix, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_cmpsq() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_cmpsq(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_cmpsq(address_size, segment_prefix, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_repe_cmpsq(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_segrsi_esrdi(Code::Cmpsq_m64_m64, address_size, Register::None, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_repe_cmpsq() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_repe_cmpsq(address_size: u32) -> Self {
Instruction::try_with_repe_cmpsq(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_repne_cmpsq(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_segrsi_esrdi(Code::Cmpsq_m64_m64, address_size, Register::None, RepPrefixKind::Repne)
}
#[deprecated(since = "1.10.0", note = "Use try_with_repne_cmpsq() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_repne_cmpsq(address_size: u32) -> Self {
Instruction::try_with_repne_cmpsq(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_movsb(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_esrdi_segrsi(Code::Movsb_m8_m8, address_size, segment_prefix, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_movsb() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_movsb(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_movsb(address_size, segment_prefix, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_rep_movsb(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_esrdi_segrsi(Code::Movsb_m8_m8, address_size, Register::None, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_rep_movsb() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_rep_movsb(address_size: u32) -> Self {
Instruction::try_with_rep_movsb(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_movsw(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_esrdi_segrsi(Code::Movsw_m16_m16, address_size, segment_prefix, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_movsw() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_movsw(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_movsw(address_size, segment_prefix, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_rep_movsw(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_esrdi_segrsi(Code::Movsw_m16_m16, address_size, Register::None, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_rep_movsw() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_rep_movsw(address_size: u32) -> Self {
Instruction::try_with_rep_movsw(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_movsd(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_esrdi_segrsi(Code::Movsd_m32_m32, address_size, segment_prefix, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_movsd() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_movsd(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_movsd(address_size, segment_prefix, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_rep_movsd(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_esrdi_segrsi(Code::Movsd_m32_m32, address_size, Register::None, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_rep_movsd() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_rep_movsd(address_size: u32) -> Self {
Instruction::try_with_rep_movsd(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_movsq(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Result<Self, IcedError> {
super::instruction_internal::with_string_esrdi_segrsi(Code::Movsq_m64_m64, address_size, segment_prefix, rep_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_movsq() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_movsq(address_size: u32, segment_prefix: Register, rep_prefix: RepPrefixKind) -> Self {
Instruction::try_with_movsq(address_size, segment_prefix, rep_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_rep_movsq(address_size: u32) -> Result<Self, IcedError> {
super::instruction_internal::with_string_esrdi_segrsi(Code::Movsq_m64_m64, address_size, Register::None, RepPrefixKind::Repe)
}
#[deprecated(since = "1.10.0", note = "Use try_with_rep_movsq() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_rep_movsq(address_size: u32) -> Self {
Instruction::try_with_rep_movsq(address_size).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_maskmovq(address_size: u32, register1: Register, register2: Register, segment_prefix: Register) -> Result<Self, IcedError> {
super::instruction_internal::with_maskmov(Code::Maskmovq_rDI_mm_mm, address_size, register1, register2, segment_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_maskmovq() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_maskmovq(address_size: u32, register1: Register, register2: Register, segment_prefix: Register) -> Self {
Instruction::try_with_maskmovq(address_size, register1, register2, segment_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_maskmovdqu(address_size: u32, register1: Register, register2: Register, segment_prefix: Register) -> Result<Self, IcedError> {
super::instruction_internal::with_maskmov(Code::Maskmovdqu_rDI_xmm_xmm, address_size, register1, register2, segment_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_maskmovdqu() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_maskmovdqu(address_size: u32, register1: Register, register2: Register, segment_prefix: Register) -> Self {
Instruction::try_with_maskmovdqu(address_size, register1, register2, segment_prefix).unwrap()
}
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_vmaskmovdqu(address_size: u32, register1: Register, register2: Register, segment_prefix: Register) -> Result<Self, IcedError> {
super::instruction_internal::with_maskmov(Code::VEX_Vmaskmovdqu_rDI_xmm_xmm, address_size, register1, register2, segment_prefix)
}
#[deprecated(since = "1.10.0", note = "Use try_with_vmaskmovdqu() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_vmaskmovdqu(address_size: u32, register1: Register, register2: Register, segment_prefix: Register) -> Self {
Instruction::try_with_vmaskmovdqu(address_size, register1, register2, segment_prefix).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_byte_1(b0: u8) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareByte);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 1);
instruction.try_set_declare_byte_value(0, b0)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_byte_1() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_byte_1(b0: u8) -> Self {
Instruction::try_with_declare_byte_1(b0).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_byte_2(b0: u8, b1: u8) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareByte);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 2);
instruction.try_set_declare_byte_value(0, b0)?;
instruction.try_set_declare_byte_value(1, b1)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_byte_2() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_byte_2(b0: u8, b1: u8) -> Self {
Instruction::try_with_declare_byte_2(b0, b1).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_byte_3(b0: u8, b1: u8, b2: u8) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareByte);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 3);
instruction.try_set_declare_byte_value(0, b0)?;
instruction.try_set_declare_byte_value(1, b1)?;
instruction.try_set_declare_byte_value(2, b2)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_byte_3() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_byte_3(b0: u8, b1: u8, b2: u8) -> Self {
Instruction::try_with_declare_byte_3(b0, b1, b2).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_byte_4(b0: u8, b1: u8, b2: u8, b3: u8) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareByte);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 4);
instruction.try_set_declare_byte_value(0, b0)?;
instruction.try_set_declare_byte_value(1, b1)?;
instruction.try_set_declare_byte_value(2, b2)?;
instruction.try_set_declare_byte_value(3, b3)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_byte_4() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_byte_4(b0: u8, b1: u8, b2: u8, b3: u8) -> Self {
Instruction::try_with_declare_byte_4(b0, b1, b2, b3).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_byte_5(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareByte);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 5);
instruction.try_set_declare_byte_value(0, b0)?;
instruction.try_set_declare_byte_value(1, b1)?;
instruction.try_set_declare_byte_value(2, b2)?;
instruction.try_set_declare_byte_value(3, b3)?;
instruction.try_set_declare_byte_value(4, b4)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_byte_5() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_byte_5(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8) -> Self {
Instruction::try_with_declare_byte_5(b0, b1, b2, b3, b4).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_byte_6(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8, b5: u8) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareByte);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 6);
instruction.try_set_declare_byte_value(0, b0)?;
instruction.try_set_declare_byte_value(1, b1)?;
instruction.try_set_declare_byte_value(2, b2)?;
instruction.try_set_declare_byte_value(3, b3)?;
instruction.try_set_declare_byte_value(4, b4)?;
instruction.try_set_declare_byte_value(5, b5)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_byte_6() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_byte_6(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8, b5: u8) -> Self {
Instruction::try_with_declare_byte_6(b0, b1, b2, b3, b4, b5).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_byte_7(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8, b5: u8, b6: u8) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareByte);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 7);
instruction.try_set_declare_byte_value(0, b0)?;
instruction.try_set_declare_byte_value(1, b1)?;
instruction.try_set_declare_byte_value(2, b2)?;
instruction.try_set_declare_byte_value(3, b3)?;
instruction.try_set_declare_byte_value(4, b4)?;
instruction.try_set_declare_byte_value(5, b5)?;
instruction.try_set_declare_byte_value(6, b6)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_byte_7() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_byte_7(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8, b5: u8, b6: u8) -> Self {
Instruction::try_with_declare_byte_7(b0, b1, b2, b3, b4, b5, b6).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_byte_8(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8, b5: u8, b6: u8, b7: u8) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareByte);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 8);
instruction.try_set_declare_byte_value(0, b0)?;
instruction.try_set_declare_byte_value(1, b1)?;
instruction.try_set_declare_byte_value(2, b2)?;
instruction.try_set_declare_byte_value(3, b3)?;
instruction.try_set_declare_byte_value(4, b4)?;
instruction.try_set_declare_byte_value(5, b5)?;
instruction.try_set_declare_byte_value(6, b6)?;
instruction.try_set_declare_byte_value(7, b7)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_byte_8() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_byte_8(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8, b5: u8, b6: u8, b7: u8) -> Self {
Instruction::try_with_declare_byte_8(b0, b1, b2, b3, b4, b5, b6, b7).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_byte_9(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8, b5: u8, b6: u8, b7: u8, b8: u8) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareByte);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 9);
instruction.try_set_declare_byte_value(0, b0)?;
instruction.try_set_declare_byte_value(1, b1)?;
instruction.try_set_declare_byte_value(2, b2)?;
instruction.try_set_declare_byte_value(3, b3)?;
instruction.try_set_declare_byte_value(4, b4)?;
instruction.try_set_declare_byte_value(5, b5)?;
instruction.try_set_declare_byte_value(6, b6)?;
instruction.try_set_declare_byte_value(7, b7)?;
instruction.try_set_declare_byte_value(8, b8)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_byte_9() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_byte_9(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8, b5: u8, b6: u8, b7: u8, b8: u8) -> Self {
Instruction::try_with_declare_byte_9(b0, b1, b2, b3, b4, b5, b6, b7, b8).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_byte_10(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8, b5: u8, b6: u8, b7: u8, b8: u8, b9: u8) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareByte);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 10);
instruction.try_set_declare_byte_value(0, b0)?;
instruction.try_set_declare_byte_value(1, b1)?;
instruction.try_set_declare_byte_value(2, b2)?;
instruction.try_set_declare_byte_value(3, b3)?;
instruction.try_set_declare_byte_value(4, b4)?;
instruction.try_set_declare_byte_value(5, b5)?;
instruction.try_set_declare_byte_value(6, b6)?;
instruction.try_set_declare_byte_value(7, b7)?;
instruction.try_set_declare_byte_value(8, b8)?;
instruction.try_set_declare_byte_value(9, b9)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_byte_10() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_byte_10(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8, b5: u8, b6: u8, b7: u8, b8: u8, b9: u8) -> Self {
Instruction::try_with_declare_byte_10(b0, b1, b2, b3, b4, b5, b6, b7, b8, b9).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_byte_11(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8, b5: u8, b6: u8, b7: u8, b8: u8, b9: u8, b10: u8) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareByte);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 11);
instruction.try_set_declare_byte_value(0, b0)?;
instruction.try_set_declare_byte_value(1, b1)?;
instruction.try_set_declare_byte_value(2, b2)?;
instruction.try_set_declare_byte_value(3, b3)?;
instruction.try_set_declare_byte_value(4, b4)?;
instruction.try_set_declare_byte_value(5, b5)?;
instruction.try_set_declare_byte_value(6, b6)?;
instruction.try_set_declare_byte_value(7, b7)?;
instruction.try_set_declare_byte_value(8, b8)?;
instruction.try_set_declare_byte_value(9, b9)?;
instruction.try_set_declare_byte_value(10, b10)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_byte_11() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_byte_11(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8, b5: u8, b6: u8, b7: u8, b8: u8, b9: u8, b10: u8) -> Self {
Instruction::try_with_declare_byte_11(b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_byte_12(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8, b5: u8, b6: u8, b7: u8, b8: u8, b9: u8, b10: u8, b11: u8) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareByte);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 12);
instruction.try_set_declare_byte_value(0, b0)?;
instruction.try_set_declare_byte_value(1, b1)?;
instruction.try_set_declare_byte_value(2, b2)?;
instruction.try_set_declare_byte_value(3, b3)?;
instruction.try_set_declare_byte_value(4, b4)?;
instruction.try_set_declare_byte_value(5, b5)?;
instruction.try_set_declare_byte_value(6, b6)?;
instruction.try_set_declare_byte_value(7, b7)?;
instruction.try_set_declare_byte_value(8, b8)?;
instruction.try_set_declare_byte_value(9, b9)?;
instruction.try_set_declare_byte_value(10, b10)?;
instruction.try_set_declare_byte_value(11, b11)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_byte_12() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_byte_12(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8, b5: u8, b6: u8, b7: u8, b8: u8, b9: u8, b10: u8, b11: u8) -> Self {
Instruction::try_with_declare_byte_12(b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_byte_13(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8, b5: u8, b6: u8, b7: u8, b8: u8, b9: u8, b10: u8, b11: u8, b12: u8) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareByte);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 13);
instruction.try_set_declare_byte_value(0, b0)?;
instruction.try_set_declare_byte_value(1, b1)?;
instruction.try_set_declare_byte_value(2, b2)?;
instruction.try_set_declare_byte_value(3, b3)?;
instruction.try_set_declare_byte_value(4, b4)?;
instruction.try_set_declare_byte_value(5, b5)?;
instruction.try_set_declare_byte_value(6, b6)?;
instruction.try_set_declare_byte_value(7, b7)?;
instruction.try_set_declare_byte_value(8, b8)?;
instruction.try_set_declare_byte_value(9, b9)?;
instruction.try_set_declare_byte_value(10, b10)?;
instruction.try_set_declare_byte_value(11, b11)?;
instruction.try_set_declare_byte_value(12, b12)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_byte_13() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_byte_13(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8, b5: u8, b6: u8, b7: u8, b8: u8, b9: u8, b10: u8, b11: u8, b12: u8) -> Self {
Instruction::try_with_declare_byte_13(b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_byte_14(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8, b5: u8, b6: u8, b7: u8, b8: u8, b9: u8, b10: u8, b11: u8, b12: u8, b13: u8) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareByte);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 14);
instruction.try_set_declare_byte_value(0, b0)?;
instruction.try_set_declare_byte_value(1, b1)?;
instruction.try_set_declare_byte_value(2, b2)?;
instruction.try_set_declare_byte_value(3, b3)?;
instruction.try_set_declare_byte_value(4, b4)?;
instruction.try_set_declare_byte_value(5, b5)?;
instruction.try_set_declare_byte_value(6, b6)?;
instruction.try_set_declare_byte_value(7, b7)?;
instruction.try_set_declare_byte_value(8, b8)?;
instruction.try_set_declare_byte_value(9, b9)?;
instruction.try_set_declare_byte_value(10, b10)?;
instruction.try_set_declare_byte_value(11, b11)?;
instruction.try_set_declare_byte_value(12, b12)?;
instruction.try_set_declare_byte_value(13, b13)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_byte_14() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_byte_14(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8, b5: u8, b6: u8, b7: u8, b8: u8, b9: u8, b10: u8, b11: u8, b12: u8, b13: u8) -> Self {
Instruction::try_with_declare_byte_14(b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_byte_15(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8, b5: u8, b6: u8, b7: u8, b8: u8, b9: u8, b10: u8, b11: u8, b12: u8, b13: u8, b14: u8) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareByte);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 15);
instruction.try_set_declare_byte_value(0, b0)?;
instruction.try_set_declare_byte_value(1, b1)?;
instruction.try_set_declare_byte_value(2, b2)?;
instruction.try_set_declare_byte_value(3, b3)?;
instruction.try_set_declare_byte_value(4, b4)?;
instruction.try_set_declare_byte_value(5, b5)?;
instruction.try_set_declare_byte_value(6, b6)?;
instruction.try_set_declare_byte_value(7, b7)?;
instruction.try_set_declare_byte_value(8, b8)?;
instruction.try_set_declare_byte_value(9, b9)?;
instruction.try_set_declare_byte_value(10, b10)?;
instruction.try_set_declare_byte_value(11, b11)?;
instruction.try_set_declare_byte_value(12, b12)?;
instruction.try_set_declare_byte_value(13, b13)?;
instruction.try_set_declare_byte_value(14, b14)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_byte_15() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_byte_15(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8, b5: u8, b6: u8, b7: u8, b8: u8, b9: u8, b10: u8, b11: u8, b12: u8, b13: u8, b14: u8) -> Self {
Instruction::try_with_declare_byte_15(b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_byte_16(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8, b5: u8, b6: u8, b7: u8, b8: u8, b9: u8, b10: u8, b11: u8, b12: u8, b13: u8, b14: u8, b15: u8) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareByte);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 16);
instruction.try_set_declare_byte_value(0, b0)?;
instruction.try_set_declare_byte_value(1, b1)?;
instruction.try_set_declare_byte_value(2, b2)?;
instruction.try_set_declare_byte_value(3, b3)?;
instruction.try_set_declare_byte_value(4, b4)?;
instruction.try_set_declare_byte_value(5, b5)?;
instruction.try_set_declare_byte_value(6, b6)?;
instruction.try_set_declare_byte_value(7, b7)?;
instruction.try_set_declare_byte_value(8, b8)?;
instruction.try_set_declare_byte_value(9, b9)?;
instruction.try_set_declare_byte_value(10, b10)?;
instruction.try_set_declare_byte_value(11, b11)?;
instruction.try_set_declare_byte_value(12, b12)?;
instruction.try_set_declare_byte_value(13, b13)?;
instruction.try_set_declare_byte_value(14, b14)?;
instruction.try_set_declare_byte_value(15, b15)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_byte_16() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_byte_16(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8, b5: u8, b6: u8, b7: u8, b8: u8, b9: u8, b10: u8, b11: u8, b12: u8, b13: u8, b14: u8, b15: u8) -> Self {
Instruction::try_with_declare_byte_16(b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_byte(data: &[u8]) -> Result<Self, IcedError> {
if data.len().wrapping_sub(1) > 16 - 1 {
return Err(IcedError::new("Invalid slice length"));
}
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareByte);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, data.len() as u32);
for i in data.iter().enumerate() {
instruction.try_set_declare_byte_value(i.0, *i.1)?;
}
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_byte() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_byte(data: &[u8]) -> Self {
Instruction::try_with_declare_byte(data).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_word_1(w0: u16) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareWord);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 1);
instruction.try_set_declare_word_value(0, w0)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_word_1() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_word_1(w0: u16) -> Self {
Instruction::try_with_declare_word_1(w0).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_word_2(w0: u16, w1: u16) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareWord);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 2);
instruction.try_set_declare_word_value(0, w0)?;
instruction.try_set_declare_word_value(1, w1)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_word_2() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_word_2(w0: u16, w1: u16) -> Self {
Instruction::try_with_declare_word_2(w0, w1).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_word_3(w0: u16, w1: u16, w2: u16) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareWord);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 3);
instruction.try_set_declare_word_value(0, w0)?;
instruction.try_set_declare_word_value(1, w1)?;
instruction.try_set_declare_word_value(2, w2)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_word_3() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_word_3(w0: u16, w1: u16, w2: u16) -> Self {
Instruction::try_with_declare_word_3(w0, w1, w2).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_word_4(w0: u16, w1: u16, w2: u16, w3: u16) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareWord);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 4);
instruction.try_set_declare_word_value(0, w0)?;
instruction.try_set_declare_word_value(1, w1)?;
instruction.try_set_declare_word_value(2, w2)?;
instruction.try_set_declare_word_value(3, w3)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_word_4() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_word_4(w0: u16, w1: u16, w2: u16, w3: u16) -> Self {
Instruction::try_with_declare_word_4(w0, w1, w2, w3).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_word_5(w0: u16, w1: u16, w2: u16, w3: u16, w4: u16) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareWord);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 5);
instruction.try_set_declare_word_value(0, w0)?;
instruction.try_set_declare_word_value(1, w1)?;
instruction.try_set_declare_word_value(2, w2)?;
instruction.try_set_declare_word_value(3, w3)?;
instruction.try_set_declare_word_value(4, w4)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_word_5() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_word_5(w0: u16, w1: u16, w2: u16, w3: u16, w4: u16) -> Self {
Instruction::try_with_declare_word_5(w0, w1, w2, w3, w4).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_word_6(w0: u16, w1: u16, w2: u16, w3: u16, w4: u16, w5: u16) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareWord);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 6);
instruction.try_set_declare_word_value(0, w0)?;
instruction.try_set_declare_word_value(1, w1)?;
instruction.try_set_declare_word_value(2, w2)?;
instruction.try_set_declare_word_value(3, w3)?;
instruction.try_set_declare_word_value(4, w4)?;
instruction.try_set_declare_word_value(5, w5)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_word_6() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_word_6(w0: u16, w1: u16, w2: u16, w3: u16, w4: u16, w5: u16) -> Self {
Instruction::try_with_declare_word_6(w0, w1, w2, w3, w4, w5).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_word_7(w0: u16, w1: u16, w2: u16, w3: u16, w4: u16, w5: u16, w6: u16) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareWord);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 7);
instruction.try_set_declare_word_value(0, w0)?;
instruction.try_set_declare_word_value(1, w1)?;
instruction.try_set_declare_word_value(2, w2)?;
instruction.try_set_declare_word_value(3, w3)?;
instruction.try_set_declare_word_value(4, w4)?;
instruction.try_set_declare_word_value(5, w5)?;
instruction.try_set_declare_word_value(6, w6)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_word_7() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_word_7(w0: u16, w1: u16, w2: u16, w3: u16, w4: u16, w5: u16, w6: u16) -> Self {
Instruction::try_with_declare_word_7(w0, w1, w2, w3, w4, w5, w6).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_word_8(w0: u16, w1: u16, w2: u16, w3: u16, w4: u16, w5: u16, w6: u16, w7: u16) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareWord);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 8);
instruction.try_set_declare_word_value(0, w0)?;
instruction.try_set_declare_word_value(1, w1)?;
instruction.try_set_declare_word_value(2, w2)?;
instruction.try_set_declare_word_value(3, w3)?;
instruction.try_set_declare_word_value(4, w4)?;
instruction.try_set_declare_word_value(5, w5)?;
instruction.try_set_declare_word_value(6, w6)?;
instruction.try_set_declare_word_value(7, w7)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_word_8() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_word_8(w0: u16, w1: u16, w2: u16, w3: u16, w4: u16, w5: u16, w6: u16, w7: u16) -> Self {
Instruction::try_with_declare_word_8(w0, w1, w2, w3, w4, w5, w6, w7).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
#[allow(trivial_casts)]
pub fn try_with_declare_word_slice_u8(data: &[u8]) -> Result<Self, IcedError> {
if data.len().wrapping_sub(1) > 16 - 1 || (data.len() & 1) != 0 {
return Err(IcedError::new("Invalid slice length"));
}
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareWord);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, data.len() as u32 / 2);
for i in 0..data.len() / 2 {
let v = unsafe { u16::from_le(ptr::read_unaligned(data.get_unchecked(i * 2) as *const _ as *const u16)) };
instruction.try_set_declare_word_value(i, v)?;
}
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_word_slice_u8() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_word_slice_u8(data: &[u8]) -> Self {
Instruction::try_with_declare_word_slice_u8(data).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_word(data: &[u16]) -> Result<Self, IcedError> {
if data.len().wrapping_sub(1) > 8 - 1 {
return Err(IcedError::new("Invalid slice length"));
}
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareWord);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, data.len() as u32);
for i in data.iter().enumerate() {
instruction.try_set_declare_word_value(i.0, *i.1)?;
}
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_word() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_word(data: &[u16]) -> Self {
Instruction::try_with_declare_word(data).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_dword_1(d0: u32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareDword);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 1);
instruction.try_set_declare_dword_value(0, d0)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_dword_1() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_dword_1(d0: u32) -> Self {
Instruction::try_with_declare_dword_1(d0).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_dword_2(d0: u32, d1: u32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareDword);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 2);
instruction.try_set_declare_dword_value(0, d0)?;
instruction.try_set_declare_dword_value(1, d1)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_dword_2() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_dword_2(d0: u32, d1: u32) -> Self {
Instruction::try_with_declare_dword_2(d0, d1).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_dword_3(d0: u32, d1: u32, d2: u32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareDword);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 3);
instruction.try_set_declare_dword_value(0, d0)?;
instruction.try_set_declare_dword_value(1, d1)?;
instruction.try_set_declare_dword_value(2, d2)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_dword_3() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_dword_3(d0: u32, d1: u32, d2: u32) -> Self {
Instruction::try_with_declare_dword_3(d0, d1, d2).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_dword_4(d0: u32, d1: u32, d2: u32, d3: u32) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareDword);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 4);
instruction.try_set_declare_dword_value(0, d0)?;
instruction.try_set_declare_dword_value(1, d1)?;
instruction.try_set_declare_dword_value(2, d2)?;
instruction.try_set_declare_dword_value(3, d3)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_dword_4() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_dword_4(d0: u32, d1: u32, d2: u32, d3: u32) -> Self {
Instruction::try_with_declare_dword_4(d0, d1, d2, d3).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
#[allow(trivial_casts)]
pub fn try_with_declare_dword_slice_u8(data: &[u8]) -> Result<Self, IcedError> {
if data.len().wrapping_sub(1) > 16 - 1 || (data.len() & 3) != 0 {
return Err(IcedError::new("Invalid slice length"));
}
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareDword);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, data.len() as u32 / 4);
for i in 0..data.len() / 4 {
let v = unsafe { u32::from_le(ptr::read_unaligned(data.get_unchecked(i * 4) as *const _ as *const u32)) };
instruction.try_set_declare_dword_value(i, v)?;
}
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_dword_slice_u8() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_dword_slice_u8(data: &[u8]) -> Self {
Instruction::try_with_declare_dword_slice_u8(data).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_dword(data: &[u32]) -> Result<Self, IcedError> {
if data.len().wrapping_sub(1) > 4 - 1 {
return Err(IcedError::new("Invalid slice length"));
}
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareDword);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, data.len() as u32);
for i in data.iter().enumerate() {
instruction.try_set_declare_dword_value(i.0, *i.1)?;
}
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_dword() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_dword(data: &[u32]) -> Self {
Instruction::try_with_declare_dword(data).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_qword_1(q0: u64) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareQword);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 1);
instruction.try_set_declare_qword_value(0, q0)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_qword_1() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_qword_1(q0: u64) -> Self {
Instruction::try_with_declare_qword_1(q0).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_qword_2(q0: u64, q1: u64) -> Result<Self, IcedError> {
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareQword);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, 2);
instruction.try_set_declare_qword_value(0, q0)?;
instruction.try_set_declare_qword_value(1, q1)?;
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_qword_2() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_qword_2(q0: u64, q1: u64) -> Self {
Instruction::try_with_declare_qword_2(q0, q1).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
#[allow(trivial_casts)]
pub fn try_with_declare_qword_slice_u8(data: &[u8]) -> Result<Self, IcedError> {
if data.len().wrapping_sub(1) > 16 - 1 || (data.len() & 7) != 0 {
return Err(IcedError::new("Invalid slice length"));
}
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareQword);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, data.len() as u32 / 8);
for i in 0..data.len() / 8 {
let v = unsafe { u64::from_le(ptr::read_unaligned(data.get_unchecked(i * 8) as *const _ as *const u64)) };
instruction.try_set_declare_qword_value(i, v)?;
}
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_qword_slice_u8() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_qword_slice_u8(data: &[u8]) -> Self {
Instruction::try_with_declare_qword_slice_u8(data).unwrap()
}
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn try_with_declare_qword(data: &[u64]) -> Result<Self, IcedError> {
if data.len().wrapping_sub(1) > 2 - 1 {
return Err(IcedError::new("Invalid slice length"));
}
let mut instruction = Self::default();
super::instruction_internal::internal_set_code(&mut instruction, Code::DeclareQword);
super::instruction_internal::internal_set_declare_data_len(&mut instruction, data.len() as u32);
for i in data.iter().enumerate() {
instruction.try_set_declare_qword_value(i.0, *i.1)?;
}
debug_assert_eq!(0, instruction.op_count());
Ok(instruction)
}
#[deprecated(since = "1.10.0", note = "Use try_with_declare_qword() instead")]
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[cfg_attr(feature = "cargo-fmt", rustfmt::skip)]
pub fn with_declare_qword(data: &[u64]) -> Self {
Instruction::try_with_declare_qword(data).unwrap()
}
}
impl Eq for Instruction {}
impl PartialEq<Instruction> for Instruction {
#[cfg_attr(has_must_use, must_use)]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
fn eq(&self, other: &Self) -> bool {
((self.code_flags ^ other.code_flags) & !CodeFlags::EQUALS_IGNORE_MASK) == 0
&& ((self.op_kind_flags ^ other.op_kind_flags) & !OpKindFlags::EQUALS_IGNORE_MASK) == 0
&& self.immediate == other.immediate
&& self.mem_displ == other.mem_displ
&& self.memory_flags == other.memory_flags
&& self.mem_base_reg == other.mem_base_reg
&& self.mem_index_reg == other.mem_index_reg
&& self.reg0 == other.reg0
&& self.reg1 == other.reg1
&& self.reg2 == other.reg2
&& self.reg3 == other.reg3
}
}
impl Hash for Instruction {
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
fn hash<'a, H: Hasher>(&self, state: &'a mut H) {
state.write_u32(self.code_flags & !CodeFlags::EQUALS_IGNORE_MASK);
state.write_u32(self.op_kind_flags & !OpKindFlags::EQUALS_IGNORE_MASK);
state.write_u32(self.immediate);
state.write_u32(self.mem_displ);
state.write_u16(self.memory_flags);
state.write_u8(self.mem_base_reg);
state.write_u8(self.mem_index_reg);
state.write_u8(self.reg0);
state.write_u8(self.reg1);
state.write_u8(self.reg2);
state.write_u8(self.reg3);
}
}
#[cfg(any(feature = "gas", feature = "intel", feature = "masm", feature = "nasm"))]
struct FmtFormatterOutput<'a, 'b: 'a> {
f: &'a mut fmt::Formatter<'b>,
result: fmt::Result,
}
#[cfg(any(feature = "gas", feature = "intel", feature = "masm", feature = "nasm"))]
impl<'a, 'b: 'a> FmtFormatterOutput<'a, 'b> {
fn new(f: &'a mut fmt::Formatter<'b>) -> Self {
Self { f, result: Ok(()) }
}
}
#[cfg(any(feature = "gas", feature = "intel", feature = "masm", feature = "nasm"))]
impl<'a, 'b: 'a> FormatterOutput for FmtFormatterOutput<'a, 'b> {
fn write(&mut self, text: &str, _kind: FormatterTextKind) {
if self.result.is_ok() {
self.result = self.f.write_str(text);
}
}
}
#[cfg(any(feature = "gas", feature = "intel", feature = "masm", feature = "nasm", feature = "fast_fmt"))]
impl fmt::Display for Instruction {
#[cfg_attr(feature = "cargo-clippy", allow(clippy::missing_inline_in_public_items))]
fn fmt<'a>(&self, f: &mut fmt::Formatter<'a>) -> fmt::Result {
#[cfg(any(feature = "gas", feature = "intel", feature = "masm", feature = "nasm"))]
{
#[cfg(feature = "masm")]
let mut formatter = MasmFormatter::new();
#[cfg(all(not(feature = "masm"), feature = "nasm"))]
let mut formatter = NasmFormatter::new();
#[cfg(all(not(feature = "masm"), not(feature = "nasm"), feature = "intel"))]
let mut formatter = IntelFormatter::new();
#[cfg(all(not(feature = "masm"), not(feature = "nasm"), not(feature = "intel"), feature = "gas"))]
let mut formatter = GasFormatter::new();
let mut output = FmtFormatterOutput::new(f);
formatter.format(self, &mut output);
output.result
}
#[cfg(not(any(feature = "gas", feature = "intel", feature = "masm", feature = "nasm")))]
{
let mut formatter = FastFormatter::new();
let mut output = String::new();
formatter.format(self, &mut output);
f.write_str(&output)
}
}
}