pub enum Op {
Show 68 variants
Ret(Ret),
Call(Call),
Jump(Jump),
BrIf(BrIf),
BrIfNot(BrIfNot),
BrIfXeq32(BrIfXeq32),
BrIfXneq32(BrIfXneq32),
BrIfXslt32(BrIfXslt32),
BrIfXslteq32(BrIfXslteq32),
BrIfXult32(BrIfXult32),
BrIfXulteq32(BrIfXulteq32),
BrIfXeq64(BrIfXeq64),
BrIfXneq64(BrIfXneq64),
BrIfXslt64(BrIfXslt64),
BrIfXslteq64(BrIfXslteq64),
BrIfXult64(BrIfXult64),
BrIfXulteq64(BrIfXulteq64),
Xmov(Xmov),
Fmov(Fmov),
Vmov(Vmov),
Xconst8(Xconst8),
Xconst16(Xconst16),
Xconst32(Xconst32),
Xconst64(Xconst64),
Xadd32(Xadd32),
Xadd64(Xadd64),
Xeq64(Xeq64),
Xneq64(Xneq64),
Xslt64(Xslt64),
Xslteq64(Xslteq64),
Xult64(Xult64),
Xulteq64(Xulteq64),
Xeq32(Xeq32),
Xneq32(Xneq32),
Xslt32(Xslt32),
Xslteq32(Xslteq32),
Xult32(Xult32),
Xulteq32(Xulteq32),
Load32U(Load32U),
Load32S(Load32S),
Load64(Load64),
Load32UOffset8(Load32UOffset8),
Load32SOffset8(Load32SOffset8),
Load64Offset8(Load64Offset8),
Load32UOffset64(Load32UOffset64),
Load32SOffset64(Load32SOffset64),
Load64Offset64(Load64Offset64),
Store32(Store32),
Store64(Store64),
Store32SOffset8(Store32SOffset8),
Store64Offset8(Store64Offset8),
Store32SOffset64(Store32SOffset64),
Store64Offset64(Store64Offset64),
PushFrame(PushFrame),
PopFrame(PopFrame),
XPush32(XPush32),
XPush32Many(XPush32Many),
XPush64(XPush64),
XPush64Many(XPush64Many),
XPop32(XPop32),
XPop32Many(XPop32Many),
XPop64(XPop64),
XPop64Many(XPop64Many),
BitcastIntFromFloat32(BitcastIntFromFloat32),
BitcastIntFromFloat64(BitcastIntFromFloat64),
BitcastFloatFromInt32(BitcastFloatFromInt32),
BitcastFloatFromInt64(BitcastFloatFromInt64),
ExtendedOp(ExtendedOp),
}
Expand description
A complete, materialized operation/instruction.
This type is useful for debugging, writing tests, etc… but is not actually ever used by the interpreter, encoder, or decoder, all of which avoid materializing ops.
Variants§
Ret(Ret)
Transfer control the address in the lr
register.
Call(Call)
Transfer control to the PC at the given offset and set the lr
register to the PC just after this instruction.
Jump(Jump)
Unconditionally transfer control to the PC at the given offset.
BrIf(BrIf)
Conditionally transfer control to the given PC offset if cond
contains a non-zero value.
BrIfNot(BrIfNot)
Conditionally transfer control to the given PC offset if cond
contains a zero value.
BrIfXeq32(BrIfXeq32)
Branch if a == b
.
BrIfXneq32(BrIfXneq32)
Branch if a !=
b.
BrIfXslt32(BrIfXslt32)
Branch if signed a < b
.
BrIfXslteq32(BrIfXslteq32)
Branch if signed a <= b
.
BrIfXult32(BrIfXult32)
Branch if unsigned a < b
.
BrIfXulteq32(BrIfXulteq32)
Branch if unsigned a <= b
.
BrIfXeq64(BrIfXeq64)
Branch if a == b
.
BrIfXneq64(BrIfXneq64)
Branch if a !=
b.
BrIfXslt64(BrIfXslt64)
Branch if signed a < b
.
BrIfXslteq64(BrIfXslteq64)
Branch if signed a <= b
.
BrIfXult64(BrIfXult64)
Branch if unsigned a < b
.
BrIfXulteq64(BrIfXulteq64)
Branch if unsigned a <= b
.
Xmov(Xmov)
Move between x
registers.
Fmov(Fmov)
Move between f
registers.
Vmov(Vmov)
Move between v
registers.
Xconst8(Xconst8)
Set dst = sign_extend(imm8)
.
Xconst16(Xconst16)
Set dst = sign_extend(imm16)
.
Xconst32(Xconst32)
Set dst = sign_extend(imm32)
.
Xconst64(Xconst64)
Set dst = imm64
.
Xadd32(Xadd32)
32-bit wrapping addition: low32(dst) = low32(src1) + low32(src2)
.
The upper 32-bits of dst
are unmodified.
Xadd64(Xadd64)
64-bit wrapping addition: dst = src1 + src2
.
Xeq64(Xeq64)
64-bit equality.
Xneq64(Xneq64)
64-bit inequality.
Xslt64(Xslt64)
64-bit signed less-than.
Xslteq64(Xslteq64)
64-bit signed less-than-equal.
Xult64(Xult64)
64-bit unsigned less-than.
Xulteq64(Xulteq64)
64-bit unsigned less-than-equal.
Xeq32(Xeq32)
32-bit equality.
Xneq32(Xneq32)
32-bit inequality.
Xslt32(Xslt32)
32-bit signed less-than.
Xslteq32(Xslteq32)
32-bit signed less-than-equal.
Xult32(Xult32)
32-bit unsigned less-than.
Xulteq32(Xulteq32)
32-bit unsigned less-than-equal.
Load32U(Load32U)
dst = zero_extend(load32(ptr))
Load32S(Load32S)
dst = sign_extend(load32(ptr))
Load64(Load64)
dst = load64(ptr)
Load32UOffset8(Load32UOffset8)
dst = zero_extend(load32(ptr + offset8))
Load32SOffset8(Load32SOffset8)
dst = sign_extend(load32(ptr + offset8))
Load64Offset8(Load64Offset8)
dst = load64(ptr + offset8)
Load32UOffset64(Load32UOffset64)
dst = zero_extend(load32(ptr + offset64))
Load32SOffset64(Load32SOffset64)
dst = sign_extend(load32(ptr + offset64))
Load64Offset64(Load64Offset64)
dst = load64(ptr + offset64)
Store32(Store32)
*ptr = low32(src)
Store64(Store64)
*ptr = src
Store32SOffset8(Store32SOffset8)
*(ptr + sign_extend(offset8)) = low32(src)
Store64Offset8(Store64Offset8)
*(ptr + sign_extend(offset8)) = src
Store32SOffset64(Store32SOffset64)
*(ptr + sign_extend(offset64)) = low32(src)
Store64Offset64(Store64Offset64)
*(ptr + sign_extend(offset64)) = src
PushFrame(PushFrame)
push lr; push fp; fp = sp
PopFrame(PopFrame)
sp = fp; pop fp; pop lr
XPush32(XPush32)
*sp = low32(src); sp += 4
XPush32Many(XPush32Many)
for src in srcs { xpush32 src }
XPush64(XPush64)
*sp = src; sp += 8
XPush64Many(XPush64Many)
for src in srcs { xpush64 src }
XPop32(XPop32)
*dst = *sp; sp -= 4
XPop32Many(XPop32Many)
for dst in dsts.rev() { xpop32 dst }
XPop64(XPop64)
*dst = *sp; sp -= 8
XPop64Many(XPop64Many)
for dst in dsts.rev() { xpop64 dst }
BitcastIntFromFloat32(BitcastIntFromFloat32)
low32(dst) = bitcast low32(src) as i32
BitcastIntFromFloat64(BitcastIntFromFloat64)
dst = bitcast src as i64
BitcastFloatFromInt32(BitcastFloatFromInt32)
low32(dst) = bitcast low32(src) as f32
BitcastFloatFromInt64(BitcastFloatFromInt64)
dst = bitcast src as f64
ExtendedOp(ExtendedOp)
An extended operation/instruction.
Implementations§
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for Op
impl<'arbitrary> Arbitrary<'arbitrary> for Op
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self
from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self
from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured
this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured
this type
needs to construct itself. Read moreSource§impl From<BitcastFloatFromInt32> for Op
impl From<BitcastFloatFromInt32> for Op
Source§fn from(op: BitcastFloatFromInt32) -> Self
fn from(op: BitcastFloatFromInt32) -> Self
Source§impl From<BitcastFloatFromInt64> for Op
impl From<BitcastFloatFromInt64> for Op
Source§fn from(op: BitcastFloatFromInt64) -> Self
fn from(op: BitcastFloatFromInt64) -> Self
Source§impl From<BitcastIntFromFloat32> for Op
impl From<BitcastIntFromFloat32> for Op
Source§fn from(op: BitcastIntFromFloat32) -> Self
fn from(op: BitcastIntFromFloat32) -> Self
Source§impl From<BitcastIntFromFloat64> for Op
impl From<BitcastIntFromFloat64> for Op
Source§fn from(op: BitcastIntFromFloat64) -> Self
fn from(op: BitcastIntFromFloat64) -> Self
Source§impl From<BrIfXneq32> for Op
impl From<BrIfXneq32> for Op
Source§fn from(op: BrIfXneq32) -> Self
fn from(op: BrIfXneq32) -> Self
Source§impl From<BrIfXneq64> for Op
impl From<BrIfXneq64> for Op
Source§fn from(op: BrIfXneq64) -> Self
fn from(op: BrIfXneq64) -> Self
Source§impl From<BrIfXslt32> for Op
impl From<BrIfXslt32> for Op
Source§fn from(op: BrIfXslt32) -> Self
fn from(op: BrIfXslt32) -> Self
Source§impl From<BrIfXslt64> for Op
impl From<BrIfXslt64> for Op
Source§fn from(op: BrIfXslt64) -> Self
fn from(op: BrIfXslt64) -> Self
Source§impl From<BrIfXslteq32> for Op
impl From<BrIfXslteq32> for Op
Source§fn from(op: BrIfXslteq32) -> Self
fn from(op: BrIfXslteq32) -> Self
Source§impl From<BrIfXslteq64> for Op
impl From<BrIfXslteq64> for Op
Source§fn from(op: BrIfXslteq64) -> Self
fn from(op: BrIfXslteq64) -> Self
Source§impl From<BrIfXult32> for Op
impl From<BrIfXult32> for Op
Source§fn from(op: BrIfXult32) -> Self
fn from(op: BrIfXult32) -> Self
Source§impl From<BrIfXult64> for Op
impl From<BrIfXult64> for Op
Source§fn from(op: BrIfXult64) -> Self
fn from(op: BrIfXult64) -> Self
Source§impl From<BrIfXulteq32> for Op
impl From<BrIfXulteq32> for Op
Source§fn from(op: BrIfXulteq32) -> Self
fn from(op: BrIfXulteq32) -> Self
Source§impl From<BrIfXulteq64> for Op
impl From<BrIfXulteq64> for Op
Source§fn from(op: BrIfXulteq64) -> Self
fn from(op: BrIfXulteq64) -> Self
Source§impl From<ExtendedOp> for Op
impl From<ExtendedOp> for Op
Source§fn from(op: ExtendedOp) -> Self
fn from(op: ExtendedOp) -> Self
Source§impl From<Load32SOffset64> for Op
impl From<Load32SOffset64> for Op
Source§fn from(op: Load32SOffset64) -> Self
fn from(op: Load32SOffset64) -> Self
Source§impl From<Load32SOffset8> for Op
impl From<Load32SOffset8> for Op
Source§fn from(op: Load32SOffset8) -> Self
fn from(op: Load32SOffset8) -> Self
Source§impl From<Load32UOffset64> for Op
impl From<Load32UOffset64> for Op
Source§fn from(op: Load32UOffset64) -> Self
fn from(op: Load32UOffset64) -> Self
Source§impl From<Load32UOffset8> for Op
impl From<Load32UOffset8> for Op
Source§fn from(op: Load32UOffset8) -> Self
fn from(op: Load32UOffset8) -> Self
Source§impl From<Load64Offset64> for Op
impl From<Load64Offset64> for Op
Source§fn from(op: Load64Offset64) -> Self
fn from(op: Load64Offset64) -> Self
Source§impl From<Load64Offset8> for Op
impl From<Load64Offset8> for Op
Source§fn from(op: Load64Offset8) -> Self
fn from(op: Load64Offset8) -> Self
Source§impl From<Store32SOffset64> for Op
impl From<Store32SOffset64> for Op
Source§fn from(op: Store32SOffset64) -> Self
fn from(op: Store32SOffset64) -> Self
Source§impl From<Store32SOffset8> for Op
impl From<Store32SOffset8> for Op
Source§fn from(op: Store32SOffset8) -> Self
fn from(op: Store32SOffset8) -> Self
Source§impl From<Store64Offset64> for Op
impl From<Store64Offset64> for Op
Source§fn from(op: Store64Offset64) -> Self
fn from(op: Store64Offset64) -> Self
Source§impl From<Store64Offset8> for Op
impl From<Store64Offset8> for Op
Source§fn from(op: Store64Offset8) -> Self
fn from(op: Store64Offset8) -> Self
Source§impl From<XPop32Many> for Op
impl From<XPop32Many> for Op
Source§fn from(op: XPop32Many) -> Self
fn from(op: XPop32Many) -> Self
Source§impl From<XPop64Many> for Op
impl From<XPop64Many> for Op
Source§fn from(op: XPop64Many) -> Self
fn from(op: XPop64Many) -> Self
Source§impl From<XPush32Many> for Op
impl From<XPush32Many> for Op
Source§fn from(op: XPush32Many) -> Self
fn from(op: XPush32Many) -> Self
Source§impl From<XPush64Many> for Op
impl From<XPush64Many> for Op
Source§fn from(op: XPush64Many) -> Self
fn from(op: XPush64Many) -> Self
impl Copy for Op
impl Eq for Op
impl StructuralPartialEq for Op
Auto Trait Implementations§
impl Freeze for Op
impl RefUnwindSafe for Op
impl Send for Op
impl Sync for Op
impl Unpin for Op
impl UnwindSafe for Op
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)