Interface BinaryOpBehavior

All Superinterfaces:
OpBehavior
All Known Implementing Classes:
OpBehaviorBoolAnd, OpBehaviorBoolOr, OpBehaviorBoolXor, OpBehaviorEqual, OpBehaviorFloatAdd, OpBehaviorFloatDiv, OpBehaviorFloatEqual, OpBehaviorFloatLess, OpBehaviorFloatLessEqual, OpBehaviorFloatMult, OpBehaviorFloatNotEqual, OpBehaviorFloatSub, OpBehaviorIntAdd, OpBehaviorIntAnd, OpBehaviorIntCarry, OpBehaviorIntDiv, OpBehaviorIntLeft, OpBehaviorIntLess, OpBehaviorIntLessEqual, OpBehaviorIntMult, OpBehaviorIntOr, OpBehaviorIntRem, OpBehaviorIntRight, OpBehaviorIntSborrow, OpBehaviorIntScarry, OpBehaviorIntSdiv, OpBehaviorIntSless, OpBehaviorIntSlessEqual, OpBehaviorIntSrem, OpBehaviorIntSright, OpBehaviorIntSub, OpBehaviorIntXor, OpBehaviorNotEqual, OpBehaviorPiece, OpBehaviorSubpiece

public interface BinaryOpBehavior extends OpBehavior
The implementation of a binary (2 input args, 1 output) p-code operator
  • Method Details

    • evaluateBinary

      long evaluateBinary(int sizeout, int sizein, long unsignedIn1, long unsignedIn2)
      Evaluate the binary operation using long data

      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.

      Parameters:
      sizeout - intended output size (bytes)
      sizein - in1 size (bytes)
      unsignedIn1 - unsigned input 1
      unsignedIn2 - unsigned input 2
      Returns:
      operation result.
      See Also:
    • evaluateBinary

      BigInteger evaluateBinary(int sizeout, int sizein, BigInteger unsignedIn1, BigInteger unsignedIn2)
      Evaluate the binary operation using BigInteger data

      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.

      Parameters:
      sizeout - intended output size (bytes)
      sizein - in1 size (bytes)
      unsignedIn1 - unsigned input 1
      unsignedIn2 - unsigned input 2
      Returns:
      operation result.
      See Also: