souper_ir::ast

Enum Instruction

Source
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.

Fields

§

AddNsw

Integer addition where signed overflow is undefined behavior.

Fields

§

AddNuw

Integer addition where unsigned overflow is undefined behavior.

Fields

§

AddNw

Integer addition where any kind of overflow is undefined behavior.

Fields

§

Sub

Wrapping integer subtraction.

Fields

§

SubNsw

Integer subtraction where signed overflow is undefined behavior.

Fields

§

SubNuw

Integer subtraction where unsigned overflow is undefined behavior.

Fields

§

SubNw

Integer subtraction where any kind of overflow is undefined behavior.

Fields

§

Mul

Wrapping integer multiplication.

Fields

§

MulNsw

Integer multiplication where signed overflow is undefined behavior.

Fields

§

MulNuw

Integer multiplication where unsigned overflow is undefined behavior.

Fields

§

MulNw

Integer multiplication where any kind of overflow is undefined behavior.

Fields

§

Udiv

Unsigned integer division.

Fields

§

Sdiv

Signed integer division.

Fields

§

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.

Fields

§

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.

Fields

§

Urem

Unsigned integer remainder.

Fields

§

Srem

Signed integer remainder.

Fields

§

And

Bit-wise and.

Fields

§

Or

Bit-wise or.

Fields

§

Xor

Bit-wise xor.

Fields

§

Shl

Bit shift left. Undefined behavior if b is greater than or equal to bitwidth(a).

Fields

§

ShlNsw

Bit shift left where shifting out any non-sign bits is undefined behavior.

Fields

§

ShlNuw

Bit shift left where shifting out any non-zero bits is undefined behavior.

Fields

§

ShlNw

Bit shift left where shifting out any non-zero or non-sign bits is undefined behavior.

Fields

§

Lshr

Logical bit shift right (fills left b bits with zero). Undefined behavior if b is greater than or equal to bitwidth(a).

Fields

§

LshrExact

Logical bit shift right (fills left b bits with zero) where it is undefined behavior if any bits shifted out are non-zero.

Fields

§

Ashr

Arithmetic bit shift right (sign extends the left b bits).

Fields

§

AshrExact

Arithmetic bit shift right (fills left b bits with zero) where it is undefined behavior if any bits shifted out are non-zero.

Fields

§

Select

If a is 1, then evaluates to b, otherwise evaluates to c.

§

Zext

Zero extend a.

Fields

§

Sext

Sign extend a.

Fields

§

Trunc

Truncate a.

Fields

§

Eq

a == b.

Fields

§

Ne

a != b

Fields

§

Ult

Unsigned less than.

Fields

§

Slt

Signed less than.

Fields

§

Ule

Unsigned less than or equal.

Fields

§

Sle

Signed less than or equal.

Fields

§

Ctpop

Count the number of 1 bits in a.

Fields

§

Bswap

Swap bytes in a, e.g. 0xaabbccdd becomes 0xddccbbaa.

Fields

§

BitReverse

Reverse the bits in a.

Fields

§

Cttz

Count trailing zero bits in a.

Fields

§

Ctlz

Count leading one bits in a.

Fields

§

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.

Fields

§

UaddWithOverflow

Wrapping unsigned integer addition of a and b where the result is extended by one bit which indicates whether the addition overflowed.

Fields

§

SsubWithOverflow

Wrapping signed integer subtraction of a and b where the result is extended by one bit which indicates whether the subtraction overflowed.

Fields

§

UsubWithOverflow

Wrapping unsigned integer subtraction of a and b where the result is extended by one bit which indicates whether the subtraction overflowed.

Fields

§

SmulWithOverflow

Wrapping signed integer multiplication of a and b where the result is extended by one bit which indicates whether the multiplication overflowed.

Fields

§

UmulWithOverflow

Wrapping unsigned integer multiplication of a and b where the result is extended by one bit which indicates whether the multiplication overflowed.

Fields

§

SaddSat

Signed saturating integer addition.

Fields

§

UaddSat

Unsigned saturating integer addition.

Fields

§

SsubSat

Signed saturating integer subtraction.

Fields

§

UsubSat

Unsigned saturating integer subtraction.

Fields

§

ExtractValue

Extract the bth value from a.

Fields

§

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.

Fields

Trait Implementations§

Source§

impl Clone for Instruction

Source§

fn clone(&self) -> Instruction

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Instruction

Source§

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

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

impl From<Instruction> for AssignmentRhs

Source§

fn from(i: Instruction) -> Self

Converts to this type from the input type.
Source§

impl Parse for Instruction

Source§

fn parse<'a>(parser: &mut Parser<'a>) -> Result<Self>

Parse a Self from the given buffer.
Source§

impl Peek for Instruction

Source§

fn peek<'a>(parser: &mut Parser<'a>) -> Result<bool>

Does it look like we can parse a Self from the given buffer?
Source§

impl Copy for Instruction

Auto Trait Implementations§

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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.