2.5.13. Integer¶
TODO.
2.5.13.1. Instruction¶
-
target =decrop1[integer::Decr]¶ Target: int<*> Operator 1: int<*> Decrements op1 by one.
-
target =decr_byop1 op2[integer::DecrBy]¶ Target: int<*> Operator 1: int<*> Operator 2: int<*> Decreases op1 by op2.
-
target =int.addop1 op2[integer::Add]¶ Target: int<*> Operator 1: int<*> Operator 2: int<*> Calculates the sum of the two operands. Operands and target must be of same width. The result is calculated modulo 2^{width}.
-
target =int.andop1 op2[integer::And]¶ Target: int<*> Operator 1: int<*> Operator 2: int<*> Calculates the binary and of the two operands. Operands and target must be of same width.
-
target =int.as_intervalop1[integer::AsInterval]¶ Target: interval Operator 1: int<*> Converts the integer op1 into an interval value, interpreting it as seconds.
-
target =int.as_sdoubleop1[integer::AsSDouble]¶ Target: double Operator 1: int<*> Converts the signed integer op1 into a double value.
-
target =int.as_timeop1[integer::AsTime]¶ Target: time Operator 1: int<*> Converts the integer op1 into a time value, interpreting it as seconds since the epoch.
-
target =int.as_udoubleop1[integer::AsUDouble]¶ Target: double Operator 1: int<*> Converts the unsigned integer op1 into a double value.
-
target =int.ashrop1 op2[integer::Ashr]¶ Target: int<*> Operator 1: int<*> Operator 2: int<*> Arithmetically shifts op1 to the right by op2 bits. The most- signficant bits are filled with the sign of op1. If the value of op2 is larger than the integer type has bits, the result is undefined.
-
target =int.divop1 op2[integer::Div]¶ Target: int<*> Operator 1: int<*> Operator 2: int<*> Divides op1 by op2, flooring the result. Operands and target must be of same width. All integers are treaded as signed. If the product overflows the range of the integer type, the result in undefined. Throws
DivisionByZeroif op2 is zero.
-
target =int.eqop1 op2[integer::Eq]¶ Target: bool Operator 1: int<*> Operator 2: int<*> Returns true iff op1 equals op2.
-
target =int.flipop1[integer::Flip]¶ Target: int<*> Operator 1: int<*> Reverses the bytes of op1.
-
target =int.from_hostop1 op2[integer::FromHost]¶ Target: int<*> Operator 1: int<*> Operator 2: enum { } Converts op1 from host byte order to byte order op2.
-
target =int.maskop1 op2 op3[integer::Mask]¶ Target: int<*> Operator 1: int<*> Operator 2: int<*> Operator 3: int<*> Extracts the bit range from op2 to op3 (inclusive) from op1 and shifts them so that they align with the least significant bit in the result.
-
target =int.modop1 op2[integer::Mod]¶ Target: int<*> Operator 1: int<*> Operator 2: int<*> Calculates the remainder of dividing op1 by op2. Operands and target must be of same width. Throws
DivisionByZeroif op2 is zero.
-
target =int.mulop1 op2[integer::Mul]¶ Target: int<*> Operator 1: int<*> Operator 2: int<*> Multiplies op1 with op2. Operands and target must be of same width. The result is calculated modulo 2^{width}.
-
target =int.orop1 op2[integer::Or]¶ Target: int<*> Operator 1: int<*> Operator 2: int<*> Calculates the binary or of the two operands. Operands and target must be of same width.
-
target =int.powop1 op2[integer::Pow]¶ Target: int<*> Operator 1: int<*> Operator 2: int<*> Raise op1 to the power op2. Note that both op1 and op2 are interpreted as unsigned integers. If the result overflows the target’s type, the result is undefined.
-
target =int.sextop1[integer::SExt]¶ Target: int<*> Operator 1: int<*> Sign-extends op1 into an integer of the same width as the target. The width of op1 must be smaller or equal that of the target.
-
target =int.sgeqop1 op2[integer::Sgeq]¶ Target: bool Operator 1: int<*> Operator 2: int<*> Returns true iff op1 is greater or equal op2, interpreting both as signed integers.
-
target =int.sgtop1 op2[integer::Sgt]¶ Target: bool Operator 1: int<*> Operator 2: int<*> Returns true iff op1 is greater than op2, interpreting both as signed integers.
-
target =int.shlop1 op2[integer::Shl]¶ Target: int<*> Operator 1: int<*> Operator 2: int<*> Shifts op1 to the left by op2 bits. The least-signficant bits are filled with zeros. If the value of op2 is larger than the integer type has bits, the result is undefined.
-
target =int.shrop1 op2[integer::Shr]¶ Target: int<*> Operator 1: int<*> Operator 2: int<*> Shifts op1 to the right by op2 bits. The most-signficant bits are filled with zeros. If the value of op2 is larger than the integer type has bits, the result is undefined.
-
target =int.sleqop1 op2[integer::Sleq]¶ Target: bool Operator 1: int<*> Operator 2: int<*> Returns true iff op1 is lower or equal op2, interpreting both as signed integers.
-
target =int.sltop1 op2[integer::Slt]¶ Target: bool Operator 1: int<*> Operator 2: int<*> Returns true iff op1 is less than op2, interpreting both as signed integers.
-
target =int.subop1 op2[integer::Sub]¶ Target: int<*> Operator 1: int<*> Operator 2: int<*> Subtracts op2 from op1. Operands and target must be of same width. The result is calculated modulo 2^{width}.
-
target =int.to_hostop1 op2[integer::ToHost]¶ Target: int<*> Operator 1: int<*> Operator 2: enum { } Converts op1 from byte order op2 into host byte order.
-
target =int.truncop1[integer::Trunc]¶ Target: int<*> Operator 1: int<*> Bit-truncates op1 into an integer of the same width as the target. The width of op1 must be larger or equal that of the target.
-
target =int.ugeqop1 op2[integer::Ugeq]¶ Target: bool Operator 1: int<*> Operator 2: int<*> Returns true iff op1 is greater or equal op2, interpreting both as unsigned integers.
-
target =int.ugtop1 op2[integer::Ugt]¶ Target: bool Operator 1: int<*> Operator 2: int<*> Returns true iff op1 is greater than op2, interpreting both as unsigned integers.
-
target =int.uleqop1 op2[integer::Uleq]¶ Target: bool Operator 1: int<*> Operator 2: int<*> Returns true iff op1 is lower or equal op2, interpreting both as unsigned integers.
-
target =int.ultop1 op2[integer::Ult]¶ Target: bool Operator 1: int<*> Operator 2: int<*> Returns true iff op1 is less than op2, interpreting both as unsigned integers.
-
target =int.xorop1 op2[integer::Xor]¶ Target: int<*> Operator 1: int<*> Operator 2: int<*> Calculates the binary xor of the two operands. Operands and target must be of same width.
-
target =int.zextop1[integer::ZExt]¶ Target: int<*> Operator 1: int<*> Zero-extends op1 into an integer of the same width as the target. The width of op1 must be smaller or equal that of the target.