Package ghidra.pcode.opbehavior

# Class UnaryOpBehavior

java.lang.Object
ghidra.pcode.opbehavior.OpBehavior
ghidra.pcode.opbehavior.UnaryOpBehavior

Direct Known Subclasses:
  `OpBehaviorBoolNegate`, `OpBehaviorCopy`, `OpBehaviorFloatAbs`, `OpBehaviorFloatCeil`, `OpBehaviorFloatFloat2Float`, `OpBehaviorFloatFloor`, `OpBehaviorFloatInt2Float`, `OpBehaviorFloatNan`, `OpBehaviorFloatNeg`, `OpBehaviorFloatRound`, `OpBehaviorFloatSqrt`, `OpBehaviorFloatTrunc`, `OpBehaviorInt2Comp`, `OpBehaviorIntNegate`, `OpBehaviorIntSext`, `OpBehaviorIntZext`, `OpBehaviorLzcount`, `OpBehaviorPopcount`

public abstract class UnaryOpBehavior extends OpBehavior

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract long`
  `evaluateUnary(int sizeout, int sizein, long unsignedIn1)`
  Evaluate the unary operation using long data
  `abstract BigInteger`
  `evaluateUnary(int sizeout, int sizein, BigInteger unsignedIn1)`
  Evaluate the unary operation using BigInteger data

  ### Methods inherited from class ghidra.pcode.opbehavior.OpBehavior

  `getOpCode`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### evaluateUnary

    public abstract long evaluateUnary(int sizeout, int sizein, long unsignedIn1)
    Evaluate the unary operation using long data
    Parameters:
      `sizeout` - intended output size (bytes)
      `sizein` - in1 size (bytes)
      `unsignedIn1` - unsigned input 1
    Returns:
      operation result. NOTE: if the operation overflows bits may be set beyond the specified sizeout. Even though results should be treated as unsigned it may be returned as a signed long value. It is expected that the returned result always be properly truncated by the caller since the evaluation may not - this is done to conserve emulation cycles.
    See Also:
      - `Utils.longToBytes(long, int, boolean)`
      - `Utils.bytesToLong(byte[], int, boolean)`

  - ### evaluateUnary

    public abstract BigInteger evaluateUnary(int sizeout, int sizein, BigInteger unsignedIn1)
    Evaluate the unary operation using BigInteger data
    Parameters:
      `sizeout` - intended output size (bytes)
      `sizein` - in1 size (bytes)
      `unsignedIn1` - unsigned input 1
    Returns:
      operation result. NOTE: if the operation overflows bits may be set beyond the specified sizeout. Even though results should be treated as unsigned it may be returned as a signed value. It is expected that the returned result always be properly truncated by the caller since the evaluation may not - this is done to conserve emulation cycles.
    See Also:
      - `Utils.bigIntegerToBytes(BigInteger, int, boolean)`
      - `Utils.bytesToBigInteger(byte[], int, boolean, boolean)`