Enum aluvm::isa::ArithmeticOp [−][src]
pub enum ArithmeticOp { AddA(IntFlags, RegA, Reg32, Reg32), AddF(RoundingFlag, RegF, Reg32, Reg32), SubA(IntFlags, RegA, Reg32, Reg32), SubF(RoundingFlag, RegF, Reg32, Reg32), MulA(IntFlags, RegA, Reg32, Reg32), MulF(RoundingFlag, RegF, Reg32, Reg32), DivA(IntFlags, RegA, Reg32, Reg32), DivF(RoundingFlag, RegF, Reg32, Reg32), Rem(RegA, Reg32, RegA, Reg32), Stp(RegA, Reg32, Step), Neg(RegAF, Reg16), Abs(RegAF, Reg16), }
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
Adds values from two integer arithmetic registers and puts result into destination.
AddF(RoundingFlag, RegF, Reg32, Reg32)
Adds values from two float arithmetic registers and puts result into destination.
Subtracts values from two integer arithmetic registers and puts result into destination.
SubF(RoundingFlag, RegF, Reg32, Reg32)
Subtracts values from two float arithmetic registers and puts result into destination.
Multiplies values from two integer arithmetic registers and puts result into destination.
MulF(RoundingFlag, RegF, Reg32, Reg32)
Multiplies values from two float arithmetic registers and puts result into destination.
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
.
DivF(RoundingFlag, RegF, Reg32, Reg32)
Divides values from two float arithmetic registers and puts result into destination.
Modulo division.
Puts a reminder of the division of source register on destination register into the destination.
Increment/decrement register value on a given signed step.
Sets the destination to None
and st0
to false
in case of overflow.
Negates most significant bit
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
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
impl RefUnwindSafe for ArithmeticOp
impl Send for ArithmeticOp
impl Sync for ArithmeticOp
impl Unpin for ArithmeticOp
impl UnwindSafe for ArithmeticOp
Blanket Implementations
Mutably borrows from an owned value. Read more