Enum Class OperationType

java.lang.Object
java.lang.Enum<OperationType>
com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.OperationType
All Implemented Interfaces:
Serializable, Comparable<OperationType>, Constable

@Ser public enum OperationType extends Enum<OperationType>
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 Constants
    Enum Constant
    Description
    integer addition, signed or unsigned
     
     
    binary-AND (careful not to confuse with LOG_AND
    Resulting carry from the addition of two operands with no carry-in bit.
    It is recommended to avoid using this operator: Replace CARRY(OP1, OP2) by LT_U(RESULT, OP1) (or LT_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 addition
    IEEE-754 division
    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)
    IEEE-754 ordered and greater-or-equal-than operation
    IEEE-754 ordered and greater-than operation
    IEEE-754 ordered and less-or-equal-than operation
    IEEE-754 ordered and less-than operation
    IEEE-754 multiplication
    IEEE-754 unordered or unequal comparison operation
    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).
    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 subtraction
    IEEE-754 is_unordered operation, i.e.
    Custom function, further defined in FunctionOptype
    signed greater or equal
    unsigned greater or equal
    signed 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 equal
    unsigned less or equal
    logical-AND (careful not to confuse with binary-AND
    logical equality
    logical inequality
    logical-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 subtraction
    Truncated integer multiplication (signed or unsigned): input=(N, N), output=N
    It is bitwise-equivalent to an unsigned truncated multiply (operator MUL_U) Use preferably for signed operations, as it will help with type propagation.
    Deprecated.
    non-truncated signed integer multiplication: input=(N, N), output=2N
    non-truncated unsigned integer multiplication: input=(N, N), output=2N
    binary-NOT (careful not to confuse with LOG_NOT.
    binary-OR (careful not to confuse with LOG_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) operator
    signed integer modulo, simple: input=(N, N), output=N (quotient discarded)
    unsigned integer modulo, simple: input=(N, N), output=N (quotient discarded)
    Rotate left, always unsigned
    Rotate right, always unsigned
    arithmetic shift right with count modulo-positive bitsize, signed
    logical shift left with count modulo-positive bitsize, always unsigned
    logical shift right with count modulo-positive bitsize, unsigned.
    integer subtraction, signed or unsigned
     
     
    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).
    binary-XOR
  • Method Summary

    Modifier and Type
    Method
    Description
     
    int
     
    boolean
    isAnyOf(OperationType... operationTypes)
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
    isValid(int nbParameters)
     
    boolean
     
     
    Returns the enum constant of this class with the specified name.
    static OperationType[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • ADD

      public static final OperationType ADD
      integer addition, signed or unsigned
    • SUB

      public static final OperationType SUB
      integer subtraction, signed or unsigned
    • MUL

      public static final OperationType MUL
      Truncated integer multiplication (signed or unsigned): input=(N, N), output=N
      It is bitwise-equivalent to an unsigned truncated multiply (operator MUL_U) Use preferably for signed operations, as it will help with type propagation.
    • MUL_U

      @Deprecated public static final OperationType MUL_U
      Deprecated.
      Equivalent to MUL. Should not be used from JEB 4.12 onward.
    • DIV_S

      public static final OperationType DIV_S
      signed integer division, simple: input=(N, N), output=N (remainder discarded)
    • DIV_U

      public static final OperationType DIV_U
      unsigned integer division, simple: input=(N, N), output=N (remainder discarded)
    • REM_S

      public static final OperationType REM_S
      signed integer modulo, simple: input=(N, N), output=N (quotient discarded)
    • REM_U

      public static final OperationType REM_U
      unsigned integer modulo, simple: input=(N, N), output=N (quotient discarded)
    • MUL2_S

      public static final OperationType MUL2_S
      non-truncated signed integer multiplication: input=(N, N), output=2N
    • MUL2_U

      public static final OperationType MUL2_U
      non-truncated unsigned integer multiplication: input=(N, N), output=2N
    • DIV2_S

      public static final OperationType DIV2_S
      [NO NOT USE] full signed integer division: input=(2N, N), output=(N, N)
    • DIV2_U

      public static final OperationType DIV2_U
      [NO NOT USE] full unsigned integer division: input=(2N, N), output=(N, N)
    • AND

      public static final OperationType AND
      binary-AND (careful not to confuse with LOG_AND
    • OR

      public static final OperationType OR
      binary-OR (careful not to confuse with LOG_OR
    • XOR

      public static final OperationType XOR
      binary-XOR
    • NOT

      public static final OperationType NOT
      binary-NOT (careful not to confuse with LOG_NOT.
    • LOG_AND

      public static final OperationType LOG_AND
      logical-AND (careful not to confuse with binary-AND
    • LOG_OR

      public static final OperationType LOG_OR
      logical-OR (careful not to confuse with binary-OR
    • LOG_NOT

      public static final OperationType LOG_NOT
      logical-NOT (careful not to confuse with binary-NOT. In practice in C, same as binary-NOT.
    • LOG_EQ

      public static final OperationType LOG_EQ
      logical equality
    • LOG_NEQ

      public static final OperationType LOG_NEQ
      logical inequality
    • LT_S

      public static final OperationType LT_S
      signed less (strict)
    • LE_S

      public static final OperationType LE_S
      signed less or equal
    • GT_S

      public static final OperationType GT_S
      signed greater (strict)
    • GE_S

      public static final OperationType GE_S
      signed greater or equal
    • LT_U

      public static final OperationType LT_U
      unsigned less (strict) - can be used to compute the carry resulting from a subtraction
    • LE_U

      public static final OperationType LE_U
      unsigned less or equal
    • GT_U

      public static final OperationType GT_U
      unsigned greater (strict)
    • GE_U

      public static final OperationType GE_U
      unsigned greater or equal
    • SHL

      public static final OperationType SHL
      logical shift left with count modulo-positive bitsize, always unsigned
    • SHR

      public static final OperationType 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

      public static final OperationType SAR
      arithmetic shift right with count modulo-positive bitsize, signed
    • ROR

      public static final OperationType ROR
      Rotate right, always unsigned
    • ROL

      public static final OperationType ROL
      Rotate left, always unsigned
    • PAR

      public static final OperationType 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

      public static final OperationType CAST
      unsigned truncation (unsigned cast), used for upsizing, downsizing, or regular type casts: the EOperation carries the resulting bitsize (and optional etype)
    • CAST_S

      public static final OperationType CAST_S
      signed extension (signed cast), used for upsizing: the EOperation carries the resulting bitsize (and optional etype)
    • CARRY

      public static final OperationType CARRY
      Resulting carry from the addition of two operands with no carry-in bit.
      It is recommended to avoid using this operator: Replace CARRY(OP1, OP2) by LT_U(RESULT, OP1) (or LT_U(RESULT, OP2))
    • POW

      public static final OperationType POW
      Power (exponentiation) operator
    • FEQ

      public static final OperationType 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

      public static final OperationType FNE
      IEEE-754 unordered or unequal comparison operation
    • FLT

      public static final OperationType FLT
      IEEE-754 ordered and less-than operation
    • FGT

      public static final OperationType FGT
      IEEE-754 ordered and greater-than operation
    • FLE

      public static final OperationType FLE
      IEEE-754 ordered and less-or-equal-than operation
    • FGE

      public static final OperationType FGE
      IEEE-754 ordered and greater-or-equal-than operation
    • FADD

      public static final OperationType FADD
      IEEE-754 addition
    • FSUB

      public static final OperationType FSUB
      IEEE-754 subtraction
    • FMUL

      public static final OperationType FMUL
      IEEE-754 multiplication
    • FDIV

      public static final OperationType FDIV
      IEEE-754 division
    • FP2FP

      public static final OperationType 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

      public static final OperationType 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

      public static final OperationType 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

      public static final OperationType 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

      public static final OperationType 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

      public static final OperationType 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

      public static final OperationType ADD_SSAT
    • ADD_USAT

      public static final OperationType ADD_USAT
    • SUB_SSAT

      public static final OperationType SUB_SSAT
    • SUB_USAT

      public static final OperationType SUB_USAT
    • FUNCTION

      public static final OperationType FUNCTION
      Custom function, further defined in FunctionOptype
  • Method Details

    • values

      public static OperationType[] 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

      public static OperationType valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getOperandCount

      public int getOperandCount()
    • toString

      public String toString()
      Overrides:
      toString in class Enum<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

      public static OperationType fromName(String name)
    • isAnyOf

      public boolean isAnyOf(OperationType... operationTypes)