ROSE  0.11.51.0
NullSemantics.h
1 #ifndef ROSE_BinaryAnalysis_InstructionSemantics2_NullSemantics_H
2 #define ROSE_BinaryAnalysis_InstructionSemantics2_NullSemantics_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
5 
6 #include <Rose/BinaryAnalysis/InstructionSemantics2/BaseSemantics.h>
7 
8 namespace Rose {
9 namespace BinaryAnalysis { // documented elsewhere
10 namespace InstructionSemantics2 { // documented elsewhere
11 
12 
17 namespace NullSemantics {
18 
20 // Semantic values
22 
25 
28 public:
31 
33  using Ptr = SValuePtr;
34 
36  // Real constructors.
37 protected:
38  explicit SValue(size_t nbits): BaseSemantics::SValue(nbits) {}
39 
41  // Static allocating constructors
42 public:
44  static SValuePtr instance() {
45  return SValuePtr(new SValue(1));
46  }
47 
49  static SValuePtr instance(size_t nbits) {
50  return SValuePtr(new SValue(nbits));
51  }
52 
54  static SValuePtr instance(size_t nbits, uint64_t number) {
55  return SValuePtr(new SValue(nbits)); // the number is not important in this domain
56  }
57 
59  static SValuePtr instance(const SValuePtr &other) {
60  return SValuePtr(new SValue(*other));
61  }
62 
64  // Virtual constructors
65 public:
66  virtual BaseSemantics::SValuePtr bottom_(size_t nBits) const ROSE_OVERRIDE {
67  return instance(nBits);
68  }
69  virtual BaseSemantics::SValuePtr undefined_(size_t nBits) const ROSE_OVERRIDE {
70  return instance(nBits);
71  }
72  virtual BaseSemantics::SValuePtr unspecified_(size_t nBits) const ROSE_OVERRIDE {
73  return instance(nBits);
74  }
75  virtual BaseSemantics::SValuePtr number_(size_t nBits, uint64_t number) const ROSE_OVERRIDE {
76  return instance(nBits, number);
77  }
78  virtual BaseSemantics::SValuePtr copy(size_t new_width=0) const ROSE_OVERRIDE {
79  SValuePtr retval(new SValue(*this));
80  if (new_width!=0 && new_width!=retval->nBits())
81  retval->set_width(new_width);
82  return retval;
83  }
86  const SmtSolverPtr&) const ROSE_OVERRIDE {
87  return Sawyer::Nothing();
88  }
89 
91  // Dynamic pointer casting
92 public:
94  static SValuePtr promote(const BaseSemantics::SValuePtr &v) {
95  SValuePtr retval = v.dynamicCast<SValue>();
96  ASSERT_not_null(retval);
97  return retval;
98  }
99 
101  // Implementations of functions inherited
102 public:
103  virtual bool isBottom() const ROSE_OVERRIDE {
104  return false;
105  }
106 
107  virtual void print(std::ostream &stream, BaseSemantics::Formatter&) const ROSE_OVERRIDE {
108  stream <<"VOID[" <<nBits() <<"]";
109  }
110 
111  virtual void hash(Combinatorics::Hasher &hasher) const override {
112  hasher.insert(0); // hash depends on number of SValues hashed, but not any content
113  }
114 
116  // Override legacy members. These now are called by the camelCase names in the base class. Eventually we'll switch the
117  // camelCase names to be the virtual functions and get rid of the snake_case names, so be sure to specify "override" in
118  // your own code so you know when we make the switch.
119 public:
120  // See isConcrete
121  virtual bool is_number() const ROSE_OVERRIDE {
122  return false;
123  }
124 
125  // See toUnsigned and toSigned
126  virtual uint64_t get_number() const ROSE_OVERRIDE {
127  ASSERT_not_reachable("not a number");
128  uint64_t retval;
129  return retval;
130  }
131 
132  // See mayEqual
133  virtual bool may_equal(const BaseSemantics::SValuePtr &other,
134  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
135  return true;
136  }
137 
138  // See mustEqual
139  virtual bool must_equal(const BaseSemantics::SValuePtr &other,
140  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
141  return this == getRawPointer(other); // must be equal if they're both the same object
142  }
143 
144 };
145 
146 
148 // Register state
150 
152 typedef boost::shared_ptr<class RegisterState> RegisterStatePtr;
153 
158 public:
161 
164 
165 protected:
166  RegisterState(const RegisterState &other)
167  : BaseSemantics::RegisterState(other) {}
168 
170  : BaseSemantics::RegisterState(protoval, regdict) {}
171 
172 public:
173  static RegisterStatePtr instance(const BaseSemantics::SValuePtr &protoval, const RegisterDictionary *regdict) {
174  return RegisterStatePtr(new RegisterState(protoval, regdict));
175  }
176 
178  const RegisterDictionary *regdict) const ROSE_OVERRIDE {
179  return instance(protoval, regdict);
180  }
181 
182  virtual BaseSemantics::RegisterStatePtr clone() const ROSE_OVERRIDE {
183  return RegisterStatePtr(new RegisterState(*this));
184  }
185 
186  static RegisterStatePtr promote(const BaseSemantics::RegisterStatePtr &from) {
187  RegisterStatePtr retval = boost::dynamic_pointer_cast<RegisterState>(from);
188  ASSERT_not_null(retval);
189  return retval;
190  }
191 
192  virtual bool merge(const BaseSemantics::RegisterStatePtr &other_, BaseSemantics::RiscOperators*) ROSE_OVERRIDE {
193  return false;
194  }
195 
196  virtual void clear() ROSE_OVERRIDE {}
197  virtual void zero() ROSE_OVERRIDE {}
198 
201  BaseSemantics::RiscOperators *ops) ROSE_OVERRIDE {
202  return protoval()->undefined_(reg.nBits());
203  }
204 
207  BaseSemantics::RiscOperators *ops) ROSE_OVERRIDE {
208  return protoval()->undefined_(reg.nBits());
209  }
210 
212  BaseSemantics::RiscOperators *ops) ROSE_OVERRIDE {}
213 
214  virtual void hash(Combinatorics::Hasher&, BaseSemantics::RiscOperators*) const override {}
215 
216  virtual void print(std::ostream&, BaseSemantics::Formatter&) const ROSE_OVERRIDE {}
217 };
218 
219 
221 // Memory state
223 
225 typedef boost::shared_ptr<class MemoryState> MemoryStatePtr;
226 
231 public:
234 
237 
238 protected:
239  MemoryState(const BaseSemantics::SValuePtr &addrProtoval, const BaseSemantics::SValuePtr &valProtoval)
240  : BaseSemantics::MemoryState(addrProtoval, valProtoval) {}
241 
242  MemoryState(const MemoryStatePtr &other)
243  : BaseSemantics::MemoryState(other) {}
244 
245 public:
246  static MemoryStatePtr instance(const BaseSemantics::SValuePtr &addrProtoval, const BaseSemantics::SValuePtr &valProtoval) {
247  return MemoryStatePtr(new MemoryState(addrProtoval, valProtoval));
248  }
249 
250 public:
252  const BaseSemantics::SValuePtr &valProtoval) const ROSE_OVERRIDE {
253  return instance(addrProtoval, valProtoval);
254  }
255 
256  virtual BaseSemantics::MemoryStatePtr clone() const ROSE_OVERRIDE {
257  return MemoryStatePtr(new MemoryState(*this));
258  }
259 
260 public:
261  static MemoryStatePtr promote(const BaseSemantics::MemoryStatePtr &x) {
262  MemoryStatePtr retval = boost::dynamic_pointer_cast<MemoryState>(x);
263  ASSERT_not_null(x);
264  return retval;
265  }
266 
267 public:
268  virtual void clear() ROSE_OVERRIDE {}
269 
272  BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE {
273  return dflt->copy();
274  }
275 
276  virtual void writeMemory(const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &value,
277  BaseSemantics::RiscOperators *addrOps, BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE {}
278 
281  BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE {
282  return dflt->copy();
283  }
284 
286  BaseSemantics::RiscOperators *valOps) const override {}
287 
288  virtual void print(std::ostream&, BaseSemantics::Formatter&) const ROSE_OVERRIDE {}
289 
291  BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE {
292  return false;
293  }
294 };
295 
296 
298 // Complete state
300 
301 typedef BaseSemantics::State State;
302 typedef BaseSemantics::StatePtr StatePtr;
303 
304 
306 // RISC operators
308 
310 typedef boost::shared_ptr<class RiscOperators> RiscOperatorsPtr;
311 
314 public:
317 
320 
322  // Real constructors
323 protected:
325  : BaseSemantics::RiscOperators(protoval, solver) {
326  name("Null");
327  }
328  explicit RiscOperators(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver = SmtSolverPtr())
329  : BaseSemantics::RiscOperators(state, solver) {
330  name("Null");
331  }
332 
334  // Static allocating constructors
335 public:
338  static RiscOperatorsPtr instance(const RegisterDictionary *regdict);
339 
341  static RiscOperatorsPtr instance(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver = SmtSolverPtr()) {
342  return RiscOperatorsPtr(new RiscOperators(protoval, solver));
343  }
344 
346  static RiscOperatorsPtr instance(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver = SmtSolverPtr()) {
347  return RiscOperatorsPtr(new RiscOperators(state, solver));
348  }
349 
351  // Virtual constructors
352 public:
354  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
355  return instance(protoval, solver);
356  }
357 
359  const SmtSolverPtr &solver = SmtSolverPtr()) const ROSE_OVERRIDE {
360  return instance(state, solver);
361  }
362 
364  // Risc operators inherited
365 public:
367  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
368 
370  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
371 
373  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
374 
375  virtual BaseSemantics::SValuePtr invert(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
376 
378  size_t begin_bit, size_t end_bit) ROSE_OVERRIDE;
379 
381  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
382 
384 
386 
388  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
389 
391  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
392 
394  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
395 
397  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
398 
400  const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE;
401 
402  virtual BaseSemantics::SValuePtr equalToZero(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
403 
405  const BaseSemantics::SValuePtr &a_,
406  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
407 
408  virtual BaseSemantics::SValuePtr signExtend(const BaseSemantics::SValuePtr &a_, size_t new_width) ROSE_OVERRIDE;
409 
411  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
412 
414  const BaseSemantics::SValuePtr &b_,
415  const BaseSemantics::SValuePtr &c_,
416  BaseSemantics::SValuePtr &carry_out/*out*/) ROSE_OVERRIDE;
417 
418  virtual BaseSemantics::SValuePtr negate(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE;
419 
421  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
422 
424  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
425 
427  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
428 
430  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
431 
433  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
434 
436  const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE;
437 
439  const BaseSemantics::SValuePtr &addr,
440  const BaseSemantics::SValuePtr &dflt,
441  const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE;
442 
444  const BaseSemantics::SValuePtr &addr,
445  const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE;
446 
447  virtual void writeMemory(RegisterDescriptor segreg,
448  const BaseSemantics::SValuePtr &addr,
449  const BaseSemantics::SValuePtr &data,
450  const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE;
451 };
452 
453 } // namespace
454 } // namespace
455 } // namespace
456 } // namespace
457 
458 #endif
459 #endif
virtual BaseSemantics::SValuePtr peekMemory(const BaseSemantics::SValuePtr &address, const BaseSemantics::SValuePtr &dflt, BaseSemantics::RiscOperators *addrOps, BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE
Read a value from memory without side effects.
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.
Definition: NullSemantics.h:78
boost::shared_ptr< RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to a RISC operators object.
virtual BaseSemantics::SValuePtr add(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Adds two integers of equal size.
virtual uint64_t get_number() const ROSE_OVERRIDE
Virtual API.
virtual BaseSemantics::SValuePtr peekMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &dflt) ROSE_OVERRIDE
Read memory without side effects.
static RiscOperatorsPtr instance(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr())
Constructor.
virtual void print(std::ostream &, BaseSemantics::Formatter &) const ROSE_OVERRIDE
Print the register contents.
virtual BaseSemantics::SValuePtr shiftRightArithmetic(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE
Returns arg shifted right arithmetically (with sign bit).
virtual BaseSemantics::SValuePtr and_(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Computes bit-wise AND of two values.
virtual void hash(Combinatorics::Hasher &hasher) const override
Hash this semantic value.
virtual BaseSemantics::SValuePtr concat(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Concatenates the bits of two values.
virtual BaseSemantics::SValuePtr readRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &dflt, BaseSemantics::RiscOperators *ops) ROSE_OVERRIDE
Read a value from a register.
virtual BaseSemantics::SValuePtr undefined_(size_t nBits) const ROSE_OVERRIDE
Create a new undefined semantic value.
Definition: NullSemantics.h:69
virtual BaseSemantics::RiscOperatorsPtr create(const BaseSemantics::StatePtr &state, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Virtual allocating constructor.
virtual bool is_number() const ROSE_OVERRIDE
Virtual API.
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.
Definition: NullSemantics.h:85
void insert(const std::string &x)
Insert data into the digest.
virtual BaseSemantics::SValuePtr extract(const BaseSemantics::SValuePtr &a_, size_t begin_bit, size_t end_bit) ROSE_OVERRIDE
Extracts bits from a value.
static SValuePtr instance()
Instantiate a new prototypical values.
Definition: NullSemantics.h:44
virtual BaseSemantics::SValuePtr signedModulo(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Calculates modulo with signed values.
boost::shared_ptr< class RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to null RISC operations.
boost::shared_ptr< MemoryState > MemoryStatePtr
Shared-ownership pointer to a memory state.
boost::shared_ptr< State > StatePtr
Shared-ownership pointer to a semantic state.
virtual BaseSemantics::SValuePtr leastSignificantSetBit(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE
Returns position of least significant set bit; zero when no bits are set.
Holds a value or nothing.
Definition: Optional.h:49
virtual BaseSemantics::SValuePtr mostSignificantSetBit(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE
Returns position of most significant set bit; zero when no bits are set.
virtual BaseSemantics::SValuePtr rotateRight(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE
Rotate bits to the right.
virtual SValuePtr protoval() const
Property: Prototypical semantic value.
boost::shared_ptr< class MemoryState > MemoryStatePtr
Shared-ownership pointer to null register state.
Main namespace for the ROSE library.
virtual BaseSemantics::SValuePtr ite(const BaseSemantics::SValuePtr &sel_, const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
If-then-else.
static RiscOperatorsPtr instance(const RegisterDictionary *regdict)
Instantiate a new RiscOperators object and configures it to use semantic values and states that are d...
virtual void hash(Combinatorics::Hasher &, BaseSemantics::RiscOperators *) const override
Hash the register state.
virtual BaseSemantics::RiscOperatorsPtr create(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Virtual allocating constructor.
virtual BaseSemantics::SValuePtr negate(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE
Two's complement.
virtual BaseSemantics::RegisterStatePtr clone() const ROSE_OVERRIDE
Make a copy of this register state.
Reference-counting intrusive smart pointer.
Definition: SharedPointer.h:68
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.
virtual BaseSemantics::RegisterStatePtr create(const BaseSemantics::SValuePtr &protoval, const RegisterDictionary *regdict) const ROSE_OVERRIDE
Virtual constructor.
boost::shared_ptr< class RegisterState > RegisterStatePtr
Shared-ownership pointer to null register state.
virtual void writeMemory(RegisterDescriptor segreg, const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &data, const BaseSemantics::SValuePtr &cond) ROSE_OVERRIDE
Writes a value to memory.
virtual BaseSemantics::SValuePtr readMemory(const BaseSemantics::SValuePtr &address, const BaseSemantics::SValuePtr &dflt, BaseSemantics::RiscOperators *addrOps, BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE
Read a value from memory.
virtual BaseSemantics::SValuePtr unsignedMultiply(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Multiply two unsigned values.
virtual BaseSemantics::SValuePtr signExtend(const BaseSemantics::SValuePtr &a_, size_t new_width) ROSE_OVERRIDE
Sign extends a value.
virtual BaseSemantics::SValuePtr unspecified_(size_t nBits) const ROSE_OVERRIDE
Create a new unspecified semantic value.
Definition: NullSemantics.h:72
Base classes for instruction semantics.
Definition: Dispatcher.h:18
Describes (part of) a physical CPU register.
virtual bool may_equal(const BaseSemantics::SValuePtr &other, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Virtual API.
Base class for semantics machine states.
Definition: State.h:39
virtual bool merge(const BaseSemantics::RegisterStatePtr &other_, BaseSemantics::RiscOperators *) ROSE_OVERRIDE
Merge register states for data flow analysis.
static RiscOperatorsPtr instance(const BaseSemantics::SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr())
Static allocating constructor.
NullSemantics operators always return a new undefined value.
static SValuePtr instance(size_t nbits)
Instantiate a new undefined value.
Definition: NullSemantics.h:49
virtual BaseSemantics::SValuePtr signedMultiply(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Multiplies two signed values.
virtual bool must_equal(const BaseSemantics::SValuePtr &other, const SmtSolverPtr &solver=SmtSolverPtr()) const ROSE_OVERRIDE
Virtual API.
virtual void zero() ROSE_OVERRIDE
Set all registers to the zero.
virtual void print(std::ostream &stream, BaseSemantics::Formatter &) const ROSE_OVERRIDE
Print a value to a stream using default format.
virtual bool merge(const BaseSemantics::MemoryStatePtr &other, BaseSemantics::RiscOperators *addrOps, BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE
Merge memory states for data flow analysis.
virtual void print(std::ostream &, BaseSemantics::Formatter &) const ROSE_OVERRIDE
Print a memory state to more than one line of output.
virtual BaseSemantics::SValuePtr xor_(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Computes bit-wise XOR of two values.
virtual BaseSemantics::SValuePtr unsignedDivide(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Divides two unsigned values.
virtual void hash(Combinatorics::Hasher &, BaseSemantics::RiscOperators *addrOps, BaseSemantics::RiscOperators *valOps) const override
Calculate a hash for this memory state.
virtual BaseSemantics::SValuePtr number_(size_t nBits, uint64_t number) const ROSE_OVERRIDE
Create a new concrete semantic value.
Definition: NullSemantics.h:75
SharedPointer< U > dynamicCast() const
Dynamic cast.
Base class for most instruction semantics RISC operators.
Definition: RiscOperators.h:48
virtual BaseSemantics::SValuePtr peekRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &dflt, BaseSemantics::RiscOperators *ops) ROSE_OVERRIDE
Read a register without side effects.
const RegisterDictionary * regdict
Registers that are able to be stored by this state.
Definition: RegisterState.h:39
static SValuePtr instance(size_t nbits, uint64_t number)
Instantiate a new concrete value.
Definition: NullSemantics.h:54
virtual void clear() ROSE_OVERRIDE
Removes stored values from the register state.
static SValuePtr instance(const SValuePtr &other)
Instantiate a new copy of an existing value.
Definition: NullSemantics.h:59
virtual BaseSemantics::SValuePtr invert(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE
One's complement.
virtual BaseSemantics::MemoryStatePtr create(const BaseSemantics::SValuePtr &addrProtoval, const BaseSemantics::SValuePtr &valProtoval) const ROSE_OVERRIDE
Virtual allocating constructor.
virtual BaseSemantics::SValuePtr shiftRight(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE
Returns arg shifted right logically (no sign bit).
virtual BaseSemantics::SValuePtr unsignedModulo(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Calculates modulo with unsigned values.
virtual BaseSemantics::SValuePtr shiftLeft(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE
Returns arg shifted left.
virtual BaseSemantics::MemoryStatePtr clone() const ROSE_OVERRIDE
Virtual allocating copy constructor.
virtual BaseSemantics::SValuePtr signedDivide(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Divides two signed values.
virtual bool isBottom() const ROSE_OVERRIDE
Determines whether a value is a data-flow bottom.
Sawyer::SharedPointer< class SValue > SValuePtr
Shared-ownership pointer to a null semantic value.
Definition: NullSemantics.h:24
virtual BaseSemantics::SValuePtr rotateLeft(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &sa_) ROSE_OVERRIDE
Rotate bits to the left.
static SValuePtr promote(const BaseSemantics::SValuePtr &v)
Promote a base value to a NullSemantics value.
Definition: NullSemantics.h:94
virtual void writeMemory(const BaseSemantics::SValuePtr &addr, const BaseSemantics::SValuePtr &value, BaseSemantics::RiscOperators *addrOps, BaseSemantics::RiscOperators *valOps) ROSE_OVERRIDE
Write a value to memory.
Defines registers available for a particular architecture.
Definition: Registers.h:37
virtual SmtSolverPtr solver() const
Property: Satisfiability module theory (SMT) solver.
Represents no value.
Definition: Optional.h:32
virtual const std::string & name() const
Property: Name used for debugging.
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.
virtual void writeRegister(RegisterDescriptor reg, const BaseSemantics::SValuePtr &value, BaseSemantics::RiscOperators *ops) ROSE_OVERRIDE
Write a value to a register.
boost::shared_ptr< RegisterState > RegisterStatePtr
Shared-ownership pointer to a register state.
std::shared_ptr< class SmtSolver > SmtSolverPtr
Reference-counting pointer for SMT solvers.
Definition: SmtSolver.h:25
virtual BaseSemantics::SValuePtr or_(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_) ROSE_OVERRIDE
Computes bit-wise OR of two values.
virtual BaseSemantics::SValuePtr bottom_(size_t nBits) const ROSE_OVERRIDE
Data-flow bottom value.
Definition: NullSemantics.h:66
virtual BaseSemantics::SValuePtr equalToZero(const BaseSemantics::SValuePtr &a_) ROSE_OVERRIDE
Determines whether a value is equal to zero.