#[non_exhaustive]pub enum UsonicInstr {
CkNxIRo,
CkNxIAo,
CkNxORo,
CkNxOAo,
LdIRo,
LdIAo,
LdORo,
LdOAo,
RstIRo,
RstIAo,
RstORo,
RstOAo,
}Expand description
The instruction set uses iterator semantics and not random access semantic to correspond to the RISC type of the machine and not to add assumptions about abilities to access the operation state in a random way. Operation state is always iterated, such that not a single state element can be missed (as long as iterator runs to the end).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
CkNxIRo
Checks whether there is a next destructible memory cell in the contract state listed in the
operation input and sets CO register accordingly.
CkNxIAo
Checks whether there is a next immutable memory cell in the contract state listed in the
operation input and sets CO register accordingly.
CkNxORo
Checks whether there is a next destructible memory cell defined by the operation and sets
CO register accordingly.
CkNxOAo
Checks whether there is a next immutable memory cell defined by the operation and sets CO
register accordingly.
LdIRo
Load next [StateValue] from the current input destructible memory cell to EA-ED
registers.
If the next state value is absent, sets CO to a failed state. Otherwise, resets CO.
LdIAo
Load next [StateValue] from the current input immutable memory cell to EA-ED
registers.
If the next state value is absent, sets CO to a failed state. Otherwise, resets CO.
LdORo
Load next [StateValue] from the current output destructible memory cell to EA-ED
registers.
If the next state value is absent, sets CO to a failed state. Otherwise, resets CO.
LdOAo
Load next [StateValue] from the current output immutable memory cell to EA-ED
registers.
If the next state value is absent, sets CO to a failed state. Otherwise, resets CO.
RstIRo
Resets iterator over input destructible memory cells by setting corresponding UI value to
zero.
Does not affect the value of CO or CK registers.
RstIAo
Resets iterator over input immutable memory cells by setting corresponding UI value to
zero.
Does not affect the value of CO or CK registers.
RstORo
Resets iterator over output destructible memory cells by setting corresponding UI value
to zero.
Does not affect the value of CO or CK registers.
RstOAo
Resets iterator over output immutable memory cells by setting corresponding UI value to
zero.
Does not affect the value of CO or CK registers.
Trait Implementations§
Source§impl<Id> Bytecode<Id> for UsonicInstrwhere
Id: SiteId,
impl<Id> Bytecode<Id> for UsonicInstrwhere
Id: SiteId,
Source§fn op_range() -> RangeInclusive<u8>
fn op_range() -> RangeInclusive<u8>
Source§fn opcode_byte(&self) -> u8
fn opcode_byte(&self) -> u8
Source§fn code_byte_len(&self) -> u16
fn code_byte_len(&self) -> u16
Source§fn external_ref(&self) -> Option<Id>
fn external_ref(&self) -> Option<Id>
Source§fn encode_operands<W>(
&self,
_writer: &mut W,
) -> Result<(), <W as BytecodeWrite<Id>>::Error>where
W: BytecodeWrite<Id>,
fn encode_operands<W>(
&self,
_writer: &mut W,
) -> Result<(), <W as BytecodeWrite<Id>>::Error>where
W: BytecodeWrite<Id>,
Source§fn decode_operands<R>(
_reader: &mut R,
opcode: u8,
) -> Result<UsonicInstr, CodeEofError>
fn decode_operands<R>( _reader: &mut R, opcode: u8, ) -> Result<UsonicInstr, CodeEofError>
Source§fn encode_instr<W>(
&self,
writer: &mut W,
) -> Result<(), <W as BytecodeWrite<Id>>::Error>where
W: BytecodeWrite<Id>,
fn encode_instr<W>(
&self,
writer: &mut W,
) -> Result<(), <W as BytecodeWrite<Id>>::Error>where
W: BytecodeWrite<Id>,
Source§fn decode_instr<R>(reader: &mut R) -> Result<Self, CodeEofError>where
Self: Sized,
R: BytecodeRead<Id>,
fn decode_instr<R>(reader: &mut R) -> Result<Self, CodeEofError>where
Self: Sized,
R: BytecodeRead<Id>,
Source§impl Clone for UsonicInstr
impl Clone for UsonicInstr
Source§fn clone(&self) -> UsonicInstr
fn clone(&self) -> UsonicInstr
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UsonicInstr
impl Debug for UsonicInstr
Source§impl Display for UsonicInstr
impl Display for UsonicInstr
Source§impl<Id> From<UsonicInstr> for Instr<Id>where
Id: SiteId,
impl<Id> From<UsonicInstr> for Instr<Id>where
Id: SiteId,
Source§fn from(v: UsonicInstr) -> Instr<Id>
fn from(v: UsonicInstr) -> Instr<Id>
Source§impl Hash for UsonicInstr
impl Hash for UsonicInstr
Source§impl<Id> Instruction<Id> for UsonicInstrwhere
Id: SiteId,
impl<Id> Instruction<Id> for UsonicInstrwhere
Id: SiteId,
const ISA_EXT: &'static [&'static str]
type Core = UsonicCore
fn is_goto_target(&self) -> bool
fn local_goto_pos(&mut self) -> Option<&mut u16>
fn remote_goto_pos(&mut self) -> Option<&mut Site<Id>>
Source§fn src_regs(&self) -> BTreeSet<RegE>
fn src_regs(&self) -> BTreeSet<RegE>
Source§fn dst_regs(&self) -> BTreeSet<RegE>
fn dst_regs(&self) -> BTreeSet<RegE>
Source§fn op_data_bytes(&self) -> u16
fn op_data_bytes(&self) -> u16
Source§fn ext_data_bytes(&self) -> u16
fn ext_data_bytes(&self) -> u16
Source§fn exec(
&self,
_site: Site<Id>,
core: &mut Core<Id, <UsonicInstr as Instruction<Id>>::Core>,
context: &<UsonicInstr as Instruction<Id>>::Context<'_>,
) -> ExecStep<Site<Id>>
fn exec( &self, _site: Site<Id>, core: &mut Core<Id, <UsonicInstr as Instruction<Id>>::Core>, context: &<UsonicInstr as Instruction<Id>>::Context<'_>, ) -> ExecStep<Site<Id>>
fn isa_ext() -> Confined<BTreeSet<IsaId>, amplify::::collection::confinement::TinyOrdSet::{constant#0}, amplify::::collection::confinement::TinyOrdSet::{constant#1}>
Source§fn regs(&self) -> BTreeSet<<Self::Core as CoreExt>::Reg>
fn regs(&self) -> BTreeSet<<Self::Core as CoreExt>::Reg>
Source§fn src_reg_bytes(&self) -> u16
fn src_reg_bytes(&self) -> u16
Source§fn dst_reg_bytes(&self) -> u16
fn dst_reg_bytes(&self) -> u16
fn base_complexity(&self) -> u64
Source§fn complexity(&self) -> u64
fn complexity(&self) -> u64
Source§impl PartialEq for UsonicInstr
impl PartialEq for UsonicInstr
impl Copy for UsonicInstr
impl Eq for UsonicInstr
impl StructuralPartialEq for UsonicInstr
Auto Trait Implementations§
impl Freeze for UsonicInstr
impl RefUnwindSafe for UsonicInstr
impl Send for UsonicInstr
impl Sync for UsonicInstr
impl Unpin for UsonicInstr
impl UnwindSafe for UsonicInstr
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.