Enum aluvm::isa::ArithmeticOp[][src]

pub enum ArithmeticOp {
    AddA(IntFlagsRegAReg32Reg32),
    AddF(RoundingFlagRegFReg32Reg32),
    SubA(IntFlagsRegAReg32Reg32),
    SubF(RoundingFlagRegFReg32Reg32),
    MulA(IntFlagsRegAReg32Reg32),
    MulF(RoundingFlagRegFReg32Reg32),
    DivA(IntFlagsRegAReg32Reg32),
    DivF(RoundingFlagRegFReg32Reg32),
    Rem(RegAReg32RegAReg32),
    Stp(RegAReg32Step),
    Neg(RegAFReg16),
    Abs(RegAFReg16),
}
Expand description

Arithmetic instructions.

All operations modify the value of st0 register, setting it to false if the destination is set to None. Otherwise, st0 value is true, even if the overflow has occurred (when wrap flag is provided).

Variants

AddA(IntFlagsRegAReg32Reg32)

Adds values from two integer arithmetic registers and puts result into destination.

Adds values from two float arithmetic registers and puts result into destination.

SubA(IntFlagsRegAReg32Reg32)

Subtracts values from two integer arithmetic registers and puts result into destination.

Subtracts values from two float arithmetic registers and puts result into destination.

MulA(IntFlagsRegAReg32Reg32)

Multiplies values from two integer arithmetic registers and puts result into destination.

Multiplies values from two float arithmetic registers and puts result into destination.

DivA(IntFlagsRegAReg32Reg32)

Divides values from two integer arithmetic registers and puts result into destination.

Since the division operation may not result in overflow, the overflow flag is used to indicate rounding of the result:

Overflow flag is also defines behaviour for zero division (x/0 if x > 0): whether the destination must be set to 0 (true) or to None (false).

NB: Impossible arithmetic operation 0/0 always sets destination to None.

Divides values from two float arithmetic registers and puts result into destination.

Rem(RegAReg32RegAReg32)

Modulo division.

Puts a reminder of the division of source register on destination register into the destination.

Stp(RegAReg32Step)

Increment/decrement register value on a given signed step.

Sets the destination to None and st0 to false in case of overflow.

Neg(RegAFReg16)

Negates most significant bit

Abs(RegAFReg16)

Replaces the register value with its absolute value

Trait Implementations

Returns number of bytes which instruction and its argument occupies

Returns range of instruction btecodes covered by a set of operations

Returns byte representing instruction code (without its arguments)

Writes instruction arguments as bytecode, omitting instruction code byte

Reads the instruction from bytecode

If the instruction call or references any external library, returns the call site in that library. Read more

Writes the instruction as bytecode

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

ISA Extensions used by the provided instruction set. Read more

Returns computational complexity of the instruction

Executes given instruction taking all registers as input and output. Read more

ISA Extension IDs represented as a standard string (space-separated) Read more

ISA Extension IDs encoded in a standard way (space-separated) Read more

Checks whether provided ISA extension ID is supported by the current instruction set

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.