Enum Class OperationType
- All Implemented Interfaces:
Serializable
,Comparable<OperationType>
,Constable
IR
operation
types.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptioninteger addition, signed or unsignedbinary-AND (careful not to confuse withLOG_AND
Resulting carry from the addition of two operands with no carry-in bit.
It is recommended to avoid using this operator: ReplaceCARRY(OP1, OP2)
byLT_U(RESULT, OP1)
(orLT_U(RESULT, OP2)
)unsigned truncation (unsigned cast), used for upsizing, downsizing, or regular type casts: the EOperation carries the resulting bitsize (and optional etype)signed extension (signed cast), used for upsizing: the EOperation carries the resulting bitsize (and optional etype)signed integer division, simple: input=(N, N), output=N (remainder discarded)unsigned integer division, simple: input=(N, N), output=N (remainder discarded)[NO NOT USE] full signed integer division: input=(2N, N), output=(N, N)[NO NOT USE] full unsigned integer division: input=(2N, N), output=(N, N)IEEE-754 additionIEEE-754 divisionIEEE-754 ordered and equal comparison operation
- note that is_NaN can be emulated with FEQ:is_Nan(x) == !FEQ(x, x)
- note that is_unordered can be emulated with FEQ:is_unordered(x, y) == is_Nan(x) || is_Nan(y) == !FEQ(x, x) || !FEQ(y, y)
IEEE-754 ordered and greater-or-equal-than operationIEEE-754 ordered and greater-than operationIEEE-754 ordered and less-or-equal-than operationIEEE-754 ordered and less-than operationIEEE-754 multiplicationIEEE-754 unordered or unequal comparison operationfloating-point to floating-point upgrade or downgrade (supported FP formats: binary32, binary64, intel x87 extended double-precision 80-bit)
The details of the conversion are unspecified (examples: how the operator deals with loss of precision; what truncation mode is used).floating-point to signed integer conversion (supported FP formats: binary32, binary64, intel x87 extended double-precision 80-bit)
The details of the conversion are unspecified (examples: how the operator deals with loss of precision; what truncation mode is used).floating-point to unsigned integer conversion (supported FP formats: binary32, binary64)
The details of the conversion are unspecified (examples: how the operator deals with loss of precision; what truncation mode is used).IEEE-754 subtractionIEEE-754 is_unordered operation, i.e.Custom function, further defined inFunctionOptype
signed greater or equalunsigned greater or equalsigned greater (strict)unsigned greater (strict)signed integer to floating-point conversion (supported FP formats: binary32, binary64, intel x87 extended double-precision 80-bit)
The details of the conversion are unspecified (examples: how the operator deals with loss of precision; what truncation mode is used).signed less or equalunsigned less or equallogical-AND (careful not to confuse with binary-AND
logical equalitylogical inequalitylogical-NOT (careful not to confuse with binary-NOT
.logical-OR (careful not to confuse with binary-OR
signed less (strict)unsigned less (strict) - can be used to compute the carry resulting from a subtractionTruncated integer multiplication (signed or unsigned): input=(N, N), output=N
It is bitwise-equivalent to an unsigned truncated multiply (operatorMUL_U
) Use preferably for signed operations, as it will help with type propagation.Deprecated.non-truncated signed integer multiplication: input=(N, N), output=2Nnon-truncated unsigned integer multiplication: input=(N, N), output=2Nbinary-NOT (careful not to confuse withLOG_NOT
.binary-OR (careful not to confuse withLOG_OR
Standard parity operator: single operand, single-bit result; result is 1 if number of bits (in operand) set to 1 is even.
Cannot be translated to a simple operator, for convenience only.Power (exponentiation) operatorsigned integer modulo, simple: input=(N, N), output=N (quotient discarded)unsigned integer modulo, simple: input=(N, N), output=N (quotient discarded)Rotate left, always unsignedRotate right, always unsignedarithmetic shift right with count modulo-positive bitsize, signedlogical shift left with count modulo-positive bitsize, always unsignedlogical shift right with count modulo-positive bitsize, unsigned.integer subtraction, signed or unsignedunsigned integer to floating-point conversion (supported FP formats: binary32, binary64)
The details of the conversion are unspecified (examples: how the operator deals with loss of precision; what truncation mode is used).binary-XOR -
Method Summary
Modifier and TypeMethodDescriptionstatic OperationType
int
boolean
isAnyOf
(OperationType... operationTypes) boolean
boolean
boolean
boolean
boolean
boolean
boolean
isShift()
boolean
isValid
(int nbParameters) boolean
toString()
static OperationType
Returns the enum constant of this class with the specified name.static OperationType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ADD
integer addition, signed or unsigned -
SUB
integer subtraction, signed or unsigned -
MUL
Truncated integer multiplication (signed or unsigned): input=(N, N), output=N
It is bitwise-equivalent to an unsigned truncated multiply (operatorMUL_U
) Use preferably for signed operations, as it will help with type propagation. -
MUL_U
Deprecated.Equivalent toMUL
. Should not be used from JEB 4.12 onward. -
DIV_S
signed integer division, simple: input=(N, N), output=N (remainder discarded) -
DIV_U
unsigned integer division, simple: input=(N, N), output=N (remainder discarded) -
REM_S
signed integer modulo, simple: input=(N, N), output=N (quotient discarded) -
REM_U
unsigned integer modulo, simple: input=(N, N), output=N (quotient discarded) -
MUL2_S
non-truncated signed integer multiplication: input=(N, N), output=2N -
MUL2_U
non-truncated unsigned integer multiplication: input=(N, N), output=2N -
DIV2_S
[NO NOT USE] full signed integer division: input=(2N, N), output=(N, N) -
DIV2_U
[NO NOT USE] full unsigned integer division: input=(2N, N), output=(N, N) -
AND
binary-AND (careful not to confuse withLOG_AND
-
OR
binary-OR (careful not to confuse withLOG_OR
-
XOR
binary-XOR -
NOT
binary-NOT (careful not to confuse withLOG_NOT
. -
LOG_AND
logical-AND (careful not to confuse with binary-AND
-
LOG_OR
logical-OR (careful not to confuse with binary-OR
-
LOG_NOT
logical-NOT (careful not to confuse with binary-NOT
. In practice in C, same as binary-NOT. -
LOG_EQ
logical equality -
LOG_NEQ
logical inequality -
LT_S
signed less (strict) -
LE_S
signed less or equal -
GT_S
signed greater (strict) -
GE_S
signed greater or equal -
LT_U
unsigned less (strict) - can be used to compute the carry resulting from a subtraction -
LE_U
unsigned less or equal -
GT_U
unsigned greater (strict) -
GE_U
unsigned greater or equal -
SHL
logical shift left with count modulo-positive bitsize, always unsigned -
SHR
logical shift right with count modulo-positive bitsize, unsigned. Note: in C, also represented '>>'; unsigned or signed shift depends on the type of the variable to be shifted. -
SAR
arithmetic shift right with count modulo-positive bitsize, signed -
ROR
Rotate right, always unsigned -
ROL
Rotate left, always unsigned -
PAR
Standard parity operator: single operand, single-bit result; result is 1 if number of bits (in operand) set to 1 is even.
Cannot be translated to a simple operator, for convenience only. It will need ad-hoc translators in C. -
CAST
unsigned truncation (unsigned cast), used for upsizing, downsizing, or regular type casts: the EOperation carries the resulting bitsize (and optional etype) -
CAST_S
signed extension (signed cast), used for upsizing: the EOperation carries the resulting bitsize (and optional etype) -
CARRY
Resulting carry from the addition of two operands with no carry-in bit.
It is recommended to avoid using this operator: ReplaceCARRY(OP1, OP2)
byLT_U(RESULT, OP1)
(orLT_U(RESULT, OP2)
) -
POW
Power (exponentiation) operator -
FEQ
IEEE-754 ordered and equal comparison operation
- note that is_NaN can be emulated with FEQ:is_Nan(x) == !FEQ(x, x)
- note that is_unordered can be emulated with FEQ:is_unordered(x, y) == is_Nan(x) || is_Nan(y) == !FEQ(x, x) || !FEQ(y, y)
-
FNE
IEEE-754 unordered or unequal comparison operation -
FLT
IEEE-754 ordered and less-than operation -
FGT
IEEE-754 ordered and greater-than operation -
FLE
IEEE-754 ordered and less-or-equal-than operation -
FGE
IEEE-754 ordered and greater-or-equal-than operation -
FADD
IEEE-754 addition -
FSUB
IEEE-754 subtraction -
FMUL
IEEE-754 multiplication -
FDIV
IEEE-754 division -
FP2FP
floating-point to floating-point upgrade or downgrade (supported FP formats: binary32, binary64, intel x87 extended double-precision 80-bit)
The details of the conversion are unspecified (examples: how the operator deals with loss of precision; what truncation mode is used). -
FP2INT
floating-point to signed integer conversion (supported FP formats: binary32, binary64, intel x87 extended double-precision 80-bit)
The details of the conversion are unspecified (examples: how the operator deals with loss of precision; what truncation mode is used). -
INT2FP
signed integer to floating-point conversion (supported FP formats: binary32, binary64, intel x87 extended double-precision 80-bit)
The details of the conversion are unspecified (examples: how the operator deals with loss of precision; what truncation mode is used). -
FP2UINT
floating-point to unsigned integer conversion (supported FP formats: binary32, binary64)
The details of the conversion are unspecified (examples: how the operator deals with loss of precision; what truncation mode is used). -
UINT2FP
unsigned integer to floating-point conversion (supported FP formats: binary32, binary64)
The details of the conversion are unspecified (examples: how the operator deals with loss of precision; what truncation mode is used). -
FUN
IEEE-754 is_unordered operation, i.e. determine if either operand is NaN
note that this operator can be can be used to determine whether a value is NaN since:is_NaN(x) == is_unordered(x, x)
-
ADD_SSAT
-
ADD_USAT
-
SUB_SSAT
-
SUB_USAT
-
FUNCTION
Custom function, further defined inFunctionOptype
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getOperandCount
public int getOperandCount() -
toString
- Overrides:
toString
in classEnum<OperationType>
-
isValid
public boolean isValid(int nbParameters) -
shouldNotUse
public boolean shouldNotUse() -
isLogical
public boolean isLogical() -
isShift
public boolean isShift() -
isConversion
public boolean isConversion() -
isIntegerConversion
public boolean isIntegerConversion() -
isFloatConversion
public boolean isFloatConversion() -
isFloatOperation
public boolean isFloatOperation() -
isFloatComparison
public boolean isFloatComparison() -
fromName
-
isAnyOf
-