From 8c14c0dac90e557ab3ac402cb38aecaa70920767 Mon Sep 17 00:00:00 2001 From: Jean-Marie Mineau Date: Tue, 19 Dec 2023 11:58:35 +0100 Subject: [PATCH] WIP --- androscalpel/src/apk.rs | 6 +- androscalpel/src/instructions.rs | 8827 +++++++++++++++++++++++++++++- 2 files changed, 8806 insertions(+), 27 deletions(-) diff --git a/androscalpel/src/apk.rs b/androscalpel/src/apk.rs index 62ffef3..7992c7b 100644 --- a/androscalpel/src/apk.rs +++ b/androscalpel/src/apk.rs @@ -802,8 +802,8 @@ impl Apk { va, vb, Self::get_id_type_from_idx(c as usize, dex)?, - )), - Format12X { op: 0x21, va, vb } => Instruction::ArrayLength(ArrayLength::new(va, vb)), + )?), + Format12X { op: 0x21, va, vb } => Instruction::ArrayLength(ArrayLength::new(va, vb)?), Format21C { op: 0x22, va, b } => Instruction::NewInstance(NewInstance::new( va, Self::get_id_type_from_idx(b as usize, dex)?, @@ -817,7 +817,7 @@ impl Apk { va, vb, Self::get_id_type_from_idx(c as usize, dex)?, - )), + )?), Format35C { op: 0x24, a, diff --git a/androscalpel/src/instructions.rs b/androscalpel/src/instructions.rs index 91298ba..8534fc0 100644 --- a/androscalpel/src/instructions.rs +++ b/androscalpel/src/instructions.rs @@ -4,6 +4,8 @@ //! use crate::{DexString, DexValue, IdField, IdMethod, IdMethodType, IdType, MethodHandle, Result}; +use androscalpel_serializer::Instruction as InsFormat; +use androscalpel_serializer::Serializable; use anyhow::anyhow; use pyo3::exceptions::PyTypeError; @@ -11,6 +13,16 @@ use pyo3::prelude::*; use std::collections::HashMap; +const I8_MIN_AS_I32: i32 = i8::MIN as i32; +const I8_MAX_AS_I32: i32 = i8::MAX as i32; +const I16_MIN_AS_I32: i32 = i16::MIN as i32; +const I16_MAX_AS_I32: i32 = i16::MAX as i32; +const I16_MIN_AS_I64: i64 = i16::MIN as i64; +const I16_MAX_AS_I64: i64 = i16::MAX as i64; +const I32_MIN_AS_I64: i64 = i32::MIN as i64; +const I32_MAX_AS_I64: i64 = i32::MAX as i64; +const U16_MAX_AS_USIZE: usize = u16::MAX as usize; + // TODO: impl PartialEq and Eq for call site to derive them here #[derive(Debug, Clone)] pub enum Instruction { @@ -1289,6 +1301,46 @@ impl Nop { pub fn __repr__(&self) -> String { "Instruction(Nop)".into() } + + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl Nop { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format10X { op: 0x00 } + } } /// Move contents of a non object register to another. @@ -1320,6 +1372,62 @@ impl Move { pub fn __repr__(&self) -> String { format!("Instruction(Move({}, {}))", self.to, self.from) } + + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl Move { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + match (self.to, self.from) { + (0..=0b0000_1111, 0..=0b0000_1111) => InsFormat::Format12X { + op: 0x01, + va: self.to as u8, + vb: self.from as u8, + }, + (0..=0xff, _) => InsFormat::Format22X { + op: 0x02, + va: self.to as u8, + vb: self.from, + }, + (_, _) => InsFormat::Format32X { + op: 0x03, + va: self.to, + vb: self.from, + }, + } + } } /// Move contents of a register pair to another. @@ -1351,6 +1459,60 @@ impl MoveWide { pub fn __repr__(&self) -> String { format!("Instruction(MoveWide({}, {}))", self.to, self.from) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} +impl MoveWide { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + match (self.to, self.from) { + (0..=0b0000_1111, 0..=0b0000_1111) => InsFormat::Format12X { + op: 0x04, + va: self.to as u8, + vb: self.from as u8, + }, + (0..=0xff, _) => InsFormat::Format22X { + op: 0x05, + va: self.to as u8, + vb: self.from, + }, + (_, _) => InsFormat::Format32X { + op: 0x06, + va: self.to, + vb: self.from, + }, + } + } } /// Move contents of an object bearing register to another. @@ -1382,6 +1544,60 @@ impl MoveObject { pub fn __repr__(&self) -> String { format!("Instruction(MoveObject({}, {}))", self.to, self.from) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} +impl MoveObject { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + match (self.to, self.from) { + (0..=0b0000_1111, 0..=0b0000_1111) => InsFormat::Format12X { + op: 0x07, + va: self.to as u8, + vb: self.from as u8, + }, + (0..=0xff, _) => InsFormat::Format22X { + op: 0x08, + va: self.to as u8, + vb: self.from, + }, + (_, _) => InsFormat::Format32X { + op: 0x09, + va: self.to, + vb: self.from, + }, + } + } } /// Move the single word non object result of the preciding invoke-kind into a register. @@ -1405,6 +1621,47 @@ impl MoveResult { pub fn __repr__(&self) -> String { format!("Instruction(MoveResult({}))", self.to) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} +impl MoveResult { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format11X { + op: 0x0a, + va: self.to, + } + } } /// Move the double word non object result of the preciding invoke-kind into a register pair. @@ -1428,28 +1685,46 @@ impl MoveResultWide { pub fn __repr__(&self) -> String { format!("Instruction(MoveResultWide({}))", self.to) } -} - -/// Move the just caught exception into a register. -#[pyclass] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub struct MoveException { - pub to: u8, -} - -#[pymethods] -impl MoveException { - #[new] - pub fn new(to: u8) -> Self { - Self { to } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() } - pub fn __str__(&self) -> String { - format!("move-exception {}", self.to) + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() } - pub fn __repr__(&self) -> String { - format!("Instruction(MoveException({}))", self.to) + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} +impl MoveResultWide { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format11X { + op: 0x0b, + va: self.to, + } } } @@ -1474,6 +1749,112 @@ impl MoveResultObject { pub fn __repr__(&self) -> String { format!("Instruction(MoveResultObject({}))", self.to) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl MoveResultObject { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format11X { + op: 0x0c, + va: self.to, + } + } +} + +/// Move the just caught exception into a register. +#[pyclass] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct MoveException { + pub to: u8, +} + +#[pymethods] +impl MoveException { + #[new] + pub fn new(to: u8) -> Self { + Self { to } + } + + pub fn __str__(&self) -> String { + format!("move-exception {}", self.to) + } + + pub fn __repr__(&self) -> String { + format!("Instruction(MoveException({}))", self.to) + } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} +impl MoveException { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format11X { + op: 0x0d, + va: self.to, + } + } } /// Return a void method @@ -1495,6 +1876,44 @@ impl ReturnVoid { pub fn __repr__(&self) -> String { "Instruction(ReturnVoid)".into() } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} +impl ReturnVoid { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format10X { op: 0x0e } + } } /// Return the 32 bits non object value from the method. @@ -1518,6 +1937,47 @@ impl Return { pub fn __repr__(&self) -> String { format!("Instruction(Return({}))", self.reg) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} +impl Return { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format11X { + op: 0x0f, + va: self.reg, + } + } } /// Return the 64 bits non object value from the method. @@ -1541,6 +2001,47 @@ impl ReturnWide { pub fn __repr__(&self) -> String { format!("Instruction(ReturnWide({}))", self.reg) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} +impl ReturnWide { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format11X { + op: 0x10, + va: self.reg, + } + } } /// Return the object value from the method. @@ -1564,6 +2065,48 @@ impl ReturnObject { pub fn __repr__(&self) -> String { format!("Instruction(ReturnObject({}))", self.reg) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl ReturnObject { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format11X { + op: 0x11, + va: self.reg, + } + } } /// Move a literal to a register. @@ -1596,6 +2139,66 @@ impl Const { pub fn __repr__(&self) -> String { format!("Instruction(Const({}, {}))", self.reg, self.lit) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl Const { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + match (self.reg, self.lit) { + (0..=0b0000_1111, -8..=7) => InsFormat::Format11N { + op: 0x12, + va: self.reg, + b: self.lit as i8, + }, + (_, I16_MIN_AS_I32..=I16_MAX_AS_I32) => InsFormat::Format21S { + op: 0x13, + va: self.reg, + b: self.lit as i16, + }, + (_, lit) if lit % 0x1_0000 == 0 => InsFormat::Format21H { + op: 0x15, + va: self.reg, + b: (self.lit / 0x1_0000) as i16, + }, + (_, _) => InsFormat::Format31I { + op: 0x14, + va: self.reg, + b: self.lit, + }, + } + } } /// Move a literal to a register pair (64bits). @@ -1628,6 +2231,66 @@ impl ConstWide { pub fn __repr__(&self) -> String { format!("Instruction(ConstWide({}, {}))", self.reg, self.lit) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl ConstWide { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + match self.lit { + I16_MIN_AS_I64..=I16_MAX_AS_I64 => InsFormat::Format21S { + op: 0x16, + va: self.reg, + b: self.lit as i16, + }, + I32_MIN_AS_I64..=I32_MAX_AS_I64 => InsFormat::Format31I { + op: 0x17, + va: self.reg, + b: self.lit as i32, + }, + lit if lit % 0x1_0000_0000_0000 == 0 => InsFormat::Format21H { + op: 0x19, + va: self.reg, + b: (self.lit / 0x1_0000_0000_0000) as i16, + }, + _ => InsFormat::Format51L { + op: 0x18, + va: self.reg, + b: self.lit, + }, + } + } } /// Move a reference to a string in a register. @@ -1662,6 +2325,45 @@ impl ConstString { self.lit.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + 4 + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + 6 + } +} + +impl ConstString { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self, string_idx: usize) -> InsFormat { + match string_idx { + 0..=U16_MAX_AS_USIZE => InsFormat::Format21C { + op: 0x1a, + va: self.reg, + b: string_idx as u16, + }, + _ => InsFormat::Format31C { + op: 0x1b, + va: self.reg, + b: string_idx as u32, + }, + } + } } /// Move a reference to a class in a register. @@ -1690,6 +2392,49 @@ impl ConstClass { self.lit.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl ConstClass { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self, class_idx: usize) -> InsFormat { + InsFormat::Format21C { + op: 0x1c, + va: self.reg, + b: class_idx as u16, + } + } } /// Acquire the monitor for the object in the register. @@ -1713,6 +2458,48 @@ impl MonitorEnter { pub fn __repr__(&self) -> String { format!("Instruction(MonitorEnter({}))", self.reg) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl MonitorEnter { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format11X { + op: 0x1d, + va: self.reg, + } + } } /// Release the monitor for the object in the register. @@ -1736,6 +2523,48 @@ impl MonitorExit { pub fn __repr__(&self) -> String { format!("Instruction(MonitorExit({}))", self.reg) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl MonitorExit { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format11X { + op: 0x1e, + va: self.reg, + } + } } /// Check if the object in the register can be cast to the type. @@ -1765,6 +2594,48 @@ impl CheckCast { self.lit.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} +impl CheckCast { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self, type_idx: usize) -> InsFormat { + InsFormat::Format21C { + op: 0x1f, + va: self.reg, + b: type_idx as u16, + } + } } /// Check if an object if an instance of a type. @@ -1780,8 +2651,26 @@ pub struct InstanceOf { #[pymethods] impl InstanceOf { #[new] - pub fn new(dest: u8, obj: u8, lit: IdType) -> Self { - Self { dest, obj, lit } + pub fn new(dest: u8, obj: u8, lit: IdType) -> Result { + let ins = Self { dest, obj, lit }; + ins.sanity_check()?; + Ok(ins) + } + + pub fn sanity_check(&self) -> Result<()> { + if self.dest & 0b1111_0000 != 0 { + Err(anyhow!( + "The registers of InstanceOf are indexed on 4 bits, found {}", + self.dest + )) + } else if self.obj & 0b1111_0000 != 0 { + Err(anyhow!( + "The registers of InstanceOf are indexed on 4 bits, found {}", + self.obj + )) + } else { + Ok(()) + } } pub fn __str__(&self) -> String { @@ -1801,6 +2690,50 @@ impl InstanceOf { self.lit.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl InstanceOf { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self, type_idx: usize) -> InsFormat { + InsFormat::Format22C { + op: 0x20, + va: self.dest, + vb: self.obj, + c: type_idx as u16, + } + } } /// Get the number of item in an array. @@ -1815,8 +2748,26 @@ pub struct ArrayLength { #[pymethods] impl ArrayLength { #[new] - pub fn new(dest: u8, arr: u8) -> Self { - Self { dest, arr } + pub fn new(dest: u8, arr: u8) -> Result { + let ins = Self { dest, arr }; + ins.sanity_check()?; + Ok(ins) + } + + pub fn sanity_check(&self) -> Result<()> { + if self.dest & 0b1111_0000 != 0 { + Err(anyhow!( + "The registers of ArrayLength are indexed on 4 bits, found {}", + self.dest + )) + } else if self.arr & 0b1111_0000 != 0 { + Err(anyhow!( + "The registers of ArrayLength are indexed on 4 bits, found {}", + self.arr + )) + } else { + Ok(()) + } } pub fn __str__(&self) -> String { @@ -1826,6 +2777,49 @@ impl ArrayLength { pub fn __repr__(&self) -> String { format!("Instruction(ArrayLength({}, {}))", self.dest, self.arr,) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl ArrayLength { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0x21, + va: self.dest, + vb: self.arr, + } + } } /// Construct a new instance of the indicated type and store a reference to it. @@ -1854,6 +2848,49 @@ impl NewInstance { self.lit.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl NewInstance { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self, type_idx: usize) -> InsFormat { + InsFormat::Format21C { + op: 0x22, + va: self.reg, + b: type_idx as u16, + } + } } /// Construct a new array of the indicated type and size in size_reg and store a reference to it. @@ -1868,8 +2905,10 @@ pub struct NewArray { #[pymethods] impl NewArray { #[new] - pub fn new(reg: u8, size_reg: u8, lit: IdType) -> Self { - Self { reg, size_reg, lit } + pub fn new(reg: u8, size_reg: u8, lit: IdType) -> Result { + let ins = Self { reg, size_reg, lit }; + ins.sanity_check()?; + Ok(ins) } pub fn __str__(&self) -> String { @@ -1881,6 +2920,22 @@ impl NewArray { ) } + pub fn sanity_check(&self) -> Result<()> { + if self.reg & 0b1111_0000 != 0 { + Err(anyhow!( + "The registers of NewArray are indexed on 4 bits, found {}", + self.reg + )) + } else if self.size_reg & 0b1111_0000 != 0 { + Err(anyhow!( + "The registers of NewArray are indexed on 4 bits, found {}", + self.size_reg + )) + } else { + Ok(()) + } + } + pub fn __repr__(&self) -> String { format!( "Instruction(NewArray({}, {}, {}))", @@ -1889,6 +2944,50 @@ impl NewArray { self.lit.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl NewArray { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self, type_idx: usize) -> InsFormat { + InsFormat::Format22C { + op: 0x23, + va: self.reg, + vb: self.size_reg, + c: type_idx as u16, + } + } } /// Construct a new array of the indicated type and size fill it with the values of the @@ -1983,6 +3082,102 @@ impl FilledNewArray { self.type_.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 6 + } +} + +impl FilledNewArray { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self, type_idx: usize) -> InsFormat { + let mut last = None; + let mut first = None; + let mut consec = true; + let mut four_bites = true; + let len = self.reg_values.len(); + for r in self.reg_values { + if first.is_none() { + first = Some(r); + } + if let Some(last) = last { + if r != last + 1 { + consec = false; + } + } + if r & 0b1111_0000 != 0 { + four_bites = false; + } + last = Some(r); + } + if four_bites && len <= 5 { + let mut regs = vec![]; + for reg in self.reg_values { + regs.push(reg); + } + while regs.len() != 5 { + regs.push(0); + } + let [vc, vd, ve, vf, vg]: [u8; 5] = regs + .into_iter() + .map(|r| r as u8) + .collect::>() + .try_into() + .ok() + .unwrap(); + let a = self.reg_values.len() as u8; + InsFormat::Format35C { + op: 0x24, + a, + vc, + ve, + vd, + vf, + vg, + b: type_idx as u16, + } + } else if consec && len <= 255 { + let a = self.reg_values.len() as u8; + let vc = if let Some(vc) = first { vc } else { 0 }; + InsFormat::Format3RC { + op: 0x25, + a, + vc, + b: type_idx as u16, + } + } else { + // Not supposed to happend with a sanitized array + panic!("Invalid NewArrayInstruction {self:?}") + } + } } #[pyclass] @@ -2061,6 +3256,50 @@ impl FillArrayData { }; format!("Instruction(FillArrayData({}, [{}]))", self.arr, data) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 6 + } +} +impl FillArrayData { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `data_offset` is the offset to the address where the data are located. + pub fn get_raw_ins(&self, data_offset: i32) -> InsFormat { + InsFormat::Format31T { + op: 0x26, + va: self.arr, + b: data_offset, + } + } } /// Throws the exception in the register. @@ -2084,6 +3323,47 @@ impl Throw { pub fn __repr__(&self) -> String { format!("Instruction(Throw({}))", self.reg) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} +impl Throw { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format11X { + op: 0x26, + va: self.reg, + } + } } /// Jump to the label. @@ -2107,6 +3387,61 @@ impl Goto { pub fn __repr__(&self) -> String { format!("Instruction(Goto({}))", self.label) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + 2 + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + 6 + } +} +impl Goto { + /// Return the raw instruction ([`InsFormat`]). + /// + /// - `branch_offset` is the offset to the address. + /// - `goto_size` is the estimated size of the goto used to compute the offset. + /// It may not be the optimal size, but the instructions of the associtated + /// size will be used, and the offset is expected to fit in the instruction. + /// + /// Possible goto size and associated offset size: + /// - `2`: offset must fit in an i8 + /// - `4`: offset must fit in an i16 + /// - `6`: offset must fit in an i32 + pub fn get_raw_ins(&self, data_offset: i32, goto_size: usize) -> InsFormat { + if goto_size == 2 && (I8_MIN_AS_I32 <= data_offset && data_offset <= I8_MAX_AS_I32) { + InsFormat::Format10T { + op: 0x28, + a: data_offset as i8, + } + } else if goto_size == 4 && (I16_MIN_AS_I32 <= data_offset && data_offset <= I16_MAX_AS_I32) + { + InsFormat::Format20T { + op: 0x29, + a: data_offset as i16, + } + } else if goto_size == 6 { + InsFormat::Format30T { + op: 0x2a, + a: data_offset, + } + } else { + panic!("Invalid goto_size and/or data_offset value") + } + } } /// Jump to a label depending on the value of a register. If the value @@ -2138,6 +3473,66 @@ impl Switch { pub fn __repr__(&self) -> String { format!("Instruction(Switch({}, ...))", self.reg) } + + /// Test if the swith is sparse of pack + pub fn is_sparse(&self) -> bool { + let mut last = None; + let mut keys = self.branches.keys().collect::>(); + keys.sort(); + for key in keys.into_iter().cloned() { + if let Some(last) = last.clone() { + if last != key - 1 { + return false; + } + } + last = Some(key); + } + true + } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 6 + } +} +impl Switch { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `table_offset` is the offset to the address where the branche table located. + pub fn get_raw_ins(&self, data_offset: i32) -> InsFormat { + InsFormat::Format31T { + op: if self.is_sparse() { 0x2b } else { 0x2c }, + va: self.reg, + b: data_offset, + } + } } /// Store the result of the comparison between the registers. /// @@ -2170,6 +3565,50 @@ impl CmpLFloat { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl CmpLFloat { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x2d, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Store the result of the comparison between the registers. @@ -2203,6 +3642,50 @@ impl CmpGFloat { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl CmpGFloat { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x2e, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Store the result of the comparison between the registers. @@ -2236,6 +3719,50 @@ impl CmpLDouble { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl CmpLDouble { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x2f, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Store the result of the comparison between the registers. @@ -2269,6 +3796,50 @@ impl CmpGDouble { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl CmpGDouble { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x30, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Store the result of the comparison between the registers. @@ -2301,6 +3872,50 @@ impl CmpLong { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl CmpLong { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x31, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Jump to the label if a == b @@ -2344,6 +3959,52 @@ impl IfEq { pub fn __repr__(&self) -> String { format!("Instruction(IfEq({}, {}, {}))", self.a, self.b, self.label) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} +impl IfEq { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `branch_offset` is the offset to the address to jump to if + /// the test is true. + pub fn get_raw_ins(&self, branch_offset: i16) -> InsFormat { + InsFormat::Format22T { + op: 0x32, + va: self.a, + vb: self.b, + c: branch_offset, + } + } } /// Jump to the label if a != b @@ -2387,6 +4048,52 @@ impl IfNe { pub fn __repr__(&self) -> String { format!("Instruction(IfNe({}, {}, {}))", self.a, self.b, self.label) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} +impl IfNe { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `branch_offset` is the offset to the address to jump to if + /// the test is true. + pub fn get_raw_ins(&self, branch_offset: i16) -> InsFormat { + InsFormat::Format22T { + op: 0x33, + va: self.a, + vb: self.b, + c: branch_offset, + } + } } /// Jump to the label if a < b @@ -2430,6 +4137,52 @@ impl IfLt { pub fn __repr__(&self) -> String { format!("Instruction(IfLt({}, {}, {}))", self.a, self.b, self.label) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} +impl IfLt { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `branch_offset` is the offset to the address to jump to if + /// the test is true. + pub fn get_raw_ins(&self, branch_offset: i16) -> InsFormat { + InsFormat::Format22T { + op: 0x34, + va: self.a, + vb: self.b, + c: branch_offset, + } + } } /// Jump to the label if a >= b @@ -2473,6 +4226,52 @@ impl IfGe { pub fn __repr__(&self) -> String { format!("Instruction(IfGe({}, {}, {}))", self.a, self.b, self.label) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} +impl IfGe { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `branch_offset` is the offset to the address to jump to if + /// the test is true. + pub fn get_raw_ins(&self, branch_offset: i16) -> InsFormat { + InsFormat::Format22T { + op: 0x35, + va: self.a, + vb: self.b, + c: branch_offset, + } + } } /// Jump to the label if a > b @@ -2516,6 +4315,52 @@ impl IfGt { pub fn __repr__(&self) -> String { format!("Instruction(IfGt({}, {}, {}))", self.a, self.b, self.label) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} +impl IfGt { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `branch_offset` is the offset to the address to jump to if + /// the test is true. + pub fn get_raw_ins(&self, branch_offset: i16) -> InsFormat { + InsFormat::Format22T { + op: 0x36, + va: self.a, + vb: self.b, + c: branch_offset, + } + } } /// Jump to the label if a <= b @@ -2559,6 +4404,53 @@ impl IfLe { pub fn __repr__(&self) -> String { format!("Instruction(IfLe({}, {}, {}))", self.a, self.b, self.label) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl IfLe { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `branch_offset` is the offset to the address to jump to if + /// the test is true. + pub fn get_raw_ins(&self, branch_offset: i16) -> InsFormat { + InsFormat::Format22T { + op: 0x37, + va: self.a, + vb: self.b, + c: branch_offset, + } + } } /// Jump to the label if a == 0 @@ -2596,6 +4488,52 @@ impl IfEqZ { pub fn __repr__(&self) -> String { format!("Instruction(IfEqZ({}, {}))", self.a, self.label) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl IfEqZ { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `branch_offset` is the offset to the address to jump to if + /// the test is true. + pub fn get_raw_ins(&self, branch_offset: i16) -> InsFormat { + InsFormat::Format21T { + op: 0x38, + va: self.a, + b: branch_offset, + } + } } /// Jump to the label if a != 0 @@ -2633,6 +4571,52 @@ impl IfNeZ { pub fn __repr__(&self) -> String { format!("Instruction(IfNe({}, {}))", self.a, self.label) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl IfNeZ { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `branch_offset` is the offset to the address to jump to if + /// the test is true. + pub fn get_raw_ins(&self, branch_offset: i16) -> InsFormat { + InsFormat::Format21T { + op: 0x39, + va: self.a, + b: branch_offset, + } + } } /// Jump to the label if a < 0 @@ -2670,6 +4654,52 @@ impl IfLtZ { pub fn __repr__(&self) -> String { format!("Instruction(IfLt({}, {}))", self.a, self.label) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl IfLtz { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `branch_offset` is the offset to the address to jump to if + /// the test is true. + pub fn get_raw_ins(&self, branch_offset: i16) -> InsFormat { + InsFormat::Format21T { + op: 0x3a, + va: self.a, + b: branch_offset, + } + } } /// Jump to the label if a >= 0 @@ -2707,6 +4737,52 @@ impl IfGeZ { pub fn __repr__(&self) -> String { format!("Instruction(IfGe({}, {}))", self.a, self.label) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl IfGeZ { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `branch_offset` is the offset to the address to jump to if + /// the test is true. + pub fn get_raw_ins(&self, branch_offset: i16) -> InsFormat { + InsFormat::Format21T { + op: 0x3b, + va: self.a, + b: branch_offset, + } + } } /// Jump to the label if a > 0 @@ -2744,6 +4820,52 @@ impl IfGtZ { pub fn __repr__(&self) -> String { format!("Instruction(IfGt({}, {}))", self.a, self.label) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl IfGtZ { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `branch_offset` is the offset to the address to jump to if + /// the test is true. + pub fn get_raw_ins(&self, branch_offset: i16) -> InsFormat { + InsFormat::Format21T { + op: 0x3c, + va: self.a, + b: branch_offset, + } + } } /// Jump to the label if a <= 0 @@ -2781,6 +4903,52 @@ impl IfLeZ { pub fn __repr__(&self) -> String { format!("Instruction(IfLe({}, {}))", self.a, self.label) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl IfLeZ { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `branch_offset` is the offset to the address to jump to if + /// the test is true. + pub fn get_raw_ins(&self, branch_offset: i16) -> InsFormat { + InsFormat::Format21T { + op: 0x3d, + va: self.a, + b: branch_offset, + } + } } /// Put the value at arr[idx] in register dest (all values are in registers) @@ -2809,6 +4977,50 @@ impl AGet { self.dest, self.arr, self.idx ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl AGet { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x44, + va: self.dest, + vb: self.arr, + vc: self.idx, + } + } } /// Put the value at arr[idx] in register pair dest (all values are in registers) @@ -2837,6 +5049,50 @@ impl AGetWide { self.dest, self.arr, self.idx ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl AGetWide { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x45, + va: self.dest, + vb: self.arr, + vc: self.idx, + } + } } /// Put the reference at arr[idx] in register (all values are in registers) @@ -2865,6 +5121,50 @@ impl AGetObject { self.dest, self.arr, self.idx ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl AGetObject { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x46, + va: self.dest, + vb: self.arr, + vc: self.idx, + } + } } /// Put the boolean at arr[idx] in register dest (all values are in registers) @@ -2893,6 +5193,50 @@ impl AGetBoolean { self.dest, self.arr, self.idx ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl AGetBoolean { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x47, + va: self.dest, + vb: self.arr, + vc: self.idx, + } + } } /// Put the byte at arr[idx] in register dest (all values are in registers) @@ -2921,6 +5265,50 @@ impl AGetByte { self.dest, self.arr, self.idx ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl AGetByte { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x48, + va: self.dest, + vb: self.arr, + vc: self.idx, + } + } } /// Put the char at arr[idx] in register dest (all values are in registers) @@ -2949,6 +5337,50 @@ impl AGetChar { self.dest, self.arr, self.idx ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl AGetChar { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x49, + va: self.dest, + vb: self.arr, + vc: self.idx, + } + } } /// Put the short at arr[idx] in register dest (all values are in registers) @@ -2977,6 +5409,50 @@ impl AGetShort { self.dest, self.arr, self.idx ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl AGetShort { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x4a, + va: self.dest, + vb: self.arr, + vc: self.idx, + } + } } /// Put the value of register 'from' in arr[idx] (all values are in registers) @@ -3005,6 +5481,50 @@ impl APut { self.from, self.arr, self.idx ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl APut { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x4b, + va: self.from, + vb: self.arr, + vc: self.idx, + } + } } /// Put the value of the register pair 'from' in arr[idx] (all values are in registers) @@ -3033,6 +5553,50 @@ impl APutWide { self.from, self.arr, self.idx ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl APutWide { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x4c, + va: self.from, + vb: self.arr, + vc: self.idx, + } + } } /// Put the object reference in 'from' in arr[idx] (all values are in registers) @@ -3061,6 +5625,50 @@ impl APutObject { self.from, self.arr, self.idx ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl APutObject { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x4d, + va: self.from, + vb: self.arr, + vc: self.idx, + } + } } /// Put the boolean in 'from' in arr[idx] (all values are in registers) @@ -3089,6 +5697,50 @@ impl APutBoolean { self.from, self.arr, self.idx ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl APutBoolean { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x4e, + va: self.from, + vb: self.arr, + vc: self.idx, + } + } } /// Put the byte in 'from' in arr[idx] (all values are in registers) @@ -3117,6 +5769,50 @@ impl APutByte { self.from, self.arr, self.idx ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl APutByte { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x4f, + va: self.from, + vb: self.arr, + vc: self.idx, + } + } } /// Put the char in 'from' in arr[idx] (all values are in registers) @@ -3145,6 +5841,50 @@ impl APutChar { self.from, self.arr, self.idx ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl APutChar { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x50, + va: self.from, + vb: self.arr, + vc: self.idx, + } + } } /// Put the short in 'from' in arr[idx] (all values are in registers) @@ -3173,6 +5913,50 @@ impl APutShort { self.from, self.arr, self.idx ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl APutShort { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x51, + va: self.from, + vb: self.arr, + vc: self.idx, + } + } } /// Put the value in 'to' in the instance field 'field' of 'obj' ('to' and 'obj' are register) @@ -3223,6 +6007,52 @@ impl IGet { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl IGet { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format22C { + op: 0x52, + va: self.to, + vb: self.obj, + c: field_idx as u16, + } + } } /// Put the value in the register pair 'to' in the instance field 'field' of 'obj' ('to' @@ -3279,6 +6109,52 @@ impl IGetWide { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl IGetWide { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format22C { + op: 0x53, + va: self.to, + vb: self.obj, + c: field_idx as u16, + } + } } /// Put the object reference 'to' in the instance field 'field' of 'obj' ('to' and 'obj' are register) @@ -3334,6 +6210,52 @@ impl IGetObject { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl IGetObject { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format22C { + op: 0x54, + va: self.to, + vb: self.obj, + c: field_idx as u16, + } + } } /// Put the boolean in 'to' in the instance field 'field' of 'obj' ('to' and 'obj' are register) @@ -3389,6 +6311,52 @@ impl IGetBoolean { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl IGetBoolean { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format22C { + op: 0x55, + va: self.to, + vb: self.obj, + c: field_idx as u16, + } + } } /// Put the byte in 'to' in the instance field 'field' of 'obj' ('to' and 'obj' are register) @@ -3444,6 +6412,52 @@ impl IGetByte { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl IGetByte { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format22C { + op: 0x56, + va: self.to, + vb: self.obj, + c: field_idx as u16, + } + } } /// Put the char in 'to' in the instance field 'field' of 'obj' ('to' and 'obj' are register) @@ -3499,6 +6513,52 @@ impl IGetChar { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl IGetChar { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format22C { + op: 0x57, + va: self.to, + vb: self.obj, + c: field_idx as u16, + } + } } /// Put the short in 'to' in the instance field 'field' of 'obj' ('to' and 'obj' are register) @@ -3554,6 +6614,52 @@ impl IGetShort { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl IGetShort { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format22C { + op: 0x58, + va: self.to, + vb: self.obj, + c: field_idx as u16, + } + } } /// Put the value in the instance field 'field' of 'obj' in 'from' ('from' and 'obj' are register) @@ -3604,6 +6710,52 @@ impl IPut { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl IPut { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format22C { + op: 0x59, + va: self.from, + vb: self.obj, + c: field_idx as u16, + } + } } /// Put the value in the instance field 'field' of 'obj' in the register pair 'from' @@ -3660,6 +6812,52 @@ impl IPutWide { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl IPutWide { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format22C { + op: 0x5a, + va: self.from, + vb: self.obj, + c: field_idx as u16, + } + } } /// Put the object reference in the instance field 'field' of 'obj' in 'from' ('from' and 'obj' are register) @@ -3715,6 +6913,52 @@ impl IPutObject { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl IPutObject { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format22C { + op: 0x5b, + va: self.from, + vb: self.obj, + c: field_idx as u16, + } + } } /// Put the boolean in the instance field 'field' of 'obj' in 'from' ('from' and 'obj' are register) @@ -3770,6 +7014,52 @@ impl IPutBoolean { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl IPutBoolean { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format22C { + op: 0x5c, + va: self.from, + vb: self.obj, + c: field_idx as u16, + } + } } /// Put the byte in the instance field 'field' of 'obj' in 'from' ('from' and 'obj' are register) @@ -3825,6 +7115,52 @@ impl IPutByte { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl IPutByte { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format22C { + op: 0x5d, + va: self.from, + vb: self.obj, + c: field_idx as u16, + } + } } /// Put the char in the instance field 'field' of 'obj' in 'from' ('from' and 'obj' are register) @@ -3880,6 +7216,52 @@ impl IPutChar { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl IPutChar { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format22C { + op: 0x5e, + va: self.from, + vb: self.obj, + c: field_idx as u16, + } + } } /// Put the short in the instance field 'field' of 'obj' in 'from' ('from' and 'obj' are register) @@ -3935,6 +7317,52 @@ impl IPutShort { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl IPutShort { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format22C { + op: 0x5f, + va: self.from, + vb: self.obj, + c: field_idx as u16, + } + } } /// Put the value in 'to' in the static field 'field' ('to' is a register) @@ -3959,6 +7387,51 @@ impl SGet { pub fn __repr__(&self) -> String { format!("Instruction(SGet({}, {}))", self.to, self.field.__repr__()) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl SGet { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format21C { + op: 0x60, + va: self.to, + b: field_idx as u16, + } + } } /// Put the value in the register pair 'to' in the static field 'field' ('to' is a register) @@ -3987,6 +7460,51 @@ impl SGetWide { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl SGetWide { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format21C { + op: 0x61, + va: self.to, + b: field_idx as u16, + } + } } /// Put the object reference 'to' in the static field 'field' ('to' is a register) @@ -4015,6 +7533,51 @@ impl SGetObject { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl SGetObject { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format21C { + op: 0x62, + va: self.to, + b: field_idx as u16, + } + } } /// Put the boolean in 'to' in the static field 'field' ('to' is a register) @@ -4043,6 +7606,51 @@ impl SGetBoolean { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl SGetBoolean { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format21C { + op: 0x63, + va: self.to, + b: field_idx as u16, + } + } } /// Put the byte in 'to' in the static field 'field' ('to' is a register) @@ -4071,6 +7679,51 @@ impl SGetByte { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl SGetByte { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format21C { + op: 0x64, + va: self.to, + b: field_idx as u16, + } + } } /// Put the char in 'to' in the static field 'field' ('to' is a register) @@ -4099,6 +7752,51 @@ impl SGetChar { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl SGetChar { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format21C { + op: 0x65, + va: self.to, + b: field_idx as u16, + } + } } /// Put the short in 'to' in the static field 'field' ('to' is a register) @@ -4127,6 +7825,51 @@ impl SGetShort { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl SGetShort { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format21C { + op: 0x66, + va: self.to, + b: field_idx as u16, + } + } } /// Put the value in the static field 'field' in 'from' ('from' is a register) @@ -4155,6 +7898,51 @@ impl SPut { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl SPut { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format21C { + op: 0x67, + va: self.from, + b: field_idx as u16, + } + } } /// Put the value in the static field 'field' in the register pair 'from' @@ -4184,6 +7972,51 @@ impl SPutWide { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl SPutWide { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format21C { + op: 0x68, + va: self.from, + b: field_idx as u16, + } + } } /// Put the object reference in the static field 'field' in 'from' ('from' is a register) @@ -4212,6 +8045,51 @@ impl SPutObject { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl SPutObject { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format21C { + op: 0x69, + va: self.from, + b: field_idx as u16, + } + } } /// Put the boolean in the static field 'field' in 'from' ('from' is a register) @@ -4240,6 +8118,51 @@ impl SPutBoolean { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl SPutBoolean { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format21C { + op: 0x6a, + va: self.from, + b: field_idx as u16, + } + } } /// Put the byte in the static field 'field' in 'from' ('from' is a register) @@ -4268,6 +8191,51 @@ impl SPutByte { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl SPutByte { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format21C { + op: 0x6b, + va: self.from, + b: field_idx as u16, + } + } } /// Put the char in the static field 'field' in 'from' ('from' is a register) @@ -4296,6 +8264,51 @@ impl SPutChar { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl SPutChar { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format21C { + op: 0x6c, + va: self.from, + b: field_idx as u16, + } + } } /// Put the short in the static field 'field' in 'from' ('from' is a register) @@ -4324,6 +8337,51 @@ impl SPutShort { self.field.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 4 + } +} + +impl SPutShort { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `field_idx` is the index of the field refered to. + pub fn get_raw_ins(&self, field_idx: usize) -> InsFormat { + InsFormat::Format21C { + op: 0x6d, + va: self.from, + b: field_idx as u16, + } + } } /// Call a normal virtual method. @@ -4401,6 +8459,104 @@ impl InvokeVirtual { self.method.__str__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 6 + } +} + +impl InvokeVirtual { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `method_idx` is the index of the refered method. + pub fn get_raw_ins(&self, meth_idx: usize) -> InsFormat { + let mut last = None; + let mut first = None; + let mut consec = true; + let mut four_bites = true; + let len = self.args.len(); + for r in self.args { + if first.is_none() { + first = Some(r); + } + if let Some(last) = last { + if r != last + 1 { + consec = false; + } + } + if r & 0b1111_0000 != 0 { + four_bites = false; + } + last = Some(r); + } + if four_bites && len <= 5 { + let mut regs = vec![]; + for reg in self.args { + regs.push(reg); + } + while regs.len() != 5 { + regs.push(0); + } + let [vc, vd, ve, vf, vg]: [u8; 5] = regs + .into_iter() + .map(|r| r as u8) + .collect::>() + .try_into() + .ok() + .unwrap(); + let a = self.args.len() as u8; + InsFormat::Format35C { + op: 0x6e, + a, + vc, + ve, + vd, + vf, + vg, + b: meth_idx as u16, + } + } else if consec && len <= 255 { + let a = self.args.len() as u8; + let vc = if let Some(vc) = first { vc } else { 0 }; + InsFormat::Format3RC { + op: 0x74, + a, + vc, + b: meth_idx as u16, + } + } else { + // Not supposed to happend with a sanitized invoke + panic!("Invalid Invoke instruction {self:?}") + } + } } /// Call the closest superclass's virtual method of a non interface class. @@ -4478,6 +8634,104 @@ impl InvokeSuper { self.method.__str__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 6 + } +} + +impl InvokeSuper { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `method_idx` is the index of the refered method. + pub fn get_raw_ins(&self, meth_idx: usize) -> InsFormat { + let mut last = None; + let mut first = None; + let mut consec = true; + let mut four_bites = true; + let len = self.args.len(); + for r in self.args { + if first.is_none() { + first = Some(r); + } + if let Some(last) = last { + if r != last + 1 { + consec = false; + } + } + if r & 0b1111_0000 != 0 { + four_bites = false; + } + last = Some(r); + } + if four_bites && len <= 5 { + let mut regs = vec![]; + for reg in self.args { + regs.push(reg); + } + while regs.len() != 5 { + regs.push(0); + } + let [vc, vd, ve, vf, vg]: [u8; 5] = regs + .into_iter() + .map(|r| r as u8) + .collect::>() + .try_into() + .ok() + .unwrap(); + let a = self.args.len() as u8; + InsFormat::Format35C { + op: 0x6f, + a, + vc, + ve, + vd, + vf, + vg, + b: meth_idx as u16, + } + } else if consec && len <= 255 { + let a = self.args.len() as u8; + let vc = if let Some(vc) = first { vc } else { 0 }; + InsFormat::Format3RC { + op: 0x75, + a, + vc, + b: meth_idx as u16, + } + } else { + // Not supposed to happend with a sanitized invoke + panic!("Invalid Invoke instruction {self:?}") + } + } } /// Call a direct method (non static non overridable, like private). @@ -4555,6 +8809,104 @@ impl InvokeDirect { self.method.__str__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 6 + } +} + +impl InvokeDirect { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `method_idx` is the index of the refered method. + pub fn get_raw_ins(&self, meth_idx: usize) -> InsFormat { + let mut last = None; + let mut first = None; + let mut consec = true; + let mut four_bites = true; + let len = self.args.len(); + for r in self.args { + if first.is_none() { + first = Some(r); + } + if let Some(last) = last { + if r != last + 1 { + consec = false; + } + } + if r & 0b1111_0000 != 0 { + four_bites = false; + } + last = Some(r); + } + if four_bites && len <= 5 { + let mut regs = vec![]; + for reg in self.args { + regs.push(reg); + } + while regs.len() != 5 { + regs.push(0); + } + let [vc, vd, ve, vf, vg]: [u8; 5] = regs + .into_iter() + .map(|r| r as u8) + .collect::>() + .try_into() + .ok() + .unwrap(); + let a = self.args.len() as u8; + InsFormat::Format35C { + op: 0x70, + a, + vc, + ve, + vd, + vf, + vg, + b: meth_idx as u16, + } + } else if consec && len <= 255 { + let a = self.args.len() as u8; + let vc = if let Some(vc) = first { vc } else { 0 }; + InsFormat::Format3RC { + op: 0x76, + a, + vc, + b: meth_idx as u16, + } + } else { + // Not supposed to happend with a sanitized invoke + panic!("Invalid Invoke instruction {self:?}") + } + } } /// Call a static method. @@ -4632,6 +8984,104 @@ impl InvokeStatic { self.method.__str__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 6 + } +} + +impl InvokeStatic { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `method_idx` is the index of the refered method. + pub fn get_raw_ins(&self, meth_idx: usize) -> InsFormat { + let mut last = None; + let mut first = None; + let mut consec = true; + let mut four_bites = true; + let len = self.args.len(); + for r in self.args { + if first.is_none() { + first = Some(r); + } + if let Some(last) = last { + if r != last + 1 { + consec = false; + } + } + if r & 0b1111_0000 != 0 { + four_bites = false; + } + last = Some(r); + } + if four_bites && len <= 5 { + let mut regs = vec![]; + for reg in self.args { + regs.push(reg); + } + while regs.len() != 5 { + regs.push(0); + } + let [vc, vd, ve, vf, vg]: [u8; 5] = regs + .into_iter() + .map(|r| r as u8) + .collect::>() + .try_into() + .ok() + .unwrap(); + let a = self.args.len() as u8; + InsFormat::Format35C { + op: 0x71, + a, + vc, + ve, + vd, + vf, + vg, + b: meth_idx as u16, + } + } else if consec && len <= 255 { + let a = self.args.len() as u8; + let vc = if let Some(vc) = first { vc } else { 0 }; + InsFormat::Format3RC { + op: 0x77, + a, + vc, + b: meth_idx as u16, + } + } else { + // Not supposed to happend with a sanitized invoke + panic!("Invalid Invoke instruction {self:?}") + } + } } /// Call a interface method (method from an interface on an object whose class is unknown) @@ -4709,6 +9159,104 @@ impl InvokeInterface { self.method.__str__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + 6 + } +} + +impl InvokeInterface { + /// Return the raw instruction ([`InsFormat`]). + /// + /// `method_idx` is the index of the refered method. + pub fn get_raw_ins(&self, meth_idx: usize) -> InsFormat { + let mut last = None; + let mut first = None; + let mut consec = true; + let mut four_bites = true; + let len = self.args.len(); + for r in self.args { + if first.is_none() { + first = Some(r); + } + if let Some(last) = last { + if r != last + 1 { + consec = false; + } + } + if r & 0b1111_0000 != 0 { + four_bites = false; + } + last = Some(r); + } + if four_bites && len <= 5 { + let mut regs = vec![]; + for reg in self.args { + regs.push(reg); + } + while regs.len() != 5 { + regs.push(0); + } + let [vc, vd, ve, vf, vg]: [u8; 5] = regs + .into_iter() + .map(|r| r as u8) + .collect::>() + .try_into() + .ok() + .unwrap(); + let a = self.args.len() as u8; + InsFormat::Format35C { + op: 0x72, + a, + vc, + ve, + vd, + vf, + vg, + b: meth_idx as u16, + } + } else if consec && len <= 255 { + let a = self.args.len() as u8; + let vc = if let Some(vc) = first { vc } else { 0 }; + InsFormat::Format3RC { + op: 0x78, + a, + vc, + b: meth_idx as u16, + } + } else { + // Not supposed to happend with a sanitized invoke + panic!("Invalid Invoke instruction {self:?}") + } + } } /// Put -val in dest. @@ -4753,6 +9301,49 @@ impl NegInt { pub fn __repr__(&self) -> String { format!("Instruction(NegInt({}, {}))", self.dest, self.val) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl NegInt { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0x7b, + va: self.dest, + vb: self.val, + } + } } /// Put ~val in dest @@ -4797,6 +9388,49 @@ impl NotInt { pub fn __repr__(&self) -> String { format!("Instruction(NotInt({}, {}))", self.dest, self.val) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl NotInt { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0x7c, + va: self.dest, + vb: self.val, + } + } } /// Put -val in dest. dest and val are pair registers. @@ -4841,6 +9475,49 @@ impl NegLong { pub fn __repr__(&self) -> String { format!("Instruction(NegLong({}, {}))", self.dest, self.val) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl NegLong { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0x7d, + va: self.dest, + vb: self.val, + } + } } /// Put ~val in dest. dest and val are pair registers. @@ -4885,6 +9562,49 @@ impl NotLong { pub fn __repr__(&self) -> String { format!("Instruction(NotLong({}, {}))", self.dest, self.val) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl NotLong { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0x7e, + va: self.dest, + vb: self.val, + } + } } /// Put -val in dest. @@ -4929,6 +9649,49 @@ impl NegFloat { pub fn __repr__(&self) -> String { format!("Instruction(NegFloat({}, {}))", self.dest, self.val) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl NegFloat { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0x7f, + va: self.dest, + vb: self.val, + } + } } /// Put -val in dest. @@ -4973,6 +9736,49 @@ impl NegDouble { pub fn __repr__(&self) -> String { format!("Instruction(NegDouble({}, {}))", self.dest, self.val) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl NegDouble { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0x80, + va: self.dest, + vb: self.val, + } + } } /// Convert copy val to dest an convert to long. @@ -5019,6 +9825,49 @@ impl IntToLong { pub fn __repr__(&self) -> String { format!("Instruction(IntToLong({}, {}))", self.dest, self.val) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl IntToLong { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0x81, + va: self.dest, + vb: self.val, + } + } } /// Copy val to dest and convert the integer value to a float. @@ -5063,6 +9912,49 @@ impl IntToFloat { pub fn __repr__(&self) -> String { format!("Instruction(IntToFloat({}, {}))", self.dest, self.val) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl IntToFloat { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0x82, + va: self.dest, + vb: self.val, + } + } } /// Copy val to dest and convert the integer value to a double @@ -5109,6 +10001,49 @@ impl IntToDouble { pub fn __repr__(&self) -> String { format!("Instruction(IntToDouble({}, {}))", self.dest, self.val) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl IntToDouble { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0x83, + va: self.dest, + vb: self.val, + } + } } /// Copy val to dest and convert the long value to an integer. @@ -5155,6 +10090,49 @@ impl LongToInt { pub fn __repr__(&self) -> String { format!("Instruction(LongToInt({}, {}))", self.dest, self.val) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl LongToInt { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0x84, + va: self.dest, + vb: self.val, + } + } } /// Copy val to dest and convert the long value to a float. @@ -5201,6 +10179,49 @@ impl LongToFloat { pub fn __repr__(&self) -> String { format!("Instruction(LongToFloat({}, {}))", self.dest, self.val) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl LongToFloat { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0x85, + va: self.dest, + vb: self.val, + } + } } /// Copy val to dest and convert the long value to a double. @@ -5247,6 +10268,49 @@ impl LongToDouble { pub fn __repr__(&self) -> String { format!("Instruction(LongToDouble({}, {}))", self.dest, self.val) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl LongToDouble { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0x86, + va: self.dest, + vb: self.val, + } + } } /// Copy val to dest and convert the float value to an integer. @@ -5291,6 +10355,49 @@ impl FloatToInt { pub fn __repr__(&self) -> String { format!("Instruction(FloatToInt({}, {}))", self.dest, self.val) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl FloatToInt { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0x87, + va: self.dest, + vb: self.val, + } + } } /// Copy val to dest and convert the float value to a long. @@ -5337,6 +10444,49 @@ impl FloatToLong { pub fn __repr__(&self) -> String { format!("Instruction(FloatToLong({}, {}))", self.dest, self.val) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl FloatToLong { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0x88, + va: self.dest, + vb: self.val, + } + } } /// Copy val to dest and convert the float value to a double. @@ -5383,6 +10533,49 @@ impl FloatToDouble { pub fn __repr__(&self) -> String { format!("Instruction(FloatToDouble({}, {}))", self.dest, self.val) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl FloatToDouble { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0x89, + va: self.dest, + vb: self.val, + } + } } /// Copy val to dest and convert the double value to an integer. @@ -5429,6 +10622,49 @@ impl DoubleToInt { pub fn __repr__(&self) -> String { format!("Instruction(DoubleToInt({}, {}))", self.dest, self.val) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl DoubleToInt { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0x8a, + va: self.dest, + vb: self.val, + } + } } /// Copy val to dest and convert the double value to a long. @@ -5475,6 +10711,49 @@ impl DoubleToLong { pub fn __repr__(&self) -> String { format!("Instruction(DoubleToLong({}, {}))", self.dest, self.val) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl DoubleToLong { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0x8b, + va: self.dest, + vb: self.val, + } + } } /// Copy val to dest and convert the double value to a float. @@ -5521,6 +10800,49 @@ impl DoubleToFloat { pub fn __repr__(&self) -> String { format!("Instruction(DoubleToFloat({}, {}))", self.dest, self.val) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl DoubleToFloat { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0x8c, + va: self.dest, + vb: self.val, + } + } } /// Copy val to dest and convert the integer value to a byte. @@ -5565,6 +10887,49 @@ impl IntToByte { pub fn __repr__(&self) -> String { format!("Instruction(IntToByte({}, {}))", self.dest, self.val) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl IntToByte { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0x8d, + va: self.dest, + vb: self.val, + } + } } /// Copy val to dest and convert the integer value to a char. @@ -5609,6 +10974,49 @@ impl IntToChar { pub fn __repr__(&self) -> String { format!("Instruction(IntToChar({}, {}))", self.dest, self.val) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl IntToChar { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0x8e, + va: self.dest, + vb: self.val, + } + } } /// Copy val to dest and convert the integer value to a short. @@ -5653,6 +11061,49 @@ impl IntToShort { pub fn __repr__(&self) -> String { format!("Instruction(IntToShort({}, {}))", self.dest, self.val) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl IntToShort { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0x8f, + va: self.dest, + vb: self.val, + } + } } /// Put a + b in dest. @@ -5678,6 +11129,50 @@ impl AddInt { pub fn __repr__(&self) -> String { format!("Instruction(AddInt({}, {}, {}))", self.dest, self.b, self.c) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl AddInt { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x90, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a - b in dest. @@ -5703,6 +11198,50 @@ impl SubInt { pub fn __repr__(&self) -> String { format!("Instruction(SubInt({}, {}, {}))", self.dest, self.b, self.c) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl SubInt { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x91, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a * b in dest. @@ -5728,6 +11267,50 @@ impl MulInt { pub fn __repr__(&self) -> String { format!("Instruction(MulInt({}, {}, {}))", self.dest, self.b, self.c) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl MulInt { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x92, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a / b in dest. @@ -5753,6 +11336,50 @@ impl DivInt { pub fn __repr__(&self) -> String { format!("Instruction(DivInt({}, {}, {}))", self.dest, self.b, self.c) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl DivInt { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x93, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a % b in dest. @@ -5778,6 +11405,50 @@ impl RemInt { pub fn __repr__(&self) -> String { format!("Instruction(RemInt({}, {}, {}))", self.dest, self.b, self.c) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl RemInt { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x94, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a & b in dest. @@ -5803,6 +11474,50 @@ impl AndInt { pub fn __repr__(&self) -> String { format!("Instruction(AndInt({}, {}, {}))", self.dest, self.b, self.c) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl AndInt { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x95, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a | b in dest. @@ -5828,6 +11543,50 @@ impl OrInt { pub fn __repr__(&self) -> String { format!("Instruction(OrInt({}, {}, {}))", self.dest, self.b, self.c) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl OrInt { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x96, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a ^ b in dest. @@ -5853,6 +11612,50 @@ impl XorInt { pub fn __repr__(&self) -> String { format!("Instruction(XorInt({}, {}, {}))", self.dest, self.b, self.c) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl XorInt { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x97, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a << b in dest. @@ -5878,6 +11681,50 @@ impl ShlInt { pub fn __repr__(&self) -> String { format!("Instruction(ShlInt({}, {}, {}))", self.dest, self.b, self.c) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl ShlInt { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x98, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a >> b (signed) in dest. @@ -5903,6 +11750,50 @@ impl ShrInt { pub fn __repr__(&self) -> String { format!("Instruction(ShrInt({}, {}, {}))", self.dest, self.b, self.c) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl ShrInt { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x99, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a >> b in dest. @@ -5931,6 +11822,50 @@ impl UshrInt { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl UshrInt { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x9a, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a + b in dest. @@ -5961,6 +11896,50 @@ impl AddLong { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl AddLong { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x9b, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a - b in dest. @@ -5991,6 +11970,50 @@ impl SubLong { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl SubLong { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x9c, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a * b in dest. @@ -6021,6 +12044,50 @@ impl MulLong { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl MulLong { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x9d, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a / b in dest. @@ -6051,6 +12118,50 @@ impl DivLong { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl DivLong { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x9e, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a % b in dest. @@ -6081,6 +12192,50 @@ impl RemLong { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl RemLong { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0x9f, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a & b in dest. @@ -6111,6 +12266,50 @@ impl AndLong { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl AndLong { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0xa0, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a | b in dest. @@ -6138,6 +12337,50 @@ impl OrLong { pub fn __repr__(&self) -> String { format!("Instruction(OrLong({}, {}, {}))", self.dest, self.b, self.c) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl OrLong { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0xa1, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a ^ b in dest. @@ -6168,6 +12411,50 @@ impl XorLong { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl XorLong { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0xa2, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a << b in dest. @@ -6198,6 +12485,50 @@ impl ShlLong { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl ShlLong { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0xa3, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a >> b (signed) in dest. @@ -6228,6 +12559,50 @@ impl ShrLong { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl ShrLong { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0xa4, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a >> b in dest. @@ -6258,6 +12633,50 @@ impl UshrLong { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl UshrLong { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0xa5, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a + b in dest. @@ -6286,6 +12705,50 @@ impl AddFloat { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl AddFloat { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0xa6, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a - b in dest. @@ -6314,6 +12777,50 @@ impl SubFloat { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl SubFloat { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0xa7, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a * b in dest. @@ -6342,6 +12849,50 @@ impl MulFloat { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl MulFloat { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0xa8, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a / b in dest. @@ -6370,6 +12921,50 @@ impl DivFloat { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl DivFloat { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0xa9, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a % b in dest. @@ -6398,6 +12993,50 @@ impl RemFloat { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl RemFloat { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0xaa, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a + b in dest. @@ -6428,6 +13067,50 @@ impl AddDouble { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl AddDouble { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0xab, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a - b in dest. @@ -6458,6 +13141,50 @@ impl SubDouble { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl SubDouble { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0xac, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a * b in dest. @@ -6488,6 +13215,50 @@ impl MulDouble { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl MulDouble { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0xad, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a / b in dest. @@ -6518,6 +13289,50 @@ impl DivDouble { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl DivDouble { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0xae, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put a % b in dest. @@ -6548,6 +13363,50 @@ impl RemDouble { self.dest, self.b, self.c ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl RemDouble { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format23X { + op: 0xaf, + va: self.dest, + vb: self.b, + vc: self.c, + } + } } /// Put dest + b in dest. @@ -6592,6 +13451,49 @@ impl AddInt2Addr { pub fn __repr__(&self) -> String { format!("Instruction(AddInt2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl AddInt2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xb0, + va: self.dest, + vb: self.b, + } + } } /// Put dest - b in dest. @@ -6636,6 +13538,49 @@ impl SubInt2Addr { pub fn __repr__(&self) -> String { format!("Instruction(SubInt2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl SubInt2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xb1, + va: self.dest, + vb: self.b, + } + } } /// Put dest * b in dest. @@ -6680,6 +13625,49 @@ impl MulInt2Addr { pub fn __repr__(&self) -> String { format!("Instruction(MulInt2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl MulInt2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xb2, + va: self.dest, + vb: self.b, + } + } } /// Put dest / b in dest. @@ -6724,6 +13712,49 @@ impl DivInt2Addr { pub fn __repr__(&self) -> String { format!("Instruction(DivInt2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl DivInt2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xb3, + va: self.dest, + vb: self.b, + } + } } /// Put dest % b in dest. @@ -6768,6 +13799,49 @@ impl RemInt2Addr { pub fn __repr__(&self) -> String { format!("Instruction(RemInt2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl RemInt2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xb4, + va: self.dest, + vb: self.b, + } + } } /// Put dest & b in dest. @@ -6812,6 +13886,49 @@ impl AndInt2Addr { pub fn __repr__(&self) -> String { format!("Instruction(AndInt2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl AndInt2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xb5, + va: self.dest, + vb: self.b, + } + } } /// Put dest | b in dest. @@ -6856,6 +13973,49 @@ impl OrInt2Addr { pub fn __repr__(&self) -> String { format!("Instruction(OrInt2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl OrInt2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xb6, + va: self.dest, + vb: self.b, + } + } } /// Put dest ^ b in dest. @@ -6900,6 +14060,49 @@ impl XorInt2Addr { pub fn __repr__(&self) -> String { format!("Instruction(XorInt2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl XorInt2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xb7, + va: self.dest, + vb: self.b, + } + } } /// Put dest << b in dest. @@ -6944,6 +14147,49 @@ impl ShlInt2Addr { pub fn __repr__(&self) -> String { format!("Instruction(ShlInt2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl ShlInt2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xb8, + va: self.dest, + vb: self.b, + } + } } /// Put dest >> b (signed) in dest. @@ -6988,6 +14234,49 @@ impl ShrInt2Addr { pub fn __repr__(&self) -> String { format!("Instruction(ShrInt2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl ShrInt2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xb9, + va: self.dest, + vb: self.b, + } + } } /// Put dest >> b in dest. @@ -7032,6 +14321,49 @@ impl UshrInt2Addr { pub fn __repr__(&self) -> String { format!("Instruction(UshrInt2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl UshrInt2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xba, + va: self.dest, + vb: self.b, + } + } } /// Put dest + b in dest. @@ -7078,6 +14410,49 @@ impl AddLong2Addr { pub fn __repr__(&self) -> String { format!("Instruction(AddLong2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl AddLong2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xbb, + va: self.dest, + vb: self.b, + } + } } /// Put dest - b in dest. @@ -7124,6 +14499,49 @@ impl SubLong2Addr { pub fn __repr__(&self) -> String { format!("Instruction(SubLong2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl SubLong2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xbc, + va: self.dest, + vb: self.b, + } + } } /// Put dest * b in dest. @@ -7170,6 +14588,49 @@ impl MulLong2Addr { pub fn __repr__(&self) -> String { format!("Instruction(MulLong2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl MulLong2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xbc, + va: self.dest, + vb: self.b, + } + } } /// Put dest / b in dest. @@ -7216,6 +14677,49 @@ impl DivLong2Addr { pub fn __repr__(&self) -> String { format!("Instruction(DivLong2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl DivLong2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xbc, + va: self.dest, + vb: self.b, + } + } } /// Put dest % b in dest. @@ -7262,6 +14766,49 @@ impl RemLong2Addr { pub fn __repr__(&self) -> String { format!("Instruction(RemLong2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl RemLong2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xbf, + va: self.dest, + vb: self.b, + } + } } /// Put dest & b in dest. @@ -7308,6 +14855,49 @@ impl AndLong2Addr { pub fn __repr__(&self) -> String { format!("Instruction(AndLong2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl AndLong2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xc0, + va: self.dest, + vb: self.b, + } + } } /// Put dest | b in dest. @@ -7354,6 +14944,49 @@ impl OrLong2Addr { pub fn __repr__(&self) -> String { format!("Instruction(OrLong2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl OrLong2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xc1, + va: self.dest, + vb: self.b, + } + } } /// Put dest ^ b in dest. @@ -7400,6 +15033,49 @@ impl XorLong2Addr { pub fn __repr__(&self) -> String { format!("Instruction(XorLong2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl XorLong2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xc2, + va: self.dest, + vb: self.b, + } + } } /// Put dest << b in dest. @@ -7446,6 +15122,49 @@ impl ShlLong2Addr { pub fn __repr__(&self) -> String { format!("Instruction(ShlLong2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl ShlLong2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xc3, + va: self.dest, + vb: self.b, + } + } } /// Put dest >> b (signed) in dest. @@ -7492,6 +15211,49 @@ impl ShrLong2Addr { pub fn __repr__(&self) -> String { format!("Instruction(ShrLong2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl ShrLong2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xc4, + va: self.dest, + vb: self.b, + } + } } /// Put dest >> b in dest. @@ -7538,6 +15300,49 @@ impl UshrLong2Addr { pub fn __repr__(&self) -> String { format!("Instruction(UshrLong2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl UshrLong2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xc5, + va: self.dest, + vb: self.b, + } + } } /// Put dest + b in dest. @@ -7582,6 +15387,49 @@ impl AddFloat2Addr { pub fn __repr__(&self) -> String { format!("Instruction(AddFloat2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl AddFloat2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xc6, + va: self.dest, + vb: self.b, + } + } } /// Put dest - b in dest. @@ -7626,6 +15474,49 @@ impl SubFloat2Addr { pub fn __repr__(&self) -> String { format!("Instruction(SubFloat2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl SubFloat2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xc7, + va: self.dest, + vb: self.b, + } + } } /// Put dest * b in dest. @@ -7670,6 +15561,49 @@ impl MulFloat2Addr { pub fn __repr__(&self) -> String { format!("Instruction(MulFloat2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl MulFloat2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xc8, + va: self.dest, + vb: self.b, + } + } } /// Put dest / b in dest. @@ -7714,6 +15648,49 @@ impl DivFloat2Addr { pub fn __repr__(&self) -> String { format!("Instruction(DivFloat2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl DivFloat2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xc9, + va: self.dest, + vb: self.b, + } + } } /// Put dest % b in dest. @@ -7758,6 +15735,49 @@ impl RemFloat2Addr { pub fn __repr__(&self) -> String { format!("Instruction(RemFloat2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl RemFloat2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xca, + va: self.dest, + vb: self.b, + } + } } /// Put dest + b in dest. @@ -7804,6 +15824,49 @@ impl AddDouble2Addr { pub fn __repr__(&self) -> String { format!("Instruction(AddDouble2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl AddDouble2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xcb, + va: self.dest, + vb: self.b, + } + } } /// Put dest - b in dest. @@ -7850,6 +15913,49 @@ impl SubDouble2Addr { pub fn __repr__(&self) -> String { format!("Instruction(SubDouble2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl SubDouble2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xcc, + va: self.dest, + vb: self.b, + } + } } /// Put dest * b in dest. @@ -7896,6 +16002,49 @@ impl MulDouble2Addr { pub fn __repr__(&self) -> String { format!("Instruction(MulDouble2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl MulDouble2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xcd, + va: self.dest, + vb: self.b, + } + } } /// Put dest / b in dest. @@ -7942,6 +16091,49 @@ impl DivDouble2Addr { pub fn __repr__(&self) -> String { format!("Instruction(DivDouble2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl DivDouble2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xce, + va: self.dest, + vb: self.b, + } + } } /// Put dest % b in dest. @@ -7988,6 +16180,49 @@ impl RemDouble2Addr { pub fn __repr__(&self) -> String { format!("Instruction(RemDouble2Addr({}, {}))", self.dest, self.b) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } +} + +impl RemDouble2Addr { + /// Return the raw instruction ([`InsFormat`]). + pub fn get_raw_ins(&self) -> InsFormat { + InsFormat::Format12X { + op: 0xcf, + va: self.dest, + vb: self.b, + } + } } /// Put b + lit in dest. @@ -8048,6 +16283,38 @@ impl AddIntLit { self.dest, self.b, self.lit ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } } /// Put lit - b in dest. @@ -8108,6 +16375,38 @@ impl RsubIntLit { self.dest, self.b, self.lit ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } } /// Put b * lit in dest. @@ -8168,6 +16467,38 @@ impl MulIntLit { self.dest, self.b, self.lit ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } } /// Put b / lit in dest. @@ -8228,6 +16559,38 @@ impl DivIntLit { self.dest, self.b, self.lit ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } } /// Put b % lit in dest. @@ -8288,6 +16651,38 @@ impl RemIntLit { self.dest, self.b, self.lit ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } } /// Put b & lit in dest. @@ -8348,6 +16743,38 @@ impl AndIntLit { self.dest, self.b, self.lit ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } } /// Put b | lit in dest. @@ -8408,6 +16835,38 @@ impl OrIntLit { self.dest, self.b, self.lit ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } } /// Put b ^ lit in dest. @@ -8468,6 +16927,38 @@ impl XorIntLit { self.dest, self.b, self.lit ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } } /// Put b << lit in dest. @@ -8496,6 +16987,38 @@ impl ShlIntLit { self.dest, self.b, self.lit ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } } /// Put b >> lit (signed) in dest. @@ -8524,6 +17047,38 @@ impl ShrIntLit { self.dest, self.b, self.lit ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } } /// Put b >> lit in dest. @@ -8552,6 +17107,38 @@ impl UshrIntLit { self.dest, self.b, self.lit ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } } /// Call a polymorphic method. @@ -8640,6 +17227,38 @@ impl InvokePolymorphic { self.proto.__str__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } } /// Invoke a method from a call site. @@ -8717,6 +17336,38 @@ impl InvokeCustom { self.call_site.__str__(), ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } } /// Put contents reference to the method handle in the register. @@ -8745,6 +17396,38 @@ impl ConstMethodHandle { self.handle.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } } /// Put contents reference to the prototype in the register. @@ -8773,6 +17456,38 @@ impl ConstMethodType { self.proto.__repr__() ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } } /// Try block. It does not match an dalvik instruction but is derived from the code item struct. @@ -8836,6 +17551,38 @@ impl Try { self.end_label, handlers, self.default_handler, ) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } } /// Label marker. It does not match an dalvik instruction, but it's use as a marker for a @@ -8860,4 +17607,36 @@ impl Label { pub fn __repr__(&self) -> String { format!("Instruction(Label({}))", self.name) } + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + self.get_ins_size() + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn get_ins_size(&self) -> usize { + self.get_raw_ins().size() + } }