Skip to main content

Nnil

Struct Nnil 

Source
pub struct Nnil { /* private fields */ }

Implementations§

Source§

impl Nnil

Source

pub fn new() -> Self

Source

pub fn with_base(address: u64) -> Self

Source

pub fn create_label(&mut self, addr: u64) -> Label

Source

pub fn new_insn(&mut self)

Source

pub fn advance_by(&mut self, amount: u64)

Source

pub fn base(&self) -> u64

Source

pub fn pc(&self) -> u64

Source

pub fn entrypoint(&self) -> Option<Address>

Source

pub fn insns(&self) -> &[NnilInstruction]

Source

pub fn instruction_starts(&self) -> &BTreeMap<Address, Insn>

Source

pub fn labels(&self) -> &BTreeMap<Address, Label>

Source

pub fn label_for_address(&self, addr: Address) -> Option<Label>

Source

pub fn label_address(&self, label: Label) -> Option<Address>

Source

pub fn imm(&mut self, imm: i64) -> Insn

Source

pub fn reg(&mut self, reg: u64) -> Insn

Source

pub fn tmp_reg(&mut self, reg: u64) -> Insn

Source

pub fn add(&mut self, lhs: Insn, rhs: Insn) -> Insn

Source

pub fn sub(&mut self, lhs: Insn, rhs: Insn) -> Insn

Source

pub fn mul(&mut self, lhs: Insn, rhs: Insn) -> Insn

Source

pub fn mulh(&mut self, lhs: Insn, rhs: Insn) -> Insn

Source

pub fn div(&mut self, lhs: Insn, rhs: Insn) -> Insn

Source

pub fn mod(&mut self, lhs: Insn, rhs: Insn) -> Insn

Source

pub fn and(&mut self, lhs: Insn, rhs: Insn) -> Insn

Source

pub fn or(&mut self, lhs: Insn, rhs: Insn) -> Insn

Source

pub fn xor(&mut self, lhs: Insn, rhs: Insn) -> Insn

Source

pub fn sll(&mut self, lhs: Insn, rhs: Insn) -> Insn

Source

pub fn srl(&mut self, lhs: Insn, rhs: Insn) -> Insn

Source

pub fn sra(&mut self, lhs: Insn, rhs: Insn) -> Insn

Source

pub fn slt(&mut self, lhs: Insn, rhs: Insn) -> Insn

Source

pub fn mov(&mut self, dst: Insn, src: Insn) -> Insn

Source

pub fn set(&mut self, dst: Insn, src: Insn) -> Insn

Source

pub fn jr(&mut self, dst: Insn) -> Insn

Source

pub fn jmp(&mut self, dst: Insn) -> Insn

Source

pub fn beq(&mut self, lhs: Insn, rhs: Insn, ttgt: Label, ftgt: Label) -> Insn

Source

pub fn bne(&mut self, lhs: Insn, rhs: Insn, ttgt: Label, ftgt: Label) -> Insn

Source

pub fn blt(&mut self, lhs: Insn, rhs: Insn, ttgt: Label, ftgt: Label) -> Insn

Source

pub fn bgt(&mut self, lhs: Insn, rhs: Insn, ttgt: Label, ftgt: Label) -> Insn

Source

pub fn load(&mut self, dst: Insn, src: Insn, size: u64) -> Insn

Source

pub fn store(&mut self, dst: Insn, src: Insn, size: u64) -> Insn

Source

pub fn sext(&mut self, size: usize, dst: Insn) -> Insn

Source

pub fn zext(&mut self, size: usize, dst: Insn) -> Insn

Source

pub fn signed(&mut self, dst: Insn) -> Insn

Source

pub fn unsigned(&mut self, dst: Insn) -> Insn

Source

pub fn fdiv(&mut self, size: usize, lhs: Insn, rhs: Insn) -> Insn

Source

pub fn int_to_float( &mut self, src: Insn, src_size: usize, signed: bool, dst_size: usize, ) -> Insn

Source

pub fn syscall(&mut self) -> Insn

Source

pub fn sysbreak(&mut self) -> Insn

Source

pub fn lr(&mut self, dst: Insn, src: Insn, size: u64) -> Insn

Source

pub fn sc(&mut self, dst: Insn, src: Insn, addr: Insn, size: u64) -> Insn

Source

pub fn amo( &mut self, op: AmoOp, dst: Insn, src: Insn, addr: Insn, size: u64, ) -> Insn

Source

pub fn fence(&mut self, mode: u8, pred: u8, succ: u8) -> Insn

Trait Implementations§

Source§

impl Debug for Nnil

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Nnil

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Nnil

§

impl RefUnwindSafe for Nnil

§

impl Send for Nnil

§

impl Sync for Nnil

§

impl Unpin for Nnil

§

impl UnsafeUnpin for Nnil

§

impl UnwindSafe for Nnil

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> 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, 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.