RawInstruction

Struct RawInstruction 

Source
pub struct RawInstruction<T>(pub T);
Expand description

Each instruction is three 32 bit unsigned integers divided as follows. lsb msb COAABBBB VVVVVVVV DDDDDDDD Condition Opcode paramA paramB Value Debug

The Debug field contains the following information:

  • line: The source code line which the instruction was compiled from.
  • ast_location: Where in the AST the instruction was compiled from, encoded by the RawAstLocation enum.
  • extra: Additional debugging information, meaning depends on the value of ast_location. If ast_location is AcceptStatementFailure, extra is the key of the accept statement. Otherwise, extra is unused.

Tuple Fields§

§0: T

Implementations§

Source§

impl<T: AsRef<[u32]>> RawInstruction<T>

Source

pub fn condition(&self) -> u32

Source

pub fn operation(&self) -> u32

Source

pub fn parameter_a(&self) -> u32

Source

pub fn parameter_b(&self) -> u32

Source

pub fn value(&self) -> u32

Source

pub fn line(&self) -> u32

Source

pub fn ast_location(&self) -> u32

Source

pub fn extra(&self) -> u32

Source§

impl<T: AsMut<[u32]>> RawInstruction<T>

Source

pub fn set_condition(&mut self, value: u32)

Source

pub fn set_operation(&mut self, value: u32)

Source

pub fn set_parameter_a(&mut self, value: u32)

Source

pub fn set_parameter_b(&mut self, value: u32)

Source

pub fn set_value(&mut self, value: u32)

Source

pub fn set_line(&mut self, value: u32)

Source

pub fn set_ast_location(&mut self, value: u32)

Source

pub fn set_extra(&mut self, value: u32)

Trait Implementations§

Source§

impl<T: AsRef<[u32]>> BitRange<i128> for RawInstruction<T>

Source§

fn bit_range(&self, msb: usize, lsb: usize) -> i128

Get a range of bits.
Source§

impl<T: AsRef<[u32]>> BitRange<i16> for RawInstruction<T>

Source§

fn bit_range(&self, msb: usize, lsb: usize) -> i16

Get a range of bits.
Source§

impl<T: AsRef<[u32]>> BitRange<i32> for RawInstruction<T>

Source§

fn bit_range(&self, msb: usize, lsb: usize) -> i32

Get a range of bits.
Source§

impl<T: AsRef<[u32]>> BitRange<i64> for RawInstruction<T>

Source§

fn bit_range(&self, msb: usize, lsb: usize) -> i64

Get a range of bits.
Source§

impl<T: AsRef<[u32]>> BitRange<i8> for RawInstruction<T>

Source§

fn bit_range(&self, msb: usize, lsb: usize) -> i8

Get a range of bits.
Source§

impl<T: AsRef<[u32]>> BitRange<u128> for RawInstruction<T>

Source§

fn bit_range(&self, msb: usize, lsb: usize) -> u128

Get a range of bits.
Source§

impl<T: AsRef<[u32]>> BitRange<u16> for RawInstruction<T>

Source§

fn bit_range(&self, msb: usize, lsb: usize) -> u16

Get a range of bits.
Source§

impl<T: AsRef<[u32]>> BitRange<u32> for RawInstruction<T>

Source§

fn bit_range(&self, msb: usize, lsb: usize) -> u32

Get a range of bits.
Source§

impl<T: AsRef<[u32]>> BitRange<u64> for RawInstruction<T>

Source§

fn bit_range(&self, msb: usize, lsb: usize) -> u64

Get a range of bits.
Source§

impl<T: AsRef<[u32]>> BitRange<u8> for RawInstruction<T>

Source§

fn bit_range(&self, msb: usize, lsb: usize) -> u8

Get a range of bits.
Source§

impl<T: AsMut<[u32]>> BitRangeMut<i128> for RawInstruction<T>

Source§

fn set_bit_range(&mut self, msb: usize, lsb: usize, value: i128)

Set a range of bits.
Source§

impl<T: AsMut<[u32]>> BitRangeMut<i16> for RawInstruction<T>

Source§

fn set_bit_range(&mut self, msb: usize, lsb: usize, value: i16)

Set a range of bits.
Source§

impl<T: AsMut<[u32]>> BitRangeMut<i32> for RawInstruction<T>

Source§

fn set_bit_range(&mut self, msb: usize, lsb: usize, value: i32)

Set a range of bits.
Source§

impl<T: AsMut<[u32]>> BitRangeMut<i64> for RawInstruction<T>

Source§

fn set_bit_range(&mut self, msb: usize, lsb: usize, value: i64)

Set a range of bits.
Source§

impl<T: AsMut<[u32]>> BitRangeMut<i8> for RawInstruction<T>

Source§

fn set_bit_range(&mut self, msb: usize, lsb: usize, value: i8)

Set a range of bits.
Source§

impl<T: AsMut<[u32]>> BitRangeMut<u128> for RawInstruction<T>

Source§

fn set_bit_range(&mut self, msb: usize, lsb: usize, value: u128)

Set a range of bits.
Source§

impl<T: AsMut<[u32]>> BitRangeMut<u16> for RawInstruction<T>

Source§

fn set_bit_range(&mut self, msb: usize, lsb: usize, value: u16)

Set a range of bits.
Source§

impl<T: AsMut<[u32]>> BitRangeMut<u32> for RawInstruction<T>

Source§

fn set_bit_range(&mut self, msb: usize, lsb: usize, value: u32)

Set a range of bits.
Source§

impl<T: AsMut<[u32]>> BitRangeMut<u64> for RawInstruction<T>

Source§

fn set_bit_range(&mut self, msb: usize, lsb: usize, value: u64)

Set a range of bits.
Source§

impl<T: AsMut<[u32]>> BitRangeMut<u8> for RawInstruction<T>

Source§

fn set_bit_range(&mut self, msb: usize, lsb: usize, value: u8)

Set a range of bits.
Source§

impl Display for RawInstruction<[u32; 3]>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Freeze for RawInstruction<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for RawInstruction<T>
where T: RefUnwindSafe,

§

impl<T> Send for RawInstruction<T>
where T: Send,

§

impl<T> Sync for RawInstruction<T>
where T: Sync,

§

impl<T> Unpin for RawInstruction<T>
where T: Unpin,

§

impl<T> UnwindSafe for RawInstruction<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Bit for T
where T: BitRange<u8>,

Source§

fn bit(&self, bit: usize) -> bool

Get a single bit.
Source§

impl<T> BitMut for T
where T: BitRangeMut<u8>,

Source§

fn set_bit(&mut self, bit: usize, value: bool)

Set a single bit.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> GetTypeId for T
where T: Any,

Source§

fn typeid(&self) -> TypeId

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.