ROSE  0.9.9.139
Classes | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators Class Reference

Description

Defines RISC operators for the MultiSemantics domain.

Invoking a RISC operation in the MultiSemantics domain causes the same operation to be invoked for each of its subdomains provided all arguments are valid in those subdomains (i.e., SValue::is_valid() returns true).

Definition at line 240 of file MultiSemantics2.h.

#include <MultiSemantics2.h>

Inheritance diagram for Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators:
Inheritance graph
[legend]
Collaboration diagram for Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators:
Collaboration graph
[legend]

Classes

class  Cursor
 Iterates over valid subdomains whose inputs are valid. More...
 

Public Member Functions

virtual BaseSemantics::RiscOperatorsPtr create (const BaseSemantics::SValuePtr &protoval, SmtSolver *solver=NULL) const ROSE_OVERRIDE
 Virtual allocating constructor. More...
 
virtual BaseSemantics::RiscOperatorsPtr create (const BaseSemantics::StatePtr &state, SmtSolver *solver=NULL) const ROSE_OVERRIDE
 Virtual allocating constructor. More...
 
virtual size_t add_subdomain (const BaseSemantics::RiscOperatorsPtr &subdomain, const std::string &name, bool activate=true)
 Add a subdomain to this MultiSemantics domain. More...
 
virtual Formatterget_formatter ()
 Returns a formatter containing the names of the subdomains. More...
 
virtual size_t nsubdomains () const
 Returns the number of subdomains added to this MultiDomain. More...
 
virtual BaseSemantics::RiscOperatorsPtr get_subdomain (size_t idx) const
 Returns the RiscOperators for a subdomain. More...
 
virtual bool is_active (size_t idx) const
 Returns true if a subdomain is active. More...
 
virtual void clear_active (size_t idx)
 Makes a subdomain inactive. More...
 
virtual void set_active (size_t idx, bool status)
 Makes a subdomain active or inactive. More...
 
virtual void before (size_t idx)
 Called before each subdomain RISC operation. More...
 
virtual void after (size_t idx)
 Called after each subdomain RISC operation. More...
 
virtual SValuePtr svalue_empty (size_t nbits)
 Convenience function for SValue::create_empty(). More...
 
virtual void print (std::ostream &o, BaseSemantics::Formatter &) const ROSE_OVERRIDE
 Print multi-line output for this object.
 
virtual void startInstruction (SgAsmInstruction *insn) ROSE_OVERRIDE
 Called at the beginning of every instruction. More...
 
virtual void finishInstruction (SgAsmInstruction *insn) ROSE_OVERRIDE
 Called at the end of every instruction. More...
 
virtual BaseSemantics::SValuePtr undefined_ (size_t nbits) ROSE_OVERRIDE
 Returns a new undefined value. More...
 
virtual BaseSemantics::SValuePtr unspecified_ (size_t nbits) ROSE_OVERRIDE
 
virtual BaseSemantics::SValuePtr number_ (size_t nbits, uint64_t value) ROSE_OVERRIDE
 Returns a number of the specified bit width. More...
 
virtual BaseSemantics::SValuePtr boolean_ (bool) ROSE_OVERRIDE
 Returns a Boolean value. More...
 
virtual BaseSemantics::SValuePtr bottom_ (size_t nbits) ROSE_OVERRIDE
 Returns a data-flow bottom value. More...
 
virtual BaseSemantics::SValuePtr filterCallTarget (const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 Invoked to filter call targets. More...
 
virtual BaseSemantics::SValuePtr filterReturnTarget (const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 Invoked to filter return targets. More...
 
virtual BaseSemantics::SValuePtr filterIndirectJumpTarget (const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 Invoked to filter indirect jumps. More...
 
virtual BaseSemantics::SValuePtr and_ (const BaseSemantics::SValuePtr &a, const BaseSemantics::SValuePtr &b) ROSE_OVERRIDE
 Computes bit-wise AND of two values. More...
 
virtual BaseSemantics::SValuePtr or_ (const BaseSemantics::SValuePtr &a, const BaseSemantics::SValuePtr &b) ROSE_OVERRIDE
 Computes bit-wise OR of two values. More...
 
virtual BaseSemantics::SValuePtr xor_ (const BaseSemantics::SValuePtr &a, const BaseSemantics::SValuePtr &b) ROSE_OVERRIDE
 Computes bit-wise XOR of two values. More...
 
virtual BaseSemantics::SValuePtr invert (const BaseSemantics::SValuePtr &a) ROSE_OVERRIDE
 One's complement. More...
 
virtual BaseSemantics::SValuePtr extract (const BaseSemantics::SValuePtr &a, size_t begin_bit, size_t end_bit) ROSE_OVERRIDE
 Extracts bits from a value. More...
 
virtual BaseSemantics::SValuePtr concat (const BaseSemantics::SValuePtr &a, const BaseSemantics::SValuePtr &b) ROSE_OVERRIDE
 Concatenates the bits of two values. More...
 
virtual BaseSemantics::SValuePtr leastSignificantSetBit (const BaseSemantics::SValuePtr &a) ROSE_OVERRIDE
 Returns position of least significant set bit; zero when no bits are set. More...
 
virtual BaseSemantics::SValuePtr mostSignificantSetBit (const BaseSemantics::SValuePtr &a) ROSE_OVERRIDE
 Returns position of most significant set bit; zero when no bits are set. More...
 
virtual BaseSemantics::SValuePtr rotateLeft (const BaseSemantics::SValuePtr &a, const BaseSemantics::SValuePtr &nbits) ROSE_OVERRIDE
 Rotate bits to the left. More...
 
virtual BaseSemantics::SValuePtr rotateRight (const BaseSemantics::SValuePtr &a, const BaseSemantics::SValuePtr &nbits) ROSE_OVERRIDE
 Rotate bits to the right. More...
 
virtual BaseSemantics::SValuePtr shiftLeft (const BaseSemantics::SValuePtr &a, const BaseSemantics::SValuePtr &nbits) ROSE_OVERRIDE
 Returns arg shifted left. More...
 
virtual BaseSemantics::SValuePtr shiftRight (const BaseSemantics::SValuePtr &a, const BaseSemantics::SValuePtr &nbits) ROSE_OVERRIDE
 Returns arg shifted right logically (no sign bit). More...
 
virtual BaseSemantics::SValuePtr shiftRightArithmetic (const BaseSemantics::SValuePtr &a, const BaseSemantics::SValuePtr &nbits) ROSE_OVERRIDE
 Returns arg shifted right arithmetically (with sign bit). More...
 
virtual BaseSemantics::SValuePtr equalToZero (const BaseSemantics::SValuePtr &a) ROSE_OVERRIDE
 Determines whether a value is equal to zero. More...
 
virtual BaseSemantics::SValuePtr ite (const BaseSemantics::SValuePtr &cond, const BaseSemantics::SValuePtr &a, const BaseSemantics::SValuePtr &b) ROSE_OVERRIDE
 If-then-else. More...
 
virtual BaseSemantics::SValuePtr unsignedExtend (const BaseSemantics::SValuePtr &a, size_t new_width) ROSE_OVERRIDE
 Extend (or shrink) operand a so it is nbits wide by adding or removing high-order bits. More...
 
virtual BaseSemantics::SValuePtr signExtend (const BaseSemantics::SValuePtr &a, size_t new_width) ROSE_OVERRIDE
 Sign extends a value. More...
 
virtual BaseSemantics::SValuePtr add (const BaseSemantics::SValuePtr &a, const BaseSemantics::SValuePtr &b) ROSE_OVERRIDE
 Adds two integers of equal size. More...
 
virtual BaseSemantics::SValuePtr addWithCarries (const BaseSemantics::SValuePtr &a, const BaseSemantics::SValuePtr &b, const BaseSemantics::SValuePtr &c, BaseSemantics::SValuePtr &carry_out) ROSE_OVERRIDE
 Add two values of equal size and a carry bit. 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 fpFromInteger (const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Construct a floating-point value from an integer value. More...
 
virtual BaseSemantics::SValuePtr fpToInteger (const BaseSemantics::SValuePtr &, SgAsmFloatType *, const BaseSemantics::SValuePtr &) ROSE_OVERRIDE
 Construct an integer value from a floating-point value. More...
 
virtual BaseSemantics::SValuePtr fpConvert (const BaseSemantics::SValuePtr &, SgAsmFloatType *, SgAsmFloatType *) ROSE_OVERRIDE
 Convert from one floating-point type to another. More...
 
virtual BaseSemantics::SValuePtr fpIsNan (const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Whether a floating-point value is a special not-a-number bit pattern. More...
 
virtual BaseSemantics::SValuePtr fpIsDenormalized (const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Whether a floating-point value is denormalized. More...
 
virtual BaseSemantics::SValuePtr fpIsZero (const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Whether a floating-point value is equal to zero. More...
 
virtual BaseSemantics::SValuePtr fpIsInfinity (const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Whether a floating-point value is infinity. More...
 
virtual BaseSemantics::SValuePtr fpSign (const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Sign of floating-point value. More...
 
virtual BaseSemantics::SValuePtr fpEffectiveExponent (const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Exponent of floating-point value. More...
 
virtual BaseSemantics::SValuePtr fpAdd (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Add two floating-point values. More...
 
virtual BaseSemantics::SValuePtr fpSubtract (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Subtract one floating-point value from another. More...
 
virtual BaseSemantics::SValuePtr fpMultiply (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Multiply two floating-point values. More...
 
virtual BaseSemantics::SValuePtr fpDivide (const BaseSemantics::SValuePtr &, const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Divide one floating-point value by another. More...
 
virtual BaseSemantics::SValuePtr fpSquareRoot (const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Square root. More...
 
virtual BaseSemantics::SValuePtr fpRoundTowardZero (const BaseSemantics::SValuePtr &, SgAsmFloatType *) ROSE_OVERRIDE
 Round toward zero. More...
 
virtual BaseSemantics::SValuePtr readRegister (RegisterDescriptor reg, const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE
 Reads a value from a register. 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 void writeMemory (RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &data, const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE
 Writes a value to memory. More...
 
- Public Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators
virtual SValuePtr protoval () const
 Property: Prototypical semantic value. More...
 
virtual SValuePtr get_protoval () const ROSE_DEPRECATED("use protoval instead")
 
virtual void set_solver (SmtSolver *s) ROSE_DEPRECATED("use solver instead")
 
virtual SmtSolverget_solver () const ROSE_DEPRECATED("use solver instead")
 
virtual StatePtr get_state () const ROSE_DEPRECATED("use currentState instead")
 
virtual void set_state (const StatePtr &s) ROSE_DEPRECATED("use currentState instead")
 
virtual const std::string & get_name () const ROSE_DEPRECATED("use name instead")
 
virtual void set_name (const std::string &s) ROSE_DEPRECATED("use name instead")
 
virtual size_t get_ninsns () const ROSE_DEPRECATED("use nInsns instead")
 
virtual void set_ninsns (size_t n) ROSE_DEPRECATED("use nInsns instead")
 
virtual SgAsmInstructioncurrentInstruction () const
 Returns current instruction. More...
 
virtual SgAsmInstructionget_insn () const ROSE_DEPRECATED("use currentInstruction instead")
 
virtual void hlt ()
 Invoked for the x86 HLT instruction. More...
 
virtual void cpuid ()
 Invoked for the x86 CPUID instruction. More...
 
virtual SValuePtr rdtsc ()
 Invoked for the x86 RDTSC instruction. More...
 
virtual SValuePtr subtract (const SValuePtr &minuend, const SValuePtr &subtrahend)
 Subtract one value from another. More...
 
virtual void interrupt (int majr, int minr)
 Invoked for instructions that cause an interrupt. More...
 
virtual SValuePtr peekRegister (RegisterDescriptor, const SValuePtr &dflt)
 Obtain a register value without side effects. More...
 
virtual SmtSolversolver () const
 Property: Satisfiability module theory (SMT) solver. More...
 
virtual void solver (SmtSolver *s)
 Property: Satisfiability module theory (SMT) solver. 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.
 
WithFormatter with_format (Formatter &fmt)
 Used for printing RISC operators with formatting. More...
 
WithFormatter operator+ (Formatter &fmt)
 Used for printing RISC operators with formatting. More...
 
virtual size_t nInsns () const
 Property: Number of instructions processed. More...
 
virtual void nInsns (size_t n)
 Property: Number of instructions processed. More...
 
SValuePtr equal (const SValuePtr &a, const SValuePtr &b) ROSE_DEPRECATED("use isEqual instead")
 Equality comparison. More...
 
virtual SValuePtr isEqual (const SValuePtr &a, const SValuePtr &b)
 Equality comparison. More...
 
virtual SValuePtr isNotEqual (const SValuePtr &a, const SValuePtr &b)
 Equality comparison. More...
 
virtual SValuePtr isUnsignedLessThan (const SValuePtr &a, const SValuePtr &b)
 Comparison for unsigned values. More...
 
virtual SValuePtr isUnsignedLessThanOrEqual (const SValuePtr &a, const SValuePtr &b)
 Comparison for unsigned values. More...
 
virtual SValuePtr isUnsignedGreaterThan (const SValuePtr &a, const SValuePtr &b)
 Comparison for unsigned values. More...
 
virtual SValuePtr isUnsignedGreaterThanOrEqual (const SValuePtr &a, const SValuePtr &b)
 Comparison for unsigned values. More...
 
virtual SValuePtr isSignedLessThan (const SValuePtr &a, const SValuePtr &b)
 Comparison for signed values. More...
 
virtual SValuePtr isSignedLessThanOrEqual (const SValuePtr &a, const SValuePtr &b)
 Comparison for signed values. More...
 
virtual SValuePtr isSignedGreaterThan (const SValuePtr &a, const SValuePtr &b)
 Comparison for signed values. More...
 
virtual SValuePtr isSignedGreaterThanOrEqual (const SValuePtr &a, const SValuePtr &b)
 Comparison for signed values. More...
 
virtual SValuePtr readRegister (RegisterDescriptor reg)
 Reads a value from a register. More...
 

Static Public Member Functions

static RiscOperatorsPtr instance (const RegisterDictionary *regdict)
 Static allocating constructor. More...
 
static RiscOperatorsPtr instance (const BaseSemantics::SValuePtr &protoval, SmtSolver *solver=NULL)
 
static RiscOperatorsPtr instance (const BaseSemantics::StatePtr &state, SmtSolver *solver=NULL)
 
static RiscOperatorsPtr promote (const BaseSemantics::RiscOperatorsPtr &ops)
 
- Static Public Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators
static RiscOperatorsPtr promote (const RiscOperatorsPtr &x)
 

Protected Types

typedef std::vector< BaseSemantics::RiscOperatorsPtrSubdomains
 

Protected Member Functions

 RiscOperators (const BaseSemantics::SValuePtr &protoval, SmtSolver *solver=NULL)
 
 RiscOperators (const BaseSemantics::StatePtr &state, SmtSolver *solver=NULL)
 
- Protected Member Functions inherited from Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators
 RiscOperators (const SValuePtr &protoval, SmtSolver *solver=NULL)
 
 RiscOperators (const StatePtr &state, SmtSolver *solver=NULL)
 

Protected Attributes

Subdomains subdomains
 
std::vector< bool > active
 
Formatter formatter
 

Additional Inherited Members

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

Member Function Documentation

static RiscOperatorsPtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::instance ( const RegisterDictionary regdict)
inlinestatic

Static allocating constructor.

This constructor creates a new MultiDomain RiscOperators object that does't have any subdomains. The subdomains should be added before using this object. The regdict argument is not used in this class and is only present for consistency with other classes and for subclasses.

Definition at line 268 of file MultiSemantics2.h.

References Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::SValue::instance().

Referenced by create().

virtual BaseSemantics::RiscOperatorsPtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::create ( const BaseSemantics::SValuePtr protoval,
SmtSolver solver = NULL 
) 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).

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

Definition at line 284 of file MultiSemantics2.h.

References instance(), and Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators::solver().

virtual BaseSemantics::RiscOperatorsPtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::create ( const BaseSemantics::StatePtr state,
SmtSolver solver = NULL 
) 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).

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

Definition at line 289 of file MultiSemantics2.h.

References instance(), and Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators::solver().

virtual size_t Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::add_subdomain ( const BaseSemantics::RiscOperatorsPtr subdomain,
const std::string &  name,
bool  activate = true 
)
virtual

Add a subdomain to this MultiSemantics domain.

Returns the identifier (index) used for this subdomain. The name is optional and used mostly for debugging; it is also added to the formatter and can be used when printing a semantic value. The activate argument indicates whether this subdomain is activated (default is true). Activated subdomains will participate in RISC operations if their arguments are defined. See also, is_active(), set_active(), and clear_active().

virtual Formatter& Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::get_formatter ( )
inlinevirtual

Returns a formatter containing the names of the subdomains.

Definition at line 310 of file MultiSemantics2.h.

virtual size_t Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::nsubdomains ( ) const
inlinevirtual

Returns the number of subdomains added to this MultiDomain.

Definition at line 315 of file MultiSemantics2.h.

virtual BaseSemantics::RiscOperatorsPtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::get_subdomain ( size_t  idx) const
virtual

Returns the RiscOperators for a subdomain.

The idx need not be valid.

virtual bool Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::is_active ( size_t  idx) const
inlinevirtual

Returns true if a subdomain is active.

Active subdomains participate in MultiSemantics RISC operations, provided all their operands are valid. This method returns false if idx is out of range or the subdomain's RiscOperators are null.

Definition at line 325 of file MultiSemantics2.h.

virtual void Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::clear_active ( size_t  idx)
inlinevirtual

Makes a subdomain inactive.

The subdomain's RiscOperators object is not removed or deleted by this method; the subdomain can be made active again at a later time.

Definition at line 331 of file MultiSemantics2.h.

References set_active().

virtual void Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::set_active ( size_t  idx,
bool  status 
)
virtual

Makes a subdomain active or inactive.

When making a subdomain inactive, its RiscOperators object is not removed or deleted, and it can be reactivated later. An invalid idx is ignored when deactivating; it must refer to a valid subdomain when activating.

Referenced by clear_active().

virtual void Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::before ( size_t  idx)
inlinevirtual

Called before each subdomain RISC operation.

The default implementation does nothing, but subclasses can override this to do interesting things. The idx is the index of the subdomain that's about to be called.

Definition at line 342 of file MultiSemantics2.h.

virtual void Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::after ( size_t  idx)
inlinevirtual

Called after each subdomain RISC operation.

The default implementation does nothing, but subclasses can override this to do interesting things. The idx is the index of the subdomain that was just called.

Definition at line 346 of file MultiSemantics2.h.

virtual SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::svalue_empty ( size_t  nbits)
inlinevirtual
virtual void Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::startInstruction ( SgAsmInstruction insn)
virtual

Called at the beginning of every instruction.

This method is invoked every time the translation object begins processing an instruction. Some policies use this to update a pointer to the current instruction.

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

virtual void Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::finishInstruction ( SgAsmInstruction insn)
virtual

Called at the end of every instruction.

This method is invoked whenever the translation object ends processing for an instruction. This is not called if there's an exception during processing.

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

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::undefined_ ( size_t  nbits)
virtual

Returns a new undefined value.

Uses the prototypical value to virtually construct the new value.

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

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::number_ ( size_t  nbits,
uint64_t  value 
)
virtual

Returns a number of the specified bit width.

Uses the prototypical value to virtually construct a new value.

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

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::boolean_ ( bool  value)
virtual

Returns a Boolean value.

Uses the prototypical value to virtually construct a new value.

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

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::bottom_ ( size_t  nbits)
virtual

Returns a data-flow bottom value.

Uses the prototypical value to virtually construct a new value.

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

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::filterCallTarget ( const BaseSemantics::SValuePtr a)
virtual

Invoked to filter call targets.

This method is called whenever the translation object is about to invoke a function call. The target address is passed as an argument and a (new) target should be returned.

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

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::filterReturnTarget ( const BaseSemantics::SValuePtr a)
virtual

Invoked to filter return targets.

This method is called whenever the translation object is about to return from a function call (such as for the x86 "RET" instruction). The return address is passed as an argument and a (new) return address should be returned.

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

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::filterIndirectJumpTarget ( const BaseSemantics::SValuePtr a)
virtual

Invoked to filter indirect jumps.

This method is called whenever the translation object is about to unconditionally jump to a new address (such as for the x86 "JMP" instruction). The target address is passed as an argument and a (new) target address should be returned.

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

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::and_ ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b 
)
virtual

Computes bit-wise AND of two values.

The operands must both have the same width; the result must be the same width as the operands.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::or_ ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b 
)
virtual

Computes bit-wise OR of two values.

The operands a and b must have the same width; the return value width will be the same as a and b.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::xor_ ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b 
)
virtual

Computes bit-wise XOR of two values.

The operands a and b must have the same width; the result will be the same width as a and b.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::invert ( const BaseSemantics::SValuePtr a)
virtual

One's complement.

The result will be the same size as the operand.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::extract ( const BaseSemantics::SValuePtr a,
size_t  begin_bit,
size_t  end_bit 
)
virtual

Extracts bits from a value.

The specified bits from begin_bit (inclusive) through end_bit (exclusive) are copied into the low-order bits of the return value (other bits in the return value are cleared). The least significant bit is number zero. The begin_bit and end_bit values must be valid for the width of a.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::concat ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b 
)
virtual

Concatenates the bits of two values.

The bits of a and b are concatenated so that the result has b in the high-order bits and a in the low order bits. The width of the return value is the sum of the widths of a and b.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::leastSignificantSetBit ( const BaseSemantics::SValuePtr a)
virtual

Returns position of least significant set bit; zero when no bits are set.

The return value will have the same width as the operand, although this can be safely truncated to the log-base-2 + 1 width.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::mostSignificantSetBit ( const BaseSemantics::SValuePtr a)
virtual

Returns position of most significant set bit; zero when no bits are set.

The return value will have the same width as the operand, although this can be safely truncated to the log-base-2 + 1 width.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::rotateLeft ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr nbits 
)
virtual

Rotate bits to the left.

The return value will have the same width as operand a. The nbits is interpreted as unsigned. The behavior is modulo the width of a regardles of whether the implementation makes that a special case or handles it naturally.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::rotateRight ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr nbits 
)
virtual

Rotate bits to the right.

The return value will have the same width as operand a. The nbits is interpreted as unsigned. The behavior is modulo the width of a regardles of whether the implementation makes that a special case or handles it naturally.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::shiftLeft ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr nbits 
)
virtual

Returns arg shifted left.

The return value will have the same width as operand a. The nbits is interpreted as unsigned. New bits shifted into the value are zero. If nbits is equal to or larger than the width of a then the result is zero.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::shiftRight ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr nbits 
)
virtual

Returns arg shifted right logically (no sign bit).

The return value will have the same width as operand a. The nbits is interpreted as unsigned. New bits shifted into the value are zero. If nbits is equal to or larger than the width of a then the result is zero.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::shiftRightArithmetic ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr nbits 
)
virtual

Returns arg shifted right arithmetically (with sign bit).

The return value will have the same width as operand a. The nbits is interpreted as unsigned. New bits shifted into the value are the same as the most significant bit (the "sign bit"). If nbits is equal to or larger than the width of a then the result has all bits cleared or all bits set depending on whether the most significant bit was originally clear or set.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::equalToZero ( const BaseSemantics::SValuePtr a)
virtual

Determines whether a value is equal to zero.

Returns true, false, or undefined (in the semantic domain) depending on whether argument is zero.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::ite ( const BaseSemantics::SValuePtr cond,
const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b 
)
virtual

If-then-else.

Returns operand a if cond is true, operand b if cond is false, or some other value if the condition is unknown. The condition must be one bit wide; the widths of a and b must be equal; the return value width will be the same as a and b.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::unsignedExtend ( const BaseSemantics::SValuePtr a,
size_t  new_width 
)
virtual

Extend (or shrink) operand a so it is nbits wide by adding or removing high-order bits.

Added bits are always zeros. The result will be the specified new_width.

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

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::signExtend ( const BaseSemantics::SValuePtr a,
size_t  new_width 
)
virtual

Sign extends a value.

The result will the the specified new_width, which must be at least as large as the original width.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::add ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b 
)
virtual

Adds two integers of equal size.

The width of a and b must be equal; the return value will have the same width as a and b.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::addWithCarries ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b,
const BaseSemantics::SValuePtr c,
BaseSemantics::SValuePtr carry_out 
)
virtual

Add two values of equal size and a carry bit.

Carry information is returned via carry_out argument. The carry_out value is the tick marks that are written above the first addend when doing long arithmetic like a 2nd grader would do (of course, they'd probably be adding two base-10 numbers). For instance, when adding 00110110 and 11100100:

'''..'.. <-- carry tick marks: '=carry .=no carry
00110110
+ 11100100
----------
100011010

The carry_out value is 11100100.

The width of a and b must be equal; c must have a width of one bit; the return value and carry_out will be the same width as a and b. The carry_out value is allocated herein.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::negate ( const BaseSemantics::SValuePtr a)
virtual

Two's complement.

The return value will have the same width as the operand.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::signedDivide ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b 
)
virtual

Divides two signed values.

The width of the result will be the same as the width of operand a.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::signedModulo ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b 
)
virtual

Calculates modulo with signed values.

The width of the result will be the same as the width of operand b.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::signedMultiply ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b 
)
virtual

Multiplies two signed values.

The width of the result will be the sum of the widths of a and b.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::unsignedDivide ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b 
)
virtual

Divides two unsigned values.

The width of the result is the same as the width of operand a.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::unsignedModulo ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b 
)
virtual

Calculates modulo with unsigned values.

The width of the result is the same as the width of operand b.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::unsignedMultiply ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b 
)
virtual

Multiply two unsigned values.

The width of the result is the sum of the widths of a and b.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::fpFromInteger ( const BaseSemantics::SValuePtr intValue,
SgAsmFloatType fpType 
)
virtual

Construct a floating-point value from an integer value.

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

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::fpToInteger ( const BaseSemantics::SValuePtr fpValue,
SgAsmFloatType fpType,
const BaseSemantics::SValuePtr dflt 
)
virtual

Construct an integer value from a floating-point value.

The bits of fpValue are interpreted according to the fpType and converted to a signed integer value that fits in integerWidth bits. This is done by truncating the fractional part of the floating point number, thus rounding toward zero. If fpValue is not a number then dflt is returned.

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

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::fpConvert ( const BaseSemantics::SValuePtr a,
SgAsmFloatType aType,
SgAsmFloatType retType 
)
virtual

Convert from one floating-point type to another.

Converts the floating-point value a having type aType to the return value having retType.

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

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::fpIsNan ( const BaseSemantics::SValuePtr fpValue,
SgAsmFloatType fpType 
)
virtual

Whether a floating-point value is a special not-a-number bit pattern.

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

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::fpIsDenormalized ( const BaseSemantics::SValuePtr fpValue,
SgAsmFloatType fpType 
)
virtual

Whether a floating-point value is denormalized.

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

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::fpIsZero ( const BaseSemantics::SValuePtr fpValue,
SgAsmFloatType fpType 
)
virtual

Whether a floating-point value is equal to zero.

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

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::fpIsInfinity ( const BaseSemantics::SValuePtr fpValue,
SgAsmFloatType fpType 
)
virtual

Whether a floating-point value is infinity.

Returns true if the floating point value is plus or minus infinity. Querying the sign bit will return the sign of the infinity.

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

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::fpSign ( const BaseSemantics::SValuePtr fpValue,
SgAsmFloatType fpType 
)
virtual

Sign of floating-point value.

Returns the value of the floating-point sign bit.

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

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::fpEffectiveExponent ( const BaseSemantics::SValuePtr fpValue,
SgAsmFloatType fpType 
)
virtual

Exponent of floating-point value.

Returns the exponent of the floating point value. For normalized values this returns the stored exponent minus the exponent bias. For denormalized numbers this returns the stored exponent minus the exponent bias minus an additional amount to normalize the significand.

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

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::fpAdd ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b,
SgAsmFloatType fpType 
)
virtual

Add two floating-point values.

Adds two floating-point values that have the same type and returns the sum in the same type.

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

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::fpSubtract ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b,
SgAsmFloatType fpType 
)
virtual

Subtract one floating-point value from another.

Subtracts b from a and returns the difference. All three floating-point values have the same type. The default implementation is in terms of negate and add.

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

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::fpMultiply ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b,
SgAsmFloatType fpType 
)
virtual

Multiply two floating-point values.

Multiplies two floating-point values and returns the product. All three values have the same type.

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

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::fpDivide ( const BaseSemantics::SValuePtr a,
const BaseSemantics::SValuePtr b,
SgAsmFloatType fpType 
)
virtual

Divide one floating-point value by another.

Computes a divided by b and returns the result. All three floating-point values have the same type.

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

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::fpSquareRoot ( const BaseSemantics::SValuePtr a,
SgAsmFloatType fpType 
)
virtual

Square root.

Computes and returns the square root of the specified floating-point value. Both values have the same type.

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

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::fpRoundTowardZero ( const BaseSemantics::SValuePtr a,
SgAsmFloatType fpType 
)
virtual

Round toward zero.

Truncate the fractional part of the floating point number.

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

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::readRegister ( RegisterDescriptor  reg,
const BaseSemantics::SValuePtr dflt 
)
virtual

Reads a value from a register.

The base implementation simply delegates to the current semantic State, which probably delegates to a register state, but subclasses are welcome to override this behavior at any level.

A register state will typically implement storage for hardware registers, but higher layers (the State, RiscOperators, Dispatcher, ...) should not be concerned about the size of the register they're trying to read. For example, a register state for a 32-bit x86 architecture will likely have a storage location for the 32-bit EAX register, but it should be possible to ask readRegister to return the value of AX (the low-order 16-bits). In order to accomplish this, some level of the readRegister delegations needs to invoke extract to obtain the low 16 bits. The RiscOperators object is passed along the delegation path for this purpose. The inverse concat operation will be needed at some level when we ask readRegister to return a value that comes from multiple storage locations in the register state (such as can happen if an x86 register state holds individual status flags and we ask for the 32-bit EFLAGS register).

If the register state can distinguish between a register that has never been accessed and a register that has only been read, then the dflt value is stored into the register the first time it's read. This ensures that reading the register a second time with no intervening write will return the same value as the first read. If a dflt is not provided then one is constructed by invoking undefined_.

There needs to be a certain level of cooperation between the RiscOperators, State, and register state classes to decide which layer should invoke the extract or concat (or whatever other RISC operations might be necessary).

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

Reimplemented in Rose::BinaryAnalysis::InstructionSemantics2::DataFlowSemantics::RiscOperators.

virtual void Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::writeRegister ( RegisterDescriptor  reg,
const BaseSemantics::SValuePtr a 
)
virtual

Writes a value to a register.

The base implementation simply delegates to the current semantic State, which probably delegates to a register state, but subclasses are welcome to override this behavior at any level.

As with readRegister, writeRegister may need to perform various RISC operations in order to accomplish the task of writing a value to the specified register when the underlying register state doesn't actually store a value for that specific register. The RiscOperations object is passed along for that purpose. See readRegister for more details.

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

Reimplemented in Rose::BinaryAnalysis::InstructionSemantics2::DataFlowSemantics::RiscOperators.

virtual BaseSemantics::SValuePtr Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::readMemory ( RegisterDescriptor  segreg,
const BaseSemantics::SValuePtr addr,
const BaseSemantics::SValuePtr dflt,
const BaseSemantics::SValuePtr cond 
)
virtual

Reads a value from memory.

The implementation (in subclasses) will typically delegate much of the work to the current state's readMemory method.

A MemoryState will implement storage for memory locations and might impose certain restrictions, such as "all memory values must be eight bits". However, the readMemory should not have these constraints so that it can be called from a variety of Dispatcher subclass (e.g., the DispatcherX86 class assumes that readMemory is capable of reading 32-bit values from little-endian memory). The designers of the MemoryState, State, and RiscOperators should collaborate to decide which layer (RiscOperators, State, or MemoryState) is reponsible for combining individual memory locations into larger values. A RiscOperators object is passed along the chain of delegations for this purpose. The RiscOperators might also contain other data that's import during the process, such as an SMT solver.

The segreg argument is an optional segment register. Most architectures have a flat virtual address space and will pass a default-constructed register descriptor whose is_valid() method returns false.

The cond argument is a Boolean value that indicates whether this is a true read operation. If cond can be proven to be false then the read is a no-op and returns an arbitrary value.

The dflt argument determines the size of the value to be read. This argument is also passed along to the lower layers so that they can, if they desire, use it to initialize memory that has never been read or written before.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

Reimplemented in Rose::BinaryAnalysis::InstructionSemantics2::DataFlowSemantics::RiscOperators.

virtual void Rose::BinaryAnalysis::InstructionSemantics2::MultiSemantics::RiscOperators::writeMemory ( RegisterDescriptor  segreg,
const BaseSemantics::SValuePtr addr,
const BaseSemantics::SValuePtr data,
const BaseSemantics::SValuePtr cond 
)
virtual

Writes a value to memory.

The implementation (in subclasses) will typically delegate much of the work to the current state's writeMemory method.

The segreg argument is an optional segment register. Most architectures have a flat virtual address space and will pass a default-constructed register descriptor whose is_valid() method returns false.

The cond argument is a Boolean value that indicates whether this is a true write operation. If cond can be proved to be false then writeMemory is a no-op.

Implements Rose::BinaryAnalysis::InstructionSemantics2::BaseSemantics::RiscOperators.

Reimplemented in Rose::BinaryAnalysis::InstructionSemantics2::DataFlowSemantics::RiscOperators.


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