|
| TypeOp (TypeFactory *t, OpCode opc, const string &n) |
| Constructor. More...
|
|
virtual | ~TypeOp (void) |
| Destructor.
|
|
const string & | getName (void) const |
| Get the display name of the op-code.
|
|
OpCode | getOpcode (void) const |
| Get the op-code value.
|
|
uint4 | getFlags (void) const |
| Get the properties associated with the op-code.
|
|
OpBehavior * | getBehavior (void) const |
| Get the behavior associated with the op-code.
|
|
bool | markExplicitUnsigned (PcodeOp *op, int4 slot) const |
| Check if a constant input should be explicitly labeled as unsigned. More...
|
|
uintb | evaluateUnary (int4 sizeout, int4 sizein, uintb in1) const |
| Emulate the unary op-code on an input value. More...
|
|
uintb | evaluateBinary (int4 sizeout, int4 sizein, uintb in1, uintb in2) const |
| Emulate the binary op-code on an input value. More...
|
|
uintb | recoverInputBinary (int4 slot, int4 sizeout, uintb out, int4 sizein, uintb in) const |
| Reverse the binary op-code operation, recovering a constant input value. More...
|
|
uintb | recoverInputUnary (int4 sizeout, uintb out, int4 sizein) const |
| Reverse the unary op-code operation, recovering a constant input value. More...
|
|
bool | isCommutative (void) const |
| Return true if this op-code is commutative. More...
|
|
bool | inheritsSign (void) const |
| Return true if the op-code inherits it signedness from its inputs.
|
|
virtual Datatype * | getOutputLocal (const PcodeOp *op) const |
| Find the minimal (or suggested) data-type of an output to this op-code. More...
|
|
virtual Datatype * | getInputLocal (const PcodeOp *op, int4 slot) const |
| Find the minimal (or suggested) data-type of an input to this op-code. More...
|
|
virtual Datatype * | getOutputToken (const PcodeOp *op, CastStrategy *castStrategy) const |
| Find the data-type of the output that would be assigned by a compiler. More...
|
|
virtual Datatype * | getInputCast (const PcodeOp *op, int4 slot, const CastStrategy *castStrategy) const |
| Find the data-type of the input to a specific PcodeOp. More...
|
|
virtual void | push (PrintLanguage *lng, const PcodeOp *op, const PcodeOp *readOp) const =0 |
| Push the specific PcodeOp to the emitter's RPN stack. More...
|
|
virtual void | printRaw (ostream &s, const PcodeOp *op)=0 |
| Print (for debugging purposes) this specific PcodeOp to the stream. More...
|
|
virtual string | getOperatorName (const PcodeOp *op) const |
| Get the name of the op-code as it should be displayed in context. More...
|
|
Associate data-type and behavior information with a specific p-code op-code.
This holds all information about a p-code op-code. The main PcodeOp object holds this as a representative of the op-code. The evaluate* methods can be used to let the op-code act on constant input values. The getOutput* and getInput* methods are used to obtain data-type information that is specific to the op-code. This also holds other PcodeOp boolean properties that are set in common for the op-code.
Find the data-type of the input to a specific PcodeOp.
Calculate the actual data-type of the input to the specific PcodeOp. A null result indicates the input data-type is the same as or otherwise doesn't need a cast from the data-type of the actual input Varnode
- Parameters
-
op | is the specific PcodeOp |
slot | is the input to consider |
castStrategy | is the current casting strategy |
- Returns
- the data-type
Reimplemented in TypeOpNew, TypeOpCpoolref, TypeOpSegment, TypeOpPtrsub, TypeOpPtradd, TypeOpIntSrem, TypeOpIntRem, TypeOpIntSdiv, TypeOpIntDiv, TypeOpIntSright, TypeOpIntRight, TypeOpIntSext, TypeOpIntZext, TypeOpIntLessEqual, TypeOpIntLess, TypeOpIntSlessEqual, TypeOpIntSless, TypeOpNotEqual, TypeOpEqual, TypeOpStore, TypeOpLoad, and TypeOpCopy.
Find the minimal (or suggested) data-type of an input to this op-code.
The result should depend only on the op-code itself (and the size of the input)
- Parameters
-
op | is the PcodeOp being considered |
slot | is the input being considered |
- Returns
- the data-type
Reimplemented in TypeOpExtract, TypeOpInsert, TypeOpCpoolref, TypeOpPtrsub, TypeOpPtradd, TypeOpIndirect, TypeOpIntSright, TypeOpIntRight, TypeOpIntLeft, TypeOpReturn, TypeOpCallother, TypeOpCallind, TypeOpCall, TypeOpCbranch, TypeOpFunc, TypeOpUnary, and TypeOpBinary.
Find the data-type of the output that would be assigned by a compiler.
Calculate the actual data-type of the output for a specific PcodeOp as would be assigned by a C compiler parsing a grammar containing this op.
- Parameters
-
op | is the specific PcodeOp |
castStrategy | is the current casting strategy |
- Returns
- the data-type
Reimplemented in TypeOpSegment, TypeOpPtrsub, TypeOpPtradd, TypeOpSubpiece, TypeOpPiece, TypeOpIntMult, TypeOpIntSright, TypeOpIntRight, TypeOpIntLeft, TypeOpIntOr, TypeOpIntAnd, TypeOpIntXor, TypeOpIntNegate, TypeOpInt2Comp, TypeOpIntSub, TypeOpIntAdd, TypeOpLoad, and TypeOpCopy.
Push the specific PcodeOp to the emitter's RPN stack.
Given a specific language and PcodeOp, emit the expression rooted at the operation.
- Parameters
-
Implemented in TypeOpPopcount, TypeOpExtract, TypeOpInsert, TypeOpNew, TypeOpCpoolref, TypeOpSegment, TypeOpPtrsub, TypeOpPtradd, TypeOpCast, TypeOpSubpiece, TypeOpPiece, TypeOpIndirect, TypeOpMulti, TypeOpFloatRound, TypeOpFloatFloor, TypeOpFloatCeil, TypeOpFloatTrunc, TypeOpFloatFloat2Float, TypeOpFloatInt2Float, TypeOpFloatSqrt, TypeOpFloatAbs, TypeOpFloatNeg, TypeOpFloatSub, TypeOpFloatMult, TypeOpFloatDiv, TypeOpFloatAdd, TypeOpFloatNan, TypeOpFloatLessEqual, TypeOpFloatLess, TypeOpFloatNotEqual, TypeOpFloatEqual, TypeOpBoolOr, TypeOpBoolAnd, TypeOpBoolXor, TypeOpBoolNegate, TypeOpIntSrem, TypeOpIntRem, TypeOpIntSdiv, TypeOpIntDiv, TypeOpIntMult, TypeOpIntSright, TypeOpIntRight, TypeOpIntLeft, TypeOpIntOr, TypeOpIntAnd, TypeOpIntXor, TypeOpIntNegate, TypeOpInt2Comp, TypeOpIntSborrow, TypeOpIntScarry, TypeOpIntCarry, TypeOpIntSub, TypeOpIntAdd, TypeOpIntSext, TypeOpIntZext, TypeOpIntLessEqual, TypeOpIntLess, TypeOpIntSlessEqual, TypeOpIntSless, TypeOpNotEqual, TypeOpEqual, TypeOpReturn, TypeOpCallother, TypeOpCallind, TypeOpCall, TypeOpBranchind, TypeOpCbranch, TypeOpBranch, TypeOpStore, TypeOpLoad, and TypeOpCopy.