Skip to main content

SsaOp

Enum SsaOp 

Source
pub enum SsaOp {
Show 48 variants Output(u32, u32), Input(u32, u32), CopyReg(u32, u32), CopyImm(u32, f32), NegReg(u32, u32), AbsReg(u32, u32), RecipReg(u32, u32), SqrtReg(u32, u32), SquareReg(u32, u32), FloorReg(u32, u32), CeilReg(u32, u32), RoundReg(u32, u32), SinReg(u32, u32), CosReg(u32, u32), TanReg(u32, u32), AsinReg(u32, u32), AcosReg(u32, u32), AtanReg(u32, u32), ExpReg(u32, u32), LnReg(u32, u32), NotReg(u32, u32), AddRegImm(u32, u32, f32), MulRegImm(u32, u32, f32), DivRegImm(u32, u32, f32), DivImmReg(u32, u32, f32), SubImmReg(u32, u32, f32), SubRegImm(u32, u32, f32), ModRegReg(u32, u32, u32), ModRegImm(u32, u32, f32), AtanRegImm(u32, u32, f32), CompareRegImm(u32, u32, f32), MinRegImm(u32, u32, f32), MaxRegImm(u32, u32, f32), AndRegImm(u32, u32, f32), OrRegImm(u32, u32, f32), ModImmReg(u32, u32, f32), AtanImmReg(u32, u32, f32), CompareImmReg(u32, u32, f32), AddRegReg(u32, u32, u32), MulRegReg(u32, u32, u32), DivRegReg(u32, u32, u32), SubRegReg(u32, u32, u32), CompareRegReg(u32, u32, u32), AtanRegReg(u32, u32, u32), MinRegReg(u32, u32, u32), MaxRegReg(u32, u32, u32), AndRegReg(u32, u32, u32), OrRegReg(u32, u32, u32),
}
Expand description

Basic operations that can be performed in a tape

Arguments, in order, are

  • Output register
  • LHS register (or input slot for Input)
  • RHS register (or immediate for *Imm)

Each “register” represents an SSA slot, which is never reused.

Variants§

§

Output(u32, u32)

Writes an output variable by index

§

Input(u32, u32)

Read an input variable by index

§

CopyReg(u32, u32)

Copies the given register

§

CopyImm(u32, f32)

Copy an immediate to a register

§

NegReg(u32, u32)

Negate the given register

§

AbsReg(u32, u32)

Take the absolute value of the given register

§

RecipReg(u32, u32)

Take the reciprocal of the given register (1.0 / value)

§

SqrtReg(u32, u32)

Take the square root of the given register

§

SquareReg(u32, u32)

Square the given register

§

FloorReg(u32, u32)

Returns the largest integer less than or equal to self

§

CeilReg(u32, u32)

Returns the smallest integer greater than or equal to self

§

RoundReg(u32, u32)

Returns the nearest integer to self. If a value is half-way between two integers, round away from 0.0.

§

SinReg(u32, u32)

Computes the sine of the given register (in radians)

§

CosReg(u32, u32)

Computes the cosine of the given register (in radians)

§

TanReg(u32, u32)

Computes the tangent of the given register (in radians)

§

AsinReg(u32, u32)

Computes the arcsin of the given register (in radians)

§

AcosReg(u32, u32)

Computes the arccos of the given register (in radians)

§

AtanReg(u32, u32)

Computes the arctangent of the given register (in radians)

§

ExpReg(u32, u32)

Computes the exponential function of the given register

§

LnReg(u32, u32)

Computes the natural log of the given register

§

NotReg(u32, u32)

Computes the logical negation of the given register

Equivalent to if arg == 0 { 1 } else { 0 }

§

AddRegImm(u32, u32, f32)

Add a register and an immediate

§

MulRegImm(u32, u32, f32)

Multiply a register and an immediate

§

DivRegImm(u32, u32, f32)

Divides a register and an immediate

§

DivImmReg(u32, u32, f32)

Divides an immediate by a register

§

SubImmReg(u32, u32, f32)

Subtract a register from an immediate

§

SubRegImm(u32, u32, f32)

Subtract an immediate from a register

§

ModRegReg(u32, u32, u32)

Take the module (least nonnegative remainder) of two registers

§

ModRegImm(u32, u32, f32)

Take the module (least nonnegative remainder) of a register and an immediate

§

AtanRegImm(u32, u32, f32)

atan2 of a position (y, x) specified as register, immediate

§

CompareRegImm(u32, u32, f32)

Compares a register with an immediate

§

MinRegImm(u32, u32, f32)

Compute the minimum of a register and an immediate

§

MaxRegImm(u32, u32, f32)

Compute the maximum of a register and an immediate

§

AndRegImm(u32, u32, f32)

Logical AND (short-circuiting)

This is equivalent to if lhs == 0 { lhs } else { imm }

§

OrRegImm(u32, u32, f32)

Logical OR (short-circuiting)

This is equivalent to if lhs != 0 { lhs } else { imm }

§

ModImmReg(u32, u32, f32)

Take the module (least nonnegative remainder) of an immediate and a register

§

AtanImmReg(u32, u32, f32)

atan2 of a position (y, x) specified as immediate, register

§

CompareImmReg(u32, u32, f32)

Compares an immediate with a register

§

AddRegReg(u32, u32, u32)

Add two registers

§

MulRegReg(u32, u32, u32)

Multiply two registers

§

DivRegReg(u32, u32, u32)

Divides two registers

§

SubRegReg(u32, u32, u32)

Subtract one register from another

§

CompareRegReg(u32, u32, u32)

Compares two registers

§

AtanRegReg(u32, u32, u32)

atan2 of a position (y, x) specified as register, register

§

MinRegReg(u32, u32, u32)

Take the minimum of two registers

§

MaxRegReg(u32, u32, u32)

Take the maximum of two registers

§

AndRegReg(u32, u32, u32)

Logical AND (short-circuiting)

This is equivalent to if lhs == 0 { lhs } else { rhs }

§

OrRegReg(u32, u32, u32)

Logical OR (short-circuiting)

This is equivalent to if lhs != 0 { lhs } else { rhs }

Implementations§

Source§

impl SsaOp

Source

pub fn output(&self) -> Option<u32>

Returns the output pseudo-register

Source

pub fn has_choice(&self) -> bool

Returns true if the given opcode is associated with a choice

Trait Implementations§

Source§

impl Clone for SsaOp

Source§

fn clone(&self) -> SsaOp

Returns a duplicate 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 SsaOp

Source§

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

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

impl<'de> Deserialize<'de> for SsaOp

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for SsaOp

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for SsaOp

Auto Trait Implementations§

§

impl Freeze for SsaOp

§

impl RefUnwindSafe for SsaOp

§

impl Send for SsaOp

§

impl Sync for SsaOp

§

impl Unpin for SsaOp

§

impl UnsafeUnpin for SsaOp

§

impl UnwindSafe for SsaOp

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,