ROSE  0.11.2.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Rose::BinaryAnalysis::Partitioner2::Semantics::RiscOperators Class Reference

Description

Semantic operators.

Most operations are delegated to the symbolic state. The return value from the symbolic state is replaced with an unknown if the expression grows beyond a certain complexity.

Definition at line 220 of file Semantics.h.

#include <Semantics.h>

Inheritance diagram for Rose::BinaryAnalysis::Partitioner2::Semantics::RiscOperators:
Inheritance graph
[legend]
Collaboration diagram for Rose::BinaryAnalysis::Partitioner2::Semantics::RiscOperators:
Collaboration graph
[legend]

Public Types

typedef InstructionSemantics2::SymbolicSemantics::RiscOperators Super
 
- Public Types inherited from Rose::BinaryAnalysis::InstructionSemantics2::SymbolicSemantics::RiscOperators
typedef BaseSemantics::RiscOperators Super
 
- Public Types inherited from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators
typedef RiscOperatorsPtr Ptr
 Shared-ownership pointer for a RiscOperators object. More...
 

Public Member Functions

virtual InstructionSemantics2::BaseSemantics::RiscOperatorsPtr create (const InstructionSemantics2::BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
 Virtual allocating constructor. More...
 
virtual InstructionSemantics2::BaseSemantics::RiscOperatorsPtr create (const InstructionSemantics2::BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
 Virtual allocating constructor. More...
 
virtual void startInstruction (SgAsmInstruction *) ROSE_OVERRIDE
 
- Public Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics2::SymbolicSemantics::RiscOperators
virtual BaseSemantics::SValuePtr boolean_ (bool b) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr number_ (size_t nbits, uint64_t value) ROSE_OVERRIDE
 
bool getset_omit_cur_insn (bool b)
 
virtual void substitute (const SValuePtr &from, const SValuePtr &to)
 Substitute all occurrences of from with to in the current state. More...
 
virtual BaseSemantics::SValuePtr filterResult (const BaseSemantics::SValuePtr &)
 Filters results from RISC operators. More...
 
virtual SymbolicExpr::Type sgTypeToSymbolicType (SgAsmType *)
 Convert a SgAsmType to a symbolic type. More...
 
virtual void interrupt (int majr, int minr) ROSE_OVERRIDE
 Invoked for instructions that cause an interrupt. More...
 
virtual BaseSemantics::SValuePtr and_ (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr or_ (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr xor_ (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr invert (const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr extract (const BaseSemantics::SValuePtr &a_, size_t begin_bit, size_t end_bit) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr concat (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr leastSignificantSetBit (const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr mostSignificantSetBit (const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr rotateLeft (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr rotateRight (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr shiftLeft (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr shiftRight (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr shiftRightArithmetic (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr equalToZero (const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr ite (const BaseSemantics::SValuePtr &sel_, const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr unsignedExtend (const BaseSemantics::SValuePtr &a_, size_t new_width) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr signExtend (const BaseSemantics::SValuePtr &a_, size_t new_width) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr add (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr addWithCarries (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_, const BaseSemantics::SValuePtr &c_, BaseSemantics::SValuePtr &carry_out) ROSE_OVERRIDE
 Used for printing RISC operators with formatting. More...
 
virtual BaseSemantics::SValuePtr negate (const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE
 Two's complement. More...
 
virtual BaseSemantics::SValuePtr signedDivide (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
 Divides two signed values. More...
 
virtual BaseSemantics::SValuePtr signedModulo (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
 Calculates modulo with signed values. More...
 
virtual BaseSemantics::SValuePtr signedMultiply (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
 Multiplies two signed values. More...
 
virtual BaseSemantics::SValuePtr unsignedDivide (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
 Divides two unsigned values. More...
 
virtual BaseSemantics::SValuePtr unsignedModulo (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
 Calculates modulo with unsigned values. More...
 
virtual BaseSemantics::SValuePtr unsignedMultiply (const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
 Multiply two unsigned values. More...
 
virtual BaseSemantics::SValuePtr fpConvert (const BaseSemantics::SValuePtr &a, SgAsmFloatType *aType, SgAsmFloatType *retType) ROSE_OVERRIDE
 Convert from one floating-point type to another. More...
 
virtual BaseSemantics::SValuePtr reinterpret (const BaseSemantics::SValuePtr &, SgAsmType *) ROSE_OVERRIDE
 Reinterpret an expression as a different type. More...
 
virtual BaseSemantics::SValuePtr readRegister (RegisterDescriptor reg, const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE
 Reads a value from a register. More...
 
virtual BaseSemantics::SValuePtr peekRegister (RegisterDescriptor reg, const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE
 Obtain a register value without side effects. More...
 
virtual void writeRegister (RegisterDescriptor reg, const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE
 Writes a value to a register. More...
 
virtual BaseSemantics::SValuePtr readMemory (RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt, const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE
 Reads a value from memory. More...
 
virtual BaseSemantics::SValuePtr peekMemory (RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE
 Read memory without side effects. More...
 
virtual void writeMemory (RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &data, const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE
 Writes a value to memory. More...
 
BaseSemantics::SValuePtr readOrPeekMemory (RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt, AllowSideEffects::Flag)
 
void computingDefiners (DefinersMode m)
 Property: Track which instructions define a semantic value. More...
 
DefinersMode computingDefiners () const
 Property: Track which instructions define a semantic value. More...
 
void computingMemoryWriters (WritersMode m)
 Property: Track which instructions write to each memory location. More...
 
WritersMode computingMemoryWriters () const
 Property: Track which instructions write to each memory location. More...
 
void computingRegisterWriters (WritersMode m)
 Property: Track latest writer to each register. More...
 
WritersMode computingRegisterWriters () const
 Property: Track latest writer to each register. More...
 
void trimThreshold (size_t n)
 Property: Maximum size of expressions. More...
 
size_t trimThreshold () const
 Property: Maximum size of expressions. More...
 
bool reinterpretMemoryReads () const
 Property: Reinterpret data as unsigned integers when reading from memory or registers. More...
 
void reinterpretMemoryReads (bool b)
 Property: Reinterpret data as unsigned integers when reading from memory or registers. More...
 
bool reinterpretRegisterReads () const
 Property: Reinterpret data as unsigned integers when reading from memory or registers. More...
 
void reinterpretRegisterReads (bool b)
 Property: Reinterpret data as unsigned integers when reading from memory or registers. More...
 
- Public Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators
virtual SValuePtr protoval () const
 Property: Prototypical semantic value. More...
 
virtual SValuePtr fpFromInteger (const SValuePtr &intValue, SgAsmFloatType *fpType)
 Construct a floating-point value from an integer value. More...
 
virtual SValuePtr fpToInteger (const SValuePtr &fpValue, SgAsmFloatType *fpType, const SValuePtr &dflt)
 Construct an integer value from a floating-point value. More...
 
virtual SValuePtr fpIsNan (const SValuePtr &fpValue, SgAsmFloatType *fpType)
 Whether a floating-point value is a special not-a-number bit pattern. More...
 
virtual SValuePtr fpIsDenormalized (const SValuePtr &fpValue, SgAsmFloatType *fpType)
 Whether a floating-point value is denormalized. More...
 
virtual SValuePtr fpIsZero (const SValuePtr &fpValue, SgAsmFloatType *fpType)
 Whether a floating-point value is equal to zero. More...
 
virtual SValuePtr fpIsInfinity (const SValuePtr &fpValue, SgAsmFloatType *fpType)
 Whether a floating-point value is infinity. More...
 
virtual SValuePtr fpSign (const SValuePtr &fpValue, SgAsmFloatType *fpType)
 Sign of floating-point value. More...
 
virtual SValuePtr fpEffectiveExponent (const SValuePtr &fpValue, SgAsmFloatType *fpType)
 Exponent of floating-point value. More...
 
virtual SValuePtr fpAdd (const SValuePtr &a, const SValuePtr &b, SgAsmFloatType *fpType)
 Add two floating-point values. More...
 
virtual SValuePtr fpSubtract (const SValuePtr &a, const SValuePtr &b, SgAsmFloatType *fpType)
 Subtract one floating-point value from another. More...
 
virtual SValuePtr fpMultiply (const SValuePtr &a, const SValuePtr &b, SgAsmFloatType *fpType)
 Multiply two floating-point values. More...
 
virtual SValuePtr fpDivide (const SValuePtr &a, const SValuePtr &b, SgAsmFloatType *fpType)
 Divide one floating-point value by another. More...
 
virtual SValuePtr fpSquareRoot (const SValuePtr &a, SgAsmFloatType *fpType)
 Square root. More...
 
virtual SValuePtr fpRoundTowardZero (const SValuePtr &a, SgAsmFloatType *fpType)
 Round toward zero. More...
 
virtual SValuePtr convert (const SValuePtr &a, SgAsmType *srcType, SgAsmType *dstType)
 Convert value from one type to another. More...
 
virtual SmtSolverPtr solver () const
 Property: Satisfiability module theory (SMT) solver. More...
 
virtual void solver (const SmtSolverPtr &s)
 Property: Satisfiability module theory (SMT) solver. More...
 
const HotPatchhotPatch () const
 Property: Post-instruction hot patches. More...
 
HotPatchhotPatch ()
 Property: Post-instruction hot patches. More...
 
void hotPatch (const HotPatch &hp)
 Property: Post-instruction hot patches. More...
 
virtual StatePtr currentState () const
 Property: Current semantic state. More...
 
virtual void currentState (const StatePtr &s)
 Property: Current semantic state. More...
 
virtual StatePtr initialState () const
 Property: Optional lazily updated initial state. More...
 
virtual void initialState (const StatePtr &s)
 Property: Optional lazily updated initial state. More...
 
virtual const std::string & name () const
 Property: Name used for debugging. More...
 
virtual void name (const std::string &s)
 Property: Name used for debugging. More...
 
void print (std::ostream &stream, const std::string prefix="") const
 Print multi-line output for this object.
 
virtual void print (std::ostream &stream, Formatter &fmt) const
 Print multi-line output for this object.
 
virtual SValuePtr readRegister (RegisterDescriptor reg)
 Reads a value from a register. More...
 
SValuePtr peekRegister (RegisterDescriptor reg)
 Obtain a register value without side effects. More...
 

Static Public Member Functions

static RiscOperatorsPtr instance (const RegisterDictionary *regdict, const SmtSolverPtr &solver=SmtSolverPtr(), SemanticMemoryParadigm memoryParadigm=LIST_BASED_MEMORY)
 Instantiate a new RiscOperators object and configure it using default values. More...
 
static RiscOperatorsPtr instance (const InstructionSemantics2::BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr())
 Instantiate a new RiscOperators object with specified prototypical values. More...
 
static RiscOperatorsPtr instance (const InstructionSemantics2::BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr())
 Instantiate a new RiscOperators with specified state. More...
 
static RiscOperatorsPtr promote (const InstructionSemantics2::BaseSemantics::RiscOperatorsPtr &x)
 Run-time promotion of a base RiscOperators pointer to our operators. More...
 
- Static Public Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics2::SymbolicSemantics::RiscOperators
static RiscOperatorsPtr instance (const RegisterDictionary *regdict, const SmtSolverPtr &solver=SmtSolverPtr())
 Instantiates a new RiscOperators object and configures it to use semantic values and states that are defaults for SymbolicSemantics. More...
 
static RiscOperatorsPtr instance (const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr())
 Instantiates a new RiscOperators object with specified prototypical values. More...
 
static RiscOperatorsPtr instance (const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr())
 Instantiates a new RiscOperators object with specified state. More...
 
static RiscOperatorsPtr promote (const BaseSemantics::RiscOperatorsPtr &x)
 Run-time promotion of a base RiscOperators pointer to symbolic operators. More...
 
static SgAsmFloatTypesgIsIeee754 (SgAsmType *)
 Tests whether a SgAsmType is an IEEE-754 floating-point type. More...
 
- Static Public Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators
static RiscOperatorsPtr promote (const RiscOperatorsPtr &x)
 

Protected Member Functions

 RiscOperators (const InstructionSemantics2::BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr())
 
 RiscOperators (const InstructionSemantics2::BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr())
 
- Protected Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics2::SymbolicSemantics::RiscOperators
 RiscOperators (const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr())
 
 RiscOperators (const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr())
 
SValuePtr svalue_expr (const ExprPtr &expr, const InsnSet &defs=InsnSet())
 
SValuePtr svalue_undefined (size_t nbits)
 
SValuePtr svalue_bottom (size_t nbits)
 
SValuePtr svalue_unspecified (size_t nbits)
 
SValuePtr svalue_number (size_t nbits, uint64_t value)
 
SValuePtr svalue_boolean (bool b)
 
- Protected Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators
 RiscOperators (const SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr())
 
 RiscOperators (const StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr())
 

Additional Inherited Members

- Protected Attributes inherited from Rose::BinaryAnalysis::InstructionSemantics2::SymbolicSemantics::RiscOperators
bool omit_cur_insn
 
DefinersMode computingDefiners_
 
WritersMode computingMemoryWriters_
 
WritersMode computingRegisterWriters_
 
size_t trimThreshold_
 
bool reinterpretMemoryReads_
 
bool reinterpretRegisterReads_
 

Member Function Documentation

static RiscOperatorsPtr Rose::BinaryAnalysis::Partitioner2::Semantics::RiscOperators::instance ( const RegisterDictionary regdict,
const SmtSolverPtr solver = SmtSolverPtr(),
SemanticMemoryParadigm  memoryParadigm = LIST_BASED_MEMORY 
)
inlinestatic
static RiscOperatorsPtr Rose::BinaryAnalysis::Partitioner2::Semantics::RiscOperators::instance ( const InstructionSemantics2::BaseSemantics::SValuePtr protoval,
const SmtSolverPtr solver = SmtSolverPtr() 
)
inlinestatic

Instantiate a new RiscOperators object with specified prototypical values.

Definition at line 283 of file Semantics.h.

static RiscOperatorsPtr Rose::BinaryAnalysis::Partitioner2::Semantics::RiscOperators::instance ( const InstructionSemantics2::BaseSemantics::StatePtr state,
const SmtSolverPtr solver = SmtSolverPtr() 
)
inlinestatic

Instantiate a new RiscOperators with specified state.

Definition at line 289 of file Semantics.h.

virtual InstructionSemantics2::BaseSemantics::RiscOperatorsPtr Rose::BinaryAnalysis::Partitioner2::Semantics::RiscOperators::create ( const InstructionSemantics2::BaseSemantics::SValuePtr protoval,
const SmtSolverPtr solver = SmtSolverPtr() 
) const
inlinevirtual

Virtual allocating constructor.

The protoval is a prototypical semantic value that is used as a factory to create additional values as necessary via its virtual constructors. The state upon which the RISC operations operate must be set by modifying the currentState property. An optional SMT solver may be specified (see solver).

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::SymbolicSemantics::RiscOperators.

Definition at line 297 of file Semantics.h.

References Rose::BinaryAnalysis::Partitioner2::Semantics::MemoryState< Super >::instance().

virtual InstructionSemantics2::BaseSemantics::RiscOperatorsPtr Rose::BinaryAnalysis::Partitioner2::Semantics::RiscOperators::create ( const InstructionSemantics2::BaseSemantics::StatePtr state,
const SmtSolverPtr solver = SmtSolverPtr() 
) const
inlinevirtual

Virtual allocating constructor.

The supplied state is that upon which the RISC operations operate and is also used to define the prototypical semantic value. Other states can be supplied by setting currentState. The prototypical semantic value is used as a factory to create additional values as necessary via its virtual constructors. An optional SMT solver may be specified (see solver).

Reimplemented from Rose::BinaryAnalysis::InstructionSemantics2::SymbolicSemantics::RiscOperators.

Definition at line 303 of file Semantics.h.

References Rose::BinaryAnalysis::Partitioner2::Semantics::MemoryState< Super >::instance().

static RiscOperatorsPtr Rose::BinaryAnalysis::Partitioner2::Semantics::RiscOperators::promote ( const InstructionSemantics2::BaseSemantics::RiscOperatorsPtr x)
inlinestatic

Run-time promotion of a base RiscOperators pointer to our operators.

This is a checked conversion–it will fail if x does not point to our object.

Definition at line 314 of file Semantics.h.


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