decompiler  1.0.0
Public Member Functions | List of all members
ghidra::TypeOpIntRight Class Reference

Information about the INT_RIGHT op-code. More...

#include <typeop.hh>

Inheritance diagram for ghidra::TypeOpIntRight:
ghidra::TypeOpBinary ghidra::TypeOp

Public Member Functions

 TypeOpIntRight (TypeFactory *t)
 Constructor.
 
virtual void push (PrintLanguage *lng, const PcodeOp *op, const PcodeOp *readOp) const
 Push the specific PcodeOp to the emitter's RPN stack. More...
 
virtual DatatypegetInputCast (const PcodeOp *op, int4 slot, const CastStrategy *castStrategy) const
 Find the data-type of the input to a specific PcodeOp. More...
 
virtual DatatypegetInputLocal (const PcodeOp *op, int4 slot) const
 Find the minimal (or suggested) data-type of an input to this op-code. More...
 
virtual DatatypegetOutputToken (const PcodeOp *op, CastStrategy *castStrategy) const
 Find the data-type of the output that would be assigned by a compiler. More...
 
- Public Member Functions inherited from ghidra::TypeOpBinary
 TypeOpBinary (TypeFactory *t, OpCode opc, const string &n, type_metatype mout, type_metatype min)
 Constructor.
 
virtual DatatypegetOutputLocal (const PcodeOp *op) const
 Find the minimal (or suggested) data-type of an output to this op-code. More...
 
virtual void printRaw (ostream &s, const PcodeOp *op)
 Print (for debugging purposes) this specific PcodeOp to the stream. More...
 
- Public Member Functions inherited from ghidra::TypeOp
 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.
 
OpBehaviorgetBehavior (void) const
 Get the behavior associated with the op-code.
 
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 its signedness from its inputs.
 
bool inheritsSignFirstParamOnly (void) const
 Return true if the op-code inherits its signedness from only its first input.
 
bool isShiftOp (void) const
 Return true if the op-code is a shift (INT_LEFT, INT_RIGHT, or INT_SRIGHT)
 
bool isArithmeticOp (void) const
 Return true if the opcode is INT_ADD, INT_MULT, INT_DIV, INT_REM, or other arithmetic op.
 
bool isLogicalOp (void) const
 Return true if the opcode is INT_AND, INT_OR, INT_XOR, or other logical op.
 
bool isFloatingPointOp (void) const
 Return true if the opcode is FLOAT_ADD, FLOAT_MULT, or other floating-point operation.
 
virtual DatatypepropagateType (Datatype *alttype, PcodeOp *op, Varnode *invn, Varnode *outvn, int4 inslot, int4 outslot)
 Propagate an incoming data-type across a specific PcodeOp. More...
 
virtual string getOperatorName (const PcodeOp *op) const
 Get the name of the op-code as it should be displayed in context. More...
 

Additional Inherited Members

- Public Types inherited from ghidra::TypeOp
enum  {
  inherits_sign = 1, inherits_sign_zero = 2, shift_op = 4, arithmetic_op = 8,
  logical_op = 0x10, floatingpoint_op = 0x20
}
 
- Static Public Member Functions inherited from ghidra::TypeOp
static void registerInstructions (vector< TypeOp *> &inst, TypeFactory *tlst, const Translate *trans)
 Build a map from op-code value to the TypeOp information objects. More...
 
static void selectJavaOperators (vector< TypeOp *> &inst, bool val)
 Toggle Java specific aspects of the op-code information. More...
 
- Protected Member Functions inherited from ghidra::TypeOp
virtual void setSymbol (const string &nm)
 Set the display symbol associated with the op-code.
 
- Protected Attributes inherited from ghidra::TypeOp
TypeFactorytlst
 Pointer to data-type factory.
 
OpCode opcode
 The op-code value.
 
uint4 opflags
 Cached pcode-op properties for this op-code.
 
uint4 addlflags
 Additional properties.
 
string name
 Symbol denoting this operation.
 
OpBehaviorbehave
 Object for emulating the behavior of the op-code.
 

Detailed Description

Information about the INT_RIGHT op-code.

Member Function Documentation

◆ getInputCast()

Datatype * ghidra::TypeOpIntRight::getInputCast ( const PcodeOp op,
int4  slot,
const CastStrategy castStrategy 
) const
virtual

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
opis the specific PcodeOp
slotis the input to consider
castStrategyis the current casting strategy
Returns
the data-type

Reimplemented from ghidra::TypeOp.

References ghidra::CastStrategy::castStandard(), ghidra::Varnode::getHighTypeReadFacing(), ghidra::PcodeOp::getIn(), ghidra::TypeOp::getInputCast(), ghidra::PcodeOp::inputTypeLocal(), ghidra::CastStrategy::intPromotionType(), ghidra::CastStrategy::NO_PROMOTION, and ghidra::CastStrategy::UNSIGNED_EXTENSION.

◆ getInputLocal()

Datatype * ghidra::TypeOpIntRight::getInputLocal ( const PcodeOp op,
int4  slot 
) const
virtual

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
opis the PcodeOp being considered
slotis the input being considered
Returns
the data-type

Reimplemented from ghidra::TypeOpBinary.

References ghidra::TypeFactory::getBaseNoChar(), ghidra::PcodeOp::getIn(), ghidra::TypeOpBinary::getInputLocal(), ghidra::Varnode::getSize(), ghidra::TypeOp::tlst, and ghidra::TYPE_INT.

◆ getOutputToken()

Datatype * ghidra::TypeOpIntRight::getOutputToken ( const PcodeOp op,
CastStrategy castStrategy 
) const
virtual

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
opis the specific PcodeOp
castStrategyis the current casting strategy
Returns
the data-type

Reimplemented from ghidra::TypeOp.

References ghidra::TypeFactory::getBase(), ghidra::Varnode::getHighTypeReadFacing(), ghidra::PcodeOp::getIn(), ghidra::Datatype::getMetatype(), ghidra::Datatype::getSize(), ghidra::TypeOp::tlst, ghidra::TYPE_BOOL, and ghidra::TYPE_INT.

◆ push()

virtual void ghidra::TypeOpIntRight::push ( PrintLanguage lng,
const PcodeOp op,
const PcodeOp readOp 
) const
inlinevirtual

Push the specific PcodeOp to the emitter's RPN stack.

Given a specific language and PcodeOp, emit the expression rooted at the operation.

Parameters
lngis the PrintLanguage to emit
opis the specific PcodeOp
readOpis the PcodeOp consuming the output (or null)

Implements ghidra::TypeOp.

References ghidra::TypeOp::getInputCast(), ghidra::TypeOp::getInputLocal(), ghidra::TypeOp::getOutputToken(), and ghidra::PrintLanguage::opIntRight().


The documentation for this class was generated from the following files: