pub struct EncodedInst(/* private fields */);Expand description
One encoded instruction: sixteen bytes, little-endian.
Built by encode() and read back by decode(). The accessors are the
whole of the format — an EncodedInst means nothing except what they
say it means.
Implementations§
Source§impl EncodedInst
impl EncodedInst
Sourcepub const BYTES: usize = 16
pub const BYTES: usize = 16
How wide one instruction is. Two words, four to a cache line, and the
byte offset of instruction pc is pc << 4.
Sourcepub fn new(opcode: u8, a: u16, b: u16, c: u16, payload: u64) -> EncodedInst
pub fn new(opcode: u8, a: u16, b: u16, c: u16, payload: u64) -> EncodedInst
An instruction from its fields, which is the only way the encoder builds one.
Sourcepub fn from_bytes(bytes: [u8; 16]) -> EncodedInst
pub fn from_bytes(bytes: [u8; 16]) -> EncodedInst
An instruction from bytes nothing here produced.
This is how a verifier test, a debugger and a future loader get one,
and it is why verify() may not assume anything about the contents.
Trait Implementations§
Source§impl Clone for EncodedInst
impl Clone for EncodedInst
Source§fn clone(&self) -> EncodedInst
fn clone(&self) -> EncodedInst
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for EncodedInst
Source§impl Debug for EncodedInst
Sixteen bytes in hex, so that a failing test says which byte.
impl Debug for EncodedInst
Sixteen bytes in hex, so that a failing test says which byte.
impl Eq for EncodedInst
Source§impl Hash for EncodedInst
impl Hash for EncodedInst
Source§impl PartialEq for EncodedInst
impl PartialEq for EncodedInst
Source§fn eq(&self, other: &EncodedInst) -> bool
fn eq(&self, other: &EncodedInst) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for EncodedInst
Auto Trait Implementations§
impl Freeze for EncodedInst
impl RefUnwindSafe for EncodedInst
impl Send for EncodedInst
impl Sync for EncodedInst
impl Unpin for EncodedInst
impl UnsafeUnpin for EncodedInst
impl UnwindSafe for EncodedInst
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.