ROSE  0.11.2.0
ConcreteSemantics2.h
1 #ifndef Rose_ConcreteSemantics2_H
2 #define Rose_ConcreteSemantics2_H
3 #include <rosePublicConfig.h>
4 #ifdef ROSE_BUILD_BINARY_ANALYSIS_SUPPORT
5 
6 #ifndef __STDC_FORMAT_MACROS
7 #define __STDC_FORMAT_MACROS
8 #endif
9 #include <inttypes.h>
10 
11 #include "integerOps.h"
12 #include "BaseSemantics2.h"
13 #include "RegisterStateGeneric.h"
14 #include <Sawyer/BitVector.h>
15 
16 namespace Rose {
17 namespace BinaryAnalysis { // documented elsewhere
18 namespace InstructionSemantics2 { // documented elsewhere
19 
24 namespace ConcreteSemantics {
25 
27 // Value type
29 
32 
34 typedef BaseSemantics::Formatter Formatter; // we might extend this in the future
35 
44 protected:
46 
48  // Real constructors
49 protected:
50  explicit SValue(size_t nbits): BaseSemantics::SValue(nbits), bits_(nbits) {}
51 
52  SValue(size_t nbits, uint64_t number): BaseSemantics::SValue(nbits) {
53  bits_ = Sawyer::Container::BitVector(nbits);
54  bits_.fromInteger(number);
55  }
56 
58  // Static allocating constructors
59 public:
61  static SValuePtr instance() {
62  return SValuePtr(new SValue(1));
63  }
64 
69  static SValuePtr instance(size_t nbits) {
70  return SValuePtr(new SValue(nbits));
71  }
72 
74  static SValuePtr instance(size_t nbits, uint64_t value) {
75  return SValuePtr(new SValue(nbits, value));
76  }
77 
79  // Virtual allocating constructors
80 public:
81  virtual BaseSemantics::SValuePtr undefined_(size_t nbits) const ROSE_OVERRIDE {
82  return instance(nbits);
83  }
84  virtual BaseSemantics::SValuePtr unspecified_(size_t nbits) const ROSE_OVERRIDE {
85  return instance(nbits);
86  }
87  virtual BaseSemantics::SValuePtr bottom_(size_t nbits) const ROSE_OVERRIDE {
88  return instance(nbits);
89  }
90  virtual BaseSemantics::SValuePtr number_(size_t nbits, uint64_t value) const ROSE_OVERRIDE {
91  return instance(nbits, value);
92  }
93  virtual BaseSemantics::SValuePtr boolean_(bool value) const ROSE_OVERRIDE {
94  return instance(1, value ? 1 : 0);
95  }
96  virtual BaseSemantics::SValuePtr copy(size_t new_width=0) const ROSE_OVERRIDE {
97  SValuePtr retval(new SValue(*this));
98  if (new_width!=0 && new_width!=retval->get_width())
99  retval->set_width(new_width);
100  return retval;
101  }
104  const SmtSolverPtr&) const ROSE_OVERRIDE;
105 
107  // Dynamic pointer casts
108 public:
110  static SValuePtr promote(const BaseSemantics::SValuePtr &v) { // hot
111  SValuePtr retval = v.dynamicCast<SValue>();
112  ASSERT_not_null(retval);
113  return retval;
114  }
115 
117  // Override virtual methods...
118 public:
119  virtual bool may_equal(const BaseSemantics::SValuePtr &other,
120  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE;
121  virtual bool must_equal(const BaseSemantics::SValuePtr &other,
122  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE;
123 
124  virtual void set_width(size_t nbits) ROSE_OVERRIDE;
125 
126  virtual bool isBottom() const ROSE_OVERRIDE {
127  return false;
128  }
129 
130  virtual bool is_number() const ROSE_OVERRIDE {
131  return true;
132  }
133 
134  virtual uint64_t get_number() const ROSE_OVERRIDE;
135 
136  virtual void print(std::ostream&, BaseSemantics::Formatter&) const ROSE_OVERRIDE;
137 
139  // Additional methods first declared in this class...
140 public:
144  virtual const Sawyer::Container::BitVector& bits() const { return bits_; }
145  virtual void bits(const Sawyer::Container::BitVector&);
147 };
148 
149 
151 // Register State
153 
154 typedef BaseSemantics::RegisterStateGeneric RegisterState;
155 typedef BaseSemantics::RegisterStateGenericPtr RegisterStatePtr;
156 
157 
159 // Memory State
161 
163 typedef boost::shared_ptr<class MemoryState> MemoryStatePtr;
164 
169 class MemoryState: public BaseSemantics::MemoryState {
170  MemoryMap::Ptr map_;
171  rose_addr_t pageSize_;
172 
174  // Real constructors
175 protected:
176  explicit MemoryState(const BaseSemantics::SValuePtr &addrProtoval, const BaseSemantics::SValuePtr &valProtoval)
177  : BaseSemantics::MemoryState(addrProtoval, valProtoval), pageSize_(4096) {
178  (void) SValue::promote(addrProtoval); // for its checking side effects
179  (void) SValue::promote(valProtoval);
180  }
181 
182  MemoryState(const MemoryState &other)
183  : BaseSemantics::MemoryState(other), map_(other.map_), pageSize_(other.pageSize_) {
184  if (map_) {
185  BOOST_FOREACH (MemoryMap::Segment &segment, map_->values())
186  segment.buffer()->copyOnWrite(true);
187  }
188  }
189 
191  // Static allocating constructors
192 public:
196  static MemoryStatePtr instance(const BaseSemantics::SValuePtr &addrProtoval, const BaseSemantics::SValuePtr &valProtoval) {
197  return MemoryStatePtr(new MemoryState(addrProtoval, valProtoval));
198  }
199 
204  static MemoryStatePtr instance(const MemoryStatePtr &other) {
205  return MemoryStatePtr(new MemoryState(*other));
206  }
207 
209  // Virtual constructors
210 public:
216  const BaseSemantics::SValuePtr &valProtoval) const ROSE_OVERRIDE {
217  return instance(addrProtoval, valProtoval);
218  }
219 
225  virtual BaseSemantics::MemoryStatePtr clone() const ROSE_OVERRIDE {
226  return MemoryStatePtr(new MemoryState(*this));
227  }
228 
230  // Dynamic pointer casts
231 public:
234  static MemoryStatePtr promote(const BaseSemantics::MemoryStatePtr &x) {
235  MemoryStatePtr retval = boost::dynamic_pointer_cast<MemoryState>(x);
236  ASSERT_not_null(retval);
237  return retval;
238  }
239 
241  // Methods we inherited
242 public:
243  virtual void clear() ROSE_OVERRIDE {
244  map_ = MemoryMap::Ptr();
245  }
246 
247  virtual void print(std::ostream&, Formatter&) const ROSE_OVERRIDE;
248 
249  virtual BaseSemantics::SValuePtr readMemory(const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt,
250  BaseSemantics::RiscOperators *addrOps,
251  BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE;
252 
253  virtual BaseSemantics::SValuePtr peekMemory(const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt,
254  BaseSemantics::RiscOperators *addrOps,
255  BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE;
256 
257  virtual void writeMemory(const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &value,
258  BaseSemantics::RiscOperators *addrOps, BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE;
259 
260  virtual bool merge(const BaseSemantics::MemoryStatePtr &other, BaseSemantics::RiscOperators *addrOps,
261  BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE;
262 
263 protected:
264  BaseSemantics::SValuePtr readOrPeekMemory(const BaseSemantics::SValuePtr &addr,
265  const BaseSemantics::SValuePtr &dflt,
266  BaseSemantics::RiscOperators *addrOps,
267  BaseSemantics::RiscOperators *valOps,
268  bool allowSideEffects);
269 
271  // Methods first declared in this class
272 public:
274  const MemoryMap::Ptr memoryMap() const { return map_; }
275 
282 
289  rose_addr_t pageSize() const { return pageSize_; }
290  void pageSize(rose_addr_t nBytes);
297  void allocatePage(rose_addr_t va);
298 
299 };
300 
301 
303 // Complete semantic state
305 
306 typedef BaseSemantics::State State;
307 typedef BaseSemantics::StatePtr StatePtr;
308 
309 
311 // RISC operators
313 
315 typedef boost::shared_ptr<class RiscOperators> RiscOperatorsPtr;
316 
336  // Real constructors
337 protected:
339  : BaseSemantics::RiscOperators(protoval, solver) {
340  name("Concrete");
341  (void) SValue::promote(protoval); // make sure its dynamic type is a ConcreteSemantics::SValue
342  }
343 
344  RiscOperators(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver)
345  : BaseSemantics::RiscOperators(state, solver) {
346  name("Concrete");
347  (void) SValue::promote(state->protoval()); // values must have ConcreteSemantics::SValue dynamic type
348  }
349 
351  // Static allocating constructors
352 public:
355  static RiscOperatorsPtr instance(const RegisterDictionary *regdict, const SmtSolverPtr &solver = SmtSolverPtr()) {
357  BaseSemantics::RegisterStatePtr registers = RegisterState::instance(protoval, regdict);
358  BaseSemantics::MemoryStatePtr memory = MemoryState::instance(protoval, protoval);
359  BaseSemantics::StatePtr state = State::instance(registers, memory);
360  return RiscOperatorsPtr(new RiscOperators(state, solver));
361  }
362 
366  static RiscOperatorsPtr instance(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver = SmtSolverPtr()) {
367  return RiscOperatorsPtr(new RiscOperators(protoval, solver));
368  }
369 
372  static RiscOperatorsPtr instance(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver = SmtSolverPtr()) {
373  return RiscOperatorsPtr(new RiscOperators(state, solver));
374  }
375 
377  // Virtual constructors
378 public:
380  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
381  return instance(protoval, solver);
382  }
383 
385  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
386  return instance(state, solver);
387  }
388 
390  // Dynamic pointer casts
391 public:
394  static RiscOperatorsPtr promote(const BaseSemantics::RiscOperatorsPtr &x) {
395  RiscOperatorsPtr retval = boost::dynamic_pointer_cast<RiscOperators>(x);
396  ASSERT_not_null(retval);
397  return retval;
398  }
399 
401  // New methods for constructing values, so we don't have to write so many SValue::promote calls in the RiscOperators
402  // implementations.
403 protected:
404  SValuePtr svalue_number(size_t nbits, uint64_t value) {
405  return SValue::promote(number_(nbits, value));
406  }
407 
408  SValuePtr svalue_number(const Sawyer::Container::BitVector&);
409 
410  SValuePtr svalue_boolean(bool b) {
411  return SValue::promote(boolean_(b));
412  }
413 
414  SValuePtr svalue_zero(size_t nbits) {
415  return SValue::promote(number_(nbits, 0));
416  }
417 
419  // Override methods from base class. These are the RISC operators that are invoked by a Dispatcher.
420 public:
421  virtual void interrupt(int majr, int minr) ROSE_OVERRIDE;
422  virtual BaseSemantics::SValuePtr and_(const BaseSemantics::SValuePtr &a_,
423  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
425  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
426  virtual BaseSemantics::SValuePtr xor_(const BaseSemantics::SValuePtr &a_,
427  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
428  virtual BaseSemantics::SValuePtr invert(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
429  virtual BaseSemantics::SValuePtr extract(const BaseSemantics::SValuePtr &a_,
430  size_t begin_bit, size_t end_bit) ROSE_OVERRIDE;
431  virtual BaseSemantics::SValuePtr concat(const BaseSemantics::SValuePtr &a_,
432  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
433  virtual BaseSemantics::SValuePtr leastSignificantSetBit(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
434  virtual BaseSemantics::SValuePtr mostSignificantSetBit(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
435  virtual BaseSemantics::SValuePtr rotateLeft(const BaseSemantics::SValuePtr &a_,
436  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
437  virtual BaseSemantics::SValuePtr rotateRight(const BaseSemantics::SValuePtr &a_,
438  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
439  virtual BaseSemantics::SValuePtr shiftLeft(const BaseSemantics::SValuePtr &a_,
440  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
441  virtual BaseSemantics::SValuePtr shiftRight(const BaseSemantics::SValuePtr &a_,
442  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
443  virtual BaseSemantics::SValuePtr shiftRightArithmetic(const BaseSemantics::SValuePtr &a_,
444  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
445  virtual BaseSemantics::SValuePtr equalToZero(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
446  virtual BaseSemantics::SValuePtr ite(const BaseSemantics::SValuePtr &sel_,
447  const BaseSemantics::SValuePtr &a_,
448  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
449  virtual BaseSemantics::SValuePtr unsignedExtend(const BaseSemantics::SValuePtr &a_, size_t new_width) ROSE_OVERRIDE;
450  virtual BaseSemantics::SValuePtr signExtend(const BaseSemantics::SValuePtr &a_, size_t new_width) ROSE_OVERRIDE;
452  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
454  const BaseSemantics::SValuePtr &b_,
455  const BaseSemantics::SValuePtr &c_,
456  BaseSemantics::SValuePtr &carry_out/*out*/) ROSE_OVERRIDE;
457  virtual BaseSemantics::SValuePtr negate(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
459  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
461  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
463  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
465  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
467  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
469  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
470 
471  virtual BaseSemantics::SValuePtr fpFromInteger(const BaseSemantics::SValuePtr &intValue, SgAsmFloatType*) ROSE_OVERRIDE;
472  virtual BaseSemantics::SValuePtr fpToInteger(const BaseSemantics::SValuePtr &fpValue, SgAsmFloatType *fpType,
473  const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE;
474  virtual BaseSemantics::SValuePtr fpAdd(const BaseSemantics::SValuePtr &a, const BaseSemantics::SValuePtr &b,
475  SgAsmFloatType*) ROSE_OVERRIDE;
476  virtual BaseSemantics::SValuePtr fpSubtract(const BaseSemantics::SValuePtr &a, const BaseSemantics::SValuePtr &b,
477  SgAsmFloatType*) ROSE_OVERRIDE;
478  virtual BaseSemantics::SValuePtr fpMultiply(const BaseSemantics::SValuePtr &a, const BaseSemantics::SValuePtr &b,
479  SgAsmFloatType*) ROSE_OVERRIDE;
480  virtual BaseSemantics::SValuePtr fpRoundTowardZero(const BaseSemantics::SValuePtr &a, SgAsmFloatType*) ROSE_OVERRIDE;
481 
482  virtual BaseSemantics::SValuePtr readMemory(RegisterDescriptor segreg,
483  const BaseSemantics::SValuePtr &addr,
484  const BaseSemantics::SValuePtr &dflt,
485  const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE;
486  virtual BaseSemantics::SValuePtr peekMemory(RegisterDescriptor segreg,
487  const BaseSemantics::SValuePtr &addr,
488  const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE;
489  virtual void writeMemory(RegisterDescriptor segreg,
490  const BaseSemantics::SValuePtr &addr,
491  const BaseSemantics::SValuePtr &data,
492  const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE;
493 
494 protected:
495  // handles readMemory and peekMemory
496  BaseSemantics::SValuePtr readOrPeekMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &address,
497  const BaseSemantics::SValuePtr &dflt, bool allowSideEffects);
498 
499  // Convert expression to double
500  double exprToDouble(const BaseSemantics::SValuePtr &expr, SgAsmFloatType*);
501 
502  // Convert double to expression
503  BaseSemantics::SValuePtr doubleToExpr(double d, SgAsmFloatType*);
504 };
505 
506 } // namespace
507 } // namespace
508 } // namespace
509 } // namespace
510 
511 #endif
512 #endif
static RegisterStateGenericPtr instance(const SValuePtr &protoval, const RegisterDictionary *regdict)
Instantiate a new register state.
Defines RISC operators for the ConcreteSemantics domain.
boost::shared_ptr< RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to a RISC operators object.
static MemoryStatePtr instance(const MemoryStatePtr &other)
Instantiates a new deep copy of an existing state.
virtual BaseSemantics::SValuePtr copy(size_t new_width=0) const ROSE_OVERRIDE
Create a new value from an existing value, changing the width if new_width is non-zero.
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.
virtual void print(std::ostream &, BaseSemantics::Formatter &) const ROSE_OVERRIDE
Print a value to a stream using default format.
boost::shared_ptr< class RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to concrete RISC operations.
boost::shared_ptr< class RegisterStateGeneric > RegisterStateGenericPtr
Shared-ownership pointer to generic register states.
static SValuePtr instance()
Instantiate a new prototypical value.
virtual BaseSemantics::SValuePtr negate(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE
Two's complement.
virtual BaseSemantics::SValuePtr signedDivide(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Divides two signed values.
virtual void writeMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &data, const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE
Writes a value to memory.
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 ...
virtual BaseSemantics::SValuePtr fpRoundTowardZero(const BaseSemantics::SValuePtr &a, SgAsmFloatType *) ROSE_OVERRIDE
Round toward zero.
Type of values manipulated by the concrete domain.
boost::shared_ptr< MemoryState > MemoryStatePtr
Shared-ownership pointer to a memory state.
virtual BaseSemantics::RiscOperatorsPtr create(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Virtual allocating constructor.
boost::shared_ptr< State > StatePtr
Shared-ownership pointer to a semantic state.
static RiscOperatorsPtr promote(const BaseSemantics::RiscOperatorsPtr &x)
Run-time promotion of a base RiscOperators pointer to concrete operators.
STL namespace.
Holds a value or nothing.
Definition: Optional.h:49
Buffer< A, T >::Ptr buffer() const
Property: buffer.
virtual const Sawyer::Container::BitVector & bits() const
Returns the bit vector storing the concrete value.
virtual uint64_t get_number() const ROSE_OVERRIDE
Return the concrete number for this value.
virtual BaseSemantics::SValuePtr unsignedModulo(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Calculates modulo with unsigned values.
bool copyOnWrite() const
Property: Copy on write.
Definition: Buffer.h:127
virtual SValuePtr protoval() const
Property: Prototypical semantic value.
virtual BaseSemantics::SValuePtr fpMultiply(const BaseSemantics::SValuePtr &a, const BaseSemantics::SValuePtr &b, SgAsmFloatType *) ROSE_OVERRIDE
Multiply two floating-point values.
virtual bool is_number() const ROSE_OVERRIDE
Determines if the value is a concrete number.
Main namespace for the ROSE library.
virtual BaseSemantics::MemoryStatePtr create(const BaseSemantics::SValuePtr &addrProtoval, const BaseSemantics::SValuePtr &valProtoval) const ROSE_OVERRIDE
Virtual constructor.
virtual void interrupt(int majr, int minr) ROSE_OVERRIDE
Invoked for instructions that cause an interrupt.
Reference-counting intrusive smart pointer.
Definition: SharedPointer.h:68
BitVector & fromInteger(const BitRange &range, boost::uint64_t value)
Obtain bits from an integer.
Definition: BitVector.h:1308
Name space for the entire library.
virtual BaseSemantics::SValuePtr signedModulo(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Calculates modulo with signed values.
Sawyer::SharedPointer< class SmtSolver > SmtSolverPtr
Reference-counting pointer for SMT solvers.
virtual BaseSemantics::SValuePtr fpToInteger(const BaseSemantics::SValuePtr &fpValue, SgAsmFloatType *fpType, const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE
Construct an integer value from a floating-point value.
virtual BaseSemantics::SValuePtr boolean_(bool value) const ROSE_OVERRIDE
Create a new, Boolean value.
virtual BaseSemantics::SValuePtr unsignedDivide(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Divides two unsigned values.
Sawyer::SharedPointer< class SValue > SValuePtr
Smart-ownership pointer to a concrete semantic value.
virtual BaseSemantics::SValuePtr number_(size_t nbits, uint64_t value) const ROSE_OVERRIDE
Create a new concrete semantic value.
virtual BaseSemantics::SValuePtr undefined_(size_t nbits) const ROSE_OVERRIDE
Create a new undefined semantic value.
static SValuePtr instance(size_t nbits)
Instantiate a new undefined value of specified width.
boost::shared_ptr< class MemoryState > MemoryStatePtr
Shared-ownership pointer to a concrete memory state.
static RiscOperatorsPtr instance(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr())
Instantiates a new RiscOperators object with specified prototypical values.
virtual BaseSemantics::SValuePtr fpFromInteger(const BaseSemantics::SValuePtr &intValue, SgAsmFloatType *) ROSE_OVERRIDE
Construct a floating-point value from an integer value.
virtual void set_width(size_t nbits) ROSE_OVERRIDE
Accessor for value width.
virtual BaseSemantics::SValuePtr fpAdd(const BaseSemantics::SValuePtr &a, const BaseSemantics::SValuePtr &b, SgAsmFloatType *) ROSE_OVERRIDE
Add two floating-point values.
virtual bool may_equal(const BaseSemantics::SValuePtr &other, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Returns true if two values could be equal.
virtual BaseSemantics::RiscOperatorsPtr create(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Virtual allocating constructor.
An efficient mapping from an address space to stored data.
Definition: MemoryMap.h:112
virtual BaseSemantics::SValuePtr unsignedMultiply(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Multiply two unsigned values.
virtual BaseSemantics::SValuePtr unspecified_(size_t nbits) const ROSE_OVERRIDE
Create a new unspecified semantic value.
static SValuePtr promote(const BaseSemantics::SValuePtr &v)
Promote a base value to a SymbolicSemantics value.
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.
static MemoryStatePtr instance(const BaseSemantics::SValuePtr &addrProtoval, const BaseSemantics::SValuePtr &valProtoval)
Instantiates a new memory state having specified prototypical value.
SharedPointer< U > dynamicCast() const
Dynamic cast.
Base class for most instruction semantics RISC operators.
static RiscOperatorsPtr instance(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr())
Instantiates a new RiscOperators object with specified state.
virtual Sawyer::Optional< BaseSemantics::SValuePtr > createOptionalMerge(const BaseSemantics::SValuePtr &other, const BaseSemantics::MergerPtr &, const SmtSolverPtr &) const ROSE_OVERRIDE
Possibly create a new value by merging two existing values.
const MemoryMap::Ptr memoryMap() const
Returns the memory map.
virtual bool must_equal(const BaseSemantics::SValuePtr &other, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Returns true if two values must be equal.
virtual BaseSemantics::SValuePtr peekMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE
Read memory without side effects.
static SValuePtr instance(size_t nbits, uint64_t value)
Instantiate a new concrete value.
Defines registers available for a particular architecture.
Definition: Registers.h:38
virtual SmtSolverPtr solver() const
Property: Satisfiability module theory (SMT) solver.
virtual BaseSemantics::SValuePtr bottom_(size_t nbits) const ROSE_OVERRIDE
Data-flow bottom value.
Represents no value.
Definition: Optional.h:32
void allocatePage(rose_addr_t va)
Allocate a page of memory.
virtual const std::string & name() const
Property: Name used for debugging.
BaseSemantics::Formatter Formatter
Formatter for symbolic values.
virtual BaseSemantics::SValuePtr signedMultiply(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Multiplies two signed values.
Floating point types.
boost::shared_ptr< RegisterState > RegisterStatePtr
Shared-ownership pointer to a register state.
virtual BaseSemantics::SValuePtr fpSubtract(const BaseSemantics::SValuePtr &a, const BaseSemantics::SValuePtr &b, SgAsmFloatType *) ROSE_OVERRIDE
Subtract one floating-point value from another.
virtual BaseSemantics::MemoryStatePtr clone() const ROSE_OVERRIDE
Virtual copy constructor.
static MemoryStatePtr promote(const BaseSemantics::MemoryStatePtr &x)
Recasts a base pointer to a concrete memory state.
virtual bool isBottom() const ROSE_OVERRIDE
Determines whether a value is a data-flow bottom.