pub enum Instruction {
Show 59 variants
Add {
a: Operand,
b: Operand,
},
AddNsw {
a: Operand,
b: Operand,
},
AddNuw {
a: Operand,
b: Operand,
},
AddNw {
a: Operand,
b: Operand,
},
Sub {
a: Operand,
b: Operand,
},
SubNsw {
a: Operand,
b: Operand,
},
SubNuw {
a: Operand,
b: Operand,
},
SubNw {
a: Operand,
b: Operand,
},
Mul {
a: Operand,
b: Operand,
},
MulNsw {
a: Operand,
b: Operand,
},
MulNuw {
a: Operand,
b: Operand,
},
MulNw {
a: Operand,
b: Operand,
},
Udiv {
a: Operand,
b: Operand,
},
Sdiv {
a: Operand,
b: Operand,
},
UdivExact {
a: Operand,
b: Operand,
},
SdivExact {
a: Operand,
b: Operand,
},
Urem {
a: Operand,
b: Operand,
},
Srem {
a: Operand,
b: Operand,
},
And {
a: Operand,
b: Operand,
},
Or {
a: Operand,
b: Operand,
},
Xor {
a: Operand,
b: Operand,
},
Shl {
a: Operand,
b: Operand,
},
ShlNsw {
a: Operand,
b: Operand,
},
ShlNuw {
a: Operand,
b: Operand,
},
ShlNw {
a: Operand,
b: Operand,
},
Lshr {
a: Operand,
b: Operand,
},
LshrExact {
a: Operand,
b: Operand,
},
Ashr {
a: Operand,
b: Operand,
},
AshrExact {
a: Operand,
b: Operand,
},
Select {
a: Operand,
b: Operand,
c: Operand,
},
Zext {
a: Operand,
},
Sext {
a: Operand,
},
Trunc {
a: Operand,
},
Eq {
a: Operand,
b: Operand,
},
Ne {
a: Operand,
b: Operand,
},
Ult {
a: Operand,
b: Operand,
},
Slt {
a: Operand,
b: Operand,
},
Ule {
a: Operand,
b: Operand,
},
Sle {
a: Operand,
b: Operand,
},
Ctpop {
a: Operand,
},
Bswap {
a: Operand,
},
BitReverse {
a: Operand,
},
Cttz {
a: Operand,
},
Ctlz {
a: Operand,
},
Fshl {
a: Operand,
b: Operand,
c: Operand,
},
Fshr {
a: Operand,
b: Operand,
c: Operand,
},
SaddWithOverflow {
a: Operand,
b: Operand,
},
UaddWithOverflow {
a: Operand,
b: Operand,
},
SsubWithOverflow {
a: Operand,
b: Operand,
},
UsubWithOverflow {
a: Operand,
b: Operand,
},
SmulWithOverflow {
a: Operand,
b: Operand,
},
UmulWithOverflow {
a: Operand,
b: Operand,
},
SaddSat {
a: Operand,
b: Operand,
},
UaddSat {
a: Operand,
b: Operand,
},
SsubSat {
a: Operand,
b: Operand,
},
UsubSat {
a: Operand,
b: Operand,
},
ExtractValue {
a: Operand,
b: Operand,
},
Hole,
Freeze {
a: Operand,
},
}
Expand description
A Souper instruction.
Variants§
Add
Wrapping integer addition.
AddNsw
Integer addition where signed overflow is undefined behavior.
AddNuw
Integer addition where unsigned overflow is undefined behavior.
AddNw
Integer addition where any kind of overflow is undefined behavior.
Sub
Wrapping integer subtraction.
SubNsw
Integer subtraction where signed overflow is undefined behavior.
SubNuw
Integer subtraction where unsigned overflow is undefined behavior.
SubNw
Integer subtraction where any kind of overflow is undefined behavior.
Mul
Wrapping integer multiplication.
MulNsw
Integer multiplication where signed overflow is undefined behavior.
MulNuw
Integer multiplication where unsigned overflow is undefined behavior.
MulNw
Integer multiplication where any kind of overflow is undefined behavior.
Udiv
Unsigned integer division.
Sdiv
Signed integer division.
UdivExact
Unsigned division where a
must be exactly divisible by b
. If a
is
not exactly divisible by b
, then the result is undefined behavior.
SdivExact
Signed division where a
must be exactly divisible by b
. If a
is
not exactly divisible by b
, then the result is undefined behavior.
Urem
Unsigned integer remainder.
Srem
Signed integer remainder.
And
Bit-wise and.
Or
Bit-wise or.
Xor
Bit-wise xor.
Shl
Bit shift left. Undefined behavior if b
is greater than or equal to bitwidth(a)
.
ShlNsw
Bit shift left where shifting out any non-sign bits is undefined behavior.
ShlNuw
Bit shift left where shifting out any non-zero bits is undefined behavior.
ShlNw
Bit shift left where shifting out any non-zero or non-sign bits is undefined behavior.
Lshr
Logical bit shift right (fills left b
bits with zero). Undefined
behavior if b
is greater than or equal to bitwidth(a)
.
LshrExact
Logical bit shift right (fills left b
bits with zero) where it is
undefined behavior if any bits shifted out are non-zero.
Ashr
Arithmetic bit shift right (sign extends the left b
bits).
AshrExact
Arithmetic bit shift right (fills left b
bits with zero) where it is
undefined behavior if any bits shifted out are non-zero.
Select
If a
is 1, then evaluates to b
, otherwise evaluates to c
.
Zext
Zero extend a
.
Sext
Sign extend a
.
Trunc
Truncate a
.
Eq
a == b
.
Ne
a != b
Ult
Unsigned less than.
Slt
Signed less than.
Ule
Unsigned less than or equal.
Sle
Signed less than or equal.
Ctpop
Count the number of 1 bits in a
.
Bswap
Swap bytes in a
, e.g. 0xaabbccdd
becomes 0xddccbbaa
.
BitReverse
Reverse the bits in a
.
Cttz
Count trailing zero bits in a
.
Ctlz
Count leading one bits in a
.
Fshl
Left funnel shift.
Fshr
Right funnel shift.
SaddWithOverflow
Wrapping signed integer addition of a
and b
where the result is
extended by one bit which indicates whether the addition overflowed.
UaddWithOverflow
Wrapping unsigned integer addition of a
and b
where the result is
extended by one bit which indicates whether the addition overflowed.
SsubWithOverflow
Wrapping signed integer subtraction of a
and b
where the result is
extended by one bit which indicates whether the subtraction overflowed.
UsubWithOverflow
Wrapping unsigned integer subtraction of a
and b
where the result is
extended by one bit which indicates whether the subtraction overflowed.
SmulWithOverflow
Wrapping signed integer multiplication of a
and b
where the result
is extended by one bit which indicates whether the multiplication
overflowed.
UmulWithOverflow
Wrapping unsigned integer multiplication of a
and b
where the result
is extended by one bit which indicates whether the multiplication
overflowed.
SaddSat
Signed saturating integer addition.
UaddSat
Unsigned saturating integer addition.
SsubSat
Signed saturating integer subtraction.
UsubSat
Unsigned saturating integer subtraction.
ExtractValue
Extract the b
th value from a
.
Hole
A hole reserved for an unknown instruction or value.
Freeze
If a
is a poison or undef value, returns an arbitrary but fixed
value. Otherwise returns a
.
Trait Implementations§
Source§impl Clone for Instruction
impl Clone for Instruction
Source§fn clone(&self) -> Instruction
fn clone(&self) -> Instruction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for Instruction
impl Debug for Instruction
Source§impl From<Instruction> for AssignmentRhs
impl From<Instruction> for AssignmentRhs
Source§fn from(i: Instruction) -> Self
fn from(i: Instruction) -> Self
Source§impl Parse for Instruction
impl Parse for Instruction
Source§impl Peek for Instruction
impl Peek for Instruction
impl Copy for Instruction
Auto Trait Implementations§
impl Freeze for Instruction
impl RefUnwindSafe for Instruction
impl Send for Instruction
impl Sync for Instruction
impl Unpin for Instruction
impl UnwindSafe for Instruction
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
)