Skip to main content

Inst

Enum Inst 

Source
pub enum Inst {
Show 80 variants Mov { w: Width, dst: Op, src: Op, patch: bool, }, Bind(Lbl), MovZero32 { dst: Op, src: Op, }, Bswap { w: Width, dst: Op, src: Op, }, Load { w: Width, sx: Sx, dst: Gpr, addr: Mem, acquire: bool, }, Store { w: Width, src: Op, addr: Mem, }, LoadF { k: FKind, dst: Fpr, addr: Mem, }, StoreF { k: FKind, src: Fpr, addr: Mem, }, FMov { k: FKind, dst: Fpr, src: Fpr, }, LoadV { dst: Fpr, addr: Mem, }, StoreV { src: Fpr, addr: Mem, }, VMov { dst: Fpr, src: Fpr, }, Lea { w: Width, dst: Gpr, src: LeaSrc, }, Push { op: Op, }, Pop { op: Op, }, PushV { src: Fpr, }, PopV { dst: Fpr, }, Peek { disp: i32, dst: Gpr, }, Poke { disp: i32, src: Gpr, }, Add { w: Width, op: Alu3, }, Sub { w: Width, op: Alu3, }, Mul { w: Width, op: Alu3, }, And { w: Width, op: Alu3, }, Or { w: Width, op: Alu3, }, Xor { w: Width, op: Alu3, }, Not { w: Width, dst: Op, }, Neg { w: Width, dst: Op, }, Shift { w: Width, op: ShiftOp, dst: Gpr, cnt: ShiftCnt, }, MulImm { w: Width, dst: Gpr, lhs: Gpr, imm: i64, }, AluS { op: AluOp, w: Width, alu: Alu3, }, Adc { dst: Op, src: Op, }, Sbb { dst: Op, src: Op, }, MulWide { signed: bool, dst: Gpr, lhs: Gpr, rhs: Gpr, }, MulHigh { signed: bool, rhs: Op, }, DivMod1 { signed: bool, w: Width, divisor: Op, }, Div3 { signed: bool, w: Width, dst: Gpr, dvd: Op, dvs: Op, }, Rem3 { signed: bool, w: Width, dst: Gpr, dvd: Op, dvs: Op, }, Extend { from: Width, to: Width, sx: Sx, dst: Gpr, src: Op, }, Ctz { w: Width, dst: Gpr, src: Op, }, Clz { w: Width, dst: Gpr, src: Op, }, Popcnt { w: Width, dst: Gpr, src: Op, }, Cqo { quad: bool, }, AddShifted { dst: Gpr, lhs: Gpr, rhs: Gpr, amount: u8, }, Cmov { w: Width, zero: bool, dst: Gpr, src: Op, test: Gpr, }, VecExtract { w: Width, dst: Gpr, src: Fpr, lane: u8, }, Branch { cc: IntCc, w: Width, lhs: Op, rhs: Op, target: Lbl, patch: bool, }, TestBranch { w: Width, value: Op, mask: Option<Op>, test: TestKind, target: Lbl, patch: bool, }, OpBranch { op: FlagAlu, w: Width, flag: PredFlag, args: Vec<Op>, target: Lbl, patch: bool, }, FlagBranch { flag: PredFlag, target: Lbl, patch: bool, }, Jump { target: Target, patch: bool, }, Call { target: Target, patch: bool, }, Ret, Break, Nop, IntSet { cc: IntCc, w: Width, dst: Op, lhs: Op, rhs: Op, }, TestSet { w: Width, value: Op, mask: Option<Op>, test: TestKind, dst: Op, }, FArith { op: FAlu, k: FKind, arith: FArith3, }, Fma { op: FmaOp, k: FKind, a: Op, b: Op, c: Op, dst: Fpr, }, FSqrt { k: FKind, dst: Fpr, src: Op, }, FRound { k: FKind, mode: RoundMode, dst: Fpr, src: Op, }, FAbs { k: FKind, dst: Fpr, src: Op, }, FNeg { k: FKind, dst: Fpr, src: Op, }, FBit { or: bool, k: FKind, dst: Fpr, src: Op, }, CvtFI { k: FKind, w: Width, dst: Gpr, src: Op, }, CvtIF { signed: bool, from: Width, k: FKind, dst: Fpr, src: Op, }, CvtFF { from: FKind, to: FKind, dst: Fpr, src: Op, }, Bitcast { dir: BitcastDir, dst: Op, src: Op, }, BranchF { cc: FCc, k: FKind, lhs: Op, rhs: Op, target: Lbl, patch: bool, }, FSet { cc: FCc, k: FKind, dst: Op, lhs: Op, rhs: Op, }, Fence { full: bool, }, Pause, TlsLoad { w: Width, dst: Gpr, idx: i64, }, TlsStore { w: Width, src: Gpr, idx: i64, }, TlsLea { dst: Gpr, idx: i64, }, AtomicRmw { op: AtomicOp, w: Width, a: Op, b: Op, }, AtomicCas { w: Width, mem: Mem, src: Gpr, branch: Option<Lbl>, }, LoadLinked { w: Width, mem: Mem, dst: Gpr, }, StoreCond { w: Width, status: Gpr, src: Gpr, mem: Mem, }, PairLoad { w: PairW, dst1: Op, dst2: Op, mem: Mem, }, PairStore { w: PairW, src1: Op, src2: Op, mem: Mem, },
}

Variants§

§

Mov

Fields

§dst: Op
§src: Op
§patch: bool
§

Bind(Lbl)

§

MovZero32

Fields

§dst: Op
§src: Op
§

Bswap

Fields

§dst: Op
§src: Op
§

Load

Fields

§sx: Sx
§dst: Gpr
§addr: Mem
§acquire: bool
§

Store

Fields

§src: Op
§addr: Mem
§

LoadF

Fields

§dst: Fpr
§addr: Mem
§

StoreF

Fields

§src: Fpr
§addr: Mem
§

FMov

Fields

§dst: Fpr
§src: Fpr
§

LoadV

Fields

§dst: Fpr
§addr: Mem
§

StoreV

Fields

§src: Fpr
§addr: Mem
§

VMov

Fields

§dst: Fpr
§src: Fpr
§

Lea

Fields

§dst: Gpr
§

Push

Fields

§op: Op
§

Pop

Fields

§op: Op
§

PushV

Fields

§src: Fpr
§

PopV

Fields

§dst: Fpr
§

Peek

Fields

§disp: i32
§dst: Gpr
§

Poke

Fields

§disp: i32
§src: Gpr
§

Add

Fields

§op: Alu3
§

Sub

Fields

§op: Alu3
§

Mul

Fields

§op: Alu3
§

And

Fields

§op: Alu3
§

Or

Fields

§op: Alu3
§

Xor

Fields

§op: Alu3
§

Not

Fields

§dst: Op
§

Neg

Fields

§dst: Op
§

Shift

Fields

§dst: Gpr
§

MulImm

Fields

§dst: Gpr
§lhs: Gpr
§imm: i64
§

AluS

Fields

§alu: Alu3
§

Adc

Fields

§dst: Op
§src: Op
§

Sbb

Fields

§dst: Op
§src: Op
§

MulWide

Fields

§signed: bool
§dst: Gpr
§lhs: Gpr
§rhs: Gpr
§

MulHigh

Fields

§signed: bool
§rhs: Op
§

DivMod1

Fields

§signed: bool
§divisor: Op
§

Div3

Fields

§signed: bool
§dst: Gpr
§dvd: Op
§dvs: Op
§

Rem3

Fields

§signed: bool
§dst: Gpr
§dvd: Op
§dvs: Op
§

Extend

Fields

§from: Width
§sx: Sx
§dst: Gpr
§src: Op
§

Ctz

Fields

§dst: Gpr
§src: Op
§

Clz

Fields

§dst: Gpr
§src: Op
§

Popcnt

Fields

§dst: Gpr
§src: Op
§

Cqo

Fields

§quad: bool
§

AddShifted

Fields

§dst: Gpr
§lhs: Gpr
§rhs: Gpr
§amount: u8
§

Cmov

Fields

§zero: bool
§dst: Gpr
§src: Op
§test: Gpr
§

VecExtract

Fields

§dst: Gpr
§src: Fpr
§lane: u8
§

Branch

Fields

§lhs: Op
§rhs: Op
§target: Lbl
§patch: bool
§

TestBranch

Fields

§value: Op
§mask: Option<Op>
§target: Lbl
§patch: bool
§

OpBranch

Fields

§args: Vec<Op>
§target: Lbl
§patch: bool
§

FlagBranch

Fields

§target: Lbl
§patch: bool
§

Jump

Fields

§target: Target
§patch: bool
§

Call

Fields

§target: Target
§patch: bool
§

Ret

§

Break

Traps. break lowers to int3, brk, or ebreak.

§

Nop

§

IntSet

Compares integers and writes 0 or 1 to dst.

Fields

§dst: Op
§lhs: Op
§rhs: Op
§

TestSet

Tests a value and writes 0 or 1 to dst.

Fields

§value: Op
§mask: Option<Op>
§dst: Op
§

FArith

Runs scalar float arithmetic such as addf through divd.

Fields

§op: FAlu
§arith: FArith3
§

Fma

Runs a fused multiply-add. dst is op(a, b, c).

Fields

§a: Op
§b: Op
§c: Op
§dst: Fpr
§

FSqrt

Fields

§dst: Fpr
§src: Op
§

FRound

Fields

§dst: Fpr
§src: Op
§

FAbs

Fields

§dst: Fpr
§src: Op
§

FNeg

Fields

§dst: Fpr
§src: Op
§

FBit

Runs bitwise logic on float bits.

Fields

§or: bool
§dst: Fpr
§src: Op
§

CvtFI

Truncates a float to an integer when the value is in range.

Out-of-range results are the backend’s native saturate value.

Fields

§dst: Gpr
§src: Op
§

CvtIF

Converts an integer to a float exactly.

Fields

§signed: bool
§from: Width
§dst: Fpr
§src: Op
§

CvtFF

Narrows or widens a float.

Fields

§from: FKind
§dst: Fpr
§src: Op
§

Bitcast

Reinterprets bits between integer and float.

Fields

§dst: Op
§src: Op
§

BranchF

Compares floats and branches on the result.

Fields

§cc: FCc
§lhs: Op
§rhs: Op
§target: Lbl
§patch: bool
§

FSet

Compares floats and writes 0 or 1.

Fields

§cc: FCc
§dst: Op
§lhs: Op
§rhs: Op
§

Fence

Orders memory. memfence is a full barrier and fence is inner-shareable.

Fields

§full: bool
§

Pause

Hints a spin loop. Emits PAUSE on x86 and RISC-V, YIELD on AArch64.

§

TlsLoad

Loads a thread-local slot into a register.

Slots are 8 bytes wide. Sub-word widths zero-extend, matching loadb/loadh/loadi.

Fields

§dst: Gpr
§idx: i64
§

TlsStore

Stores a register into a thread-local slot.

Only the low w bytes are written; the rest of the slot is preserved.

Fields

§src: Gpr
§idx: i64
§

TlsLea

Materializes the address of a thread-local slot.

Fields

§dst: Gpr
§idx: i64
§

AtomicRmw

Runs an atomic read-modify-write.

Fields

§a: Op
§b: Op
§

AtomicCas

Compares and swaps atomically. The expected value lives in t0.

branch holds the batomicweakcas* target when present.

Fields

§mem: Mem
§src: Gpr
§branch: Option<Lbl>
§

LoadLinked

Loads linked for a later store-conditional.

Fields

§mem: Mem
§dst: Gpr
§

StoreCond

Stores conditionally. Writes 0 or 1 to status.

Fields

§status: Gpr
§src: Gpr
§mem: Mem
§

PairLoad

Loads a pair of values from one address.

Fields

§dst1: Op
§dst2: Op
§mem: Mem
§

PairStore

Stores a pair of values to one address.

Fields

§src1: Op
§src2: Op
§mem: Mem

Implementations§

Source§

impl Inst

Source

pub fn visit_labels(&self, f: &mut dyn FnMut(Lbl))

Visits every label this instruction binds, branches to, or names.

Frontends use this to resolve the opaque handles of one expansion (notably the Fresh labels expand creates) before printing or encoding the sequence.

Trait Implementations§

Source§

impl Clone for Inst

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Inst

Source§

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

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

impl Eq for Inst

Source§

impl PartialEq for Inst

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Inst

Auto Trait Implementations§

§

impl Freeze for Inst

§

impl RefUnwindSafe for Inst

§

impl Send for Inst

§

impl Sync for Inst

§

impl Unpin for Inst

§

impl UnsafeUnpin for Inst

§

impl UnwindSafe for Inst

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.