Skip to main content

Fold

Struct Fold 

Source
pub struct Fold {
    pub from: &'static str,
    pub into: &'static str,
    pub load: &'static str,
    pub swapped: Option<&'static str>,
}
Expand description

One arithmetic instruction that could read its second source out of memory, and the load that would fill it.

A table rather than a rule about spellings, because the three names in each row are three things the target describes on their own and nothing about add_rr_64 says that mov_rm_64 is the load of the same width. Writing the three together is what makes a mismatched width a line somebody can see rather than a string that was built at run time.

Fields§

§from: &'static str

The arithmetic as the selector wrote it, reading both its sources from registers.

§into: &'static str

The same arithmetic reading its second source out of memory.

§load: &'static str

The load that would have filled that register, which has to be of the same width.

§swapped: Option<&'static str>

The same arithmetic reading its first source out of memory, where there is one.

None where the two sources may not be swapped at all, which is subtraction: the instruction that reads memory reads it as the right hand side and there is no encoding that puts it on the left, so a load feeding the left hand side stays where it is.

The same name as into for an operation that commutes, since writing the two sources in either order computes the same answer and one instruction covers both.

A different name for a comparison, which is the reason this is a name rather than a flag. A comparison does not commute and is still foldable on either side: reading the two sides the other way round asks the same question backwards, so the condition turns over with them and a < b with the load on the left is b > a.

Trait Implementations§

Source§

impl Clone for Fold

Source§

fn clone(&self) -> Fold

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 Copy for Fold

Source§

impl Debug for Fold

Source§

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

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

impl Eq for Fold

Source§

impl PartialEq for Fold

Source§

fn eq(&self, other: &Fold) -> 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 Fold

Auto Trait Implementations§

§

impl Freeze for Fold

§

impl RefUnwindSafe for Fold

§

impl Send for Fold

§

impl Sync for Fold

§

impl Unpin for Fold

§

impl UnsafeUnpin for Fold

§

impl UnwindSafe for Fold

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.