#[non_exhaustive]
pub enum Instr<Extension = ReservedOp> where
Extension: InstructionSet, {
ControlFlow(ControlFlowOp),
Put(PutOp),
Move(MoveOp),
Cmp(CmpOp),
Arithmetic(ArithmeticOp),
Bitwise(BitwiseOp),
Bytes(BytesOp),
Digest(DigestOp),
ExtensionCodes(Extension),
ReservedInstruction(ReservedOp),
Nop,
}
Expand description
Full set of instructions
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
ControlFlow(ControlFlowOp)
Control-flow instructions. See ControlFlowOp
for the details.
Put(PutOp)
Instructions setting register values. See PutOp
for the details.
Move(MoveOp)
Instructions moving and swapping register values. See PutOp
for the details.
Cmp(CmpOp)
Instructions comparing register values. See CmpOp
for the details.
Arithmetic(ArithmeticOp)
Arithmetic instructions. See ArithmeticOp
for the details.
Bitwise(BitwiseOp)
Bit operations & boolean algebra instructions. See BitwiseOp
for the details.
Bytes(BytesOp)
Operations on byte strings. See BytesOp
for the details.
Digest(DigestOp)
Cryptographic hashing functions. See DigestOp
for the details.
ExtensionCodes(Extension)
Extension operations which can be provided by a host environment provided via generic parameter
ReservedInstruction(ReservedOp)
Reserved instruction for fututre use in core ALU
ISA.
Currently equal to ControlFlowOp::Fail
.
Nop
No-operation instruction.
Trait Implementations
sourceimpl<Extension> Bytecode for Instr<Extension> where
Extension: InstructionSet,
impl<Extension> Bytecode for Instr<Extension> where
Extension: InstructionSet,
sourcefn byte_count(&self) -> u16
fn byte_count(&self) -> u16
Returns number of bytes which instruction and its argument occupies
sourcefn instr_range() -> RangeInclusive<u8>
fn instr_range() -> RangeInclusive<u8>
Returns range of instruction btecodes covered by a set of operations
sourcefn instr_byte(&self) -> u8
fn instr_byte(&self) -> u8
Returns byte representing instruction code (without its arguments)
sourcefn call_site(&self) -> Option<LibSite>
fn call_site(&self) -> Option<LibSite>
If the instruction call or references any external library, returns the call site in that library. Read more
sourcefn write_args<W>(&self, writer: &mut W) -> Result<(), BytecodeError> where
W: Write,
fn write_args<W>(&self, writer: &mut W) -> Result<(), BytecodeError> where
W: Write,
Writes instruction arguments as bytecode, omitting instruction code byte
sourceimpl<Extension: Clone> Clone for Instr<Extension> where
Extension: InstructionSet,
impl<Extension: Clone> Clone for Instr<Extension> where
Extension: InstructionSet,
sourceimpl<Extension: Debug> Debug for Instr<Extension> where
Extension: InstructionSet,
impl<Extension: Debug> Debug for Instr<Extension> where
Extension: InstructionSet,
sourceimpl<Extension> Display for Instr<Extension> where
Extension: InstructionSet,
impl<Extension> Display for Instr<Extension> where
Extension: InstructionSet,
sourceimpl<Extension: Hash> Hash for Instr<Extension> where
Extension: InstructionSet,
impl<Extension: Hash> Hash for Instr<Extension> where
Extension: InstructionSet,
sourceimpl<Extension> InstructionSet for Instr<Extension> where
Extension: InstructionSet,
impl<Extension> InstructionSet for Instr<Extension> where
Extension: InstructionSet,
sourcefn isa_ids() -> BTreeSet<&'static str>
fn isa_ids() -> BTreeSet<&'static str>
ISA Extensions used by the provided instruction set. Read more
sourcefn exec(&self, regs: &mut CoreRegs, site: LibSite) -> ExecStep
fn exec(&self, regs: &mut CoreRegs, site: LibSite) -> ExecStep
Executes given instruction taking all registers as input and output. Read more
sourcefn isa_string() -> String
fn isa_string() -> String
ISA Extension IDs represented as a standard string (space-separated) Read more
sourcefn isa_id() -> Box<[u8]>
fn isa_id() -> Box<[u8]>
ISA Extension IDs encoded in a standard way (space-separated) Read more
sourcefn is_supported(id: &str) -> bool
fn is_supported(id: &str) -> bool
Checks whether provided ISA extension ID is supported by the current instruction set
sourcefn complexity(&self) -> u64
fn complexity(&self) -> u64
Returns computational complexity of the instruction
sourceimpl<Extension: PartialEq> PartialEq<Instr<Extension>> for Instr<Extension> where
Extension: InstructionSet,
impl<Extension: PartialEq> PartialEq<Instr<Extension>> for Instr<Extension> where
Extension: InstructionSet,
impl<Extension: Eq> Eq for Instr<Extension> where
Extension: InstructionSet,
impl<Extension> StructuralEq for Instr<Extension> where
Extension: InstructionSet,
impl<Extension> StructuralPartialEq for Instr<Extension> where
Extension: InstructionSet,
Auto Trait Implementations
impl<Extension> RefUnwindSafe for Instr<Extension> where
Extension: RefUnwindSafe,
impl<Extension> Send for Instr<Extension> where
Extension: Send,
impl<Extension> Sync for Instr<Extension> where
Extension: Sync,
impl<Extension> Unpin for Instr<Extension> where
Extension: Unpin,
impl<Extension> UnwindSafe for Instr<Extension> where
Extension: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more