ROSE  0.9.12.28
BaseSemanticsRiscOperators.h
1 #ifndef ROSE_BinaryAnalysis_InstructionSemantics2_BaseSemantics_RiscOperators_H
2 #define ROSE_BinaryAnalysis_InstructionSemantics2_BaseSemantics_RiscOperators_H
3 
4 #include <BaseSemanticsTypes.h>
5 #include <BinaryHotPatch.h>
6 #include <BinarySmtSolver.h>
7 
8 #include <boost/serialization/access.hpp>
9 #include <boost/serialization/nvp.hpp>
10 #include <boost/serialization/shared_ptr.hpp>
11 #include <boost/serialization/version.hpp>
12 
13 namespace Rose {
14 namespace BinaryAnalysis {
15 namespace InstructionSemantics2 {
16 namespace BaseSemantics {
17 
19 // RISC Operators
21 
42 class RiscOperators: public boost::enable_shared_from_this<RiscOperators> {
43  SValuePtr protoval_; // Prototypical value used for its virtual constructors
44  StatePtr currentState_; // State upon which RISC operators operate
45  StatePtr initialState_; // Lazily updated initial state; see readMemory
46  SmtSolverPtr solver_; // Optional SMT solver
47  SgAsmInstruction *currentInsn_; // Current instruction, as set by latest startInstruction call
48  size_t nInsns_; // Number of instructions processed
49  std::string name_; // Name to use for debugging
50  HotPatch hotPatch_; // Adjustments to the semantic state after each instruction.
51 
53  // Serialization
54 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
55 private:
56  friend class boost::serialization::access;
57 
58  template<class S>
59  void serialize(S &s, const unsigned version) {
60  s & BOOST_SERIALIZATION_NVP(protoval_);
61  s & BOOST_SERIALIZATION_NVP(currentState_);
62  s & BOOST_SERIALIZATION_NVP(initialState_);
63  s & BOOST_SERIALIZATION_NVP(solver_);
64  s & BOOST_SERIALIZATION_NVP(currentInsn_);
65  s & BOOST_SERIALIZATION_NVP(nInsns_);
66  s & BOOST_SERIALIZATION_NVP(name_);
67  if (version >= 1)
68  s & BOOST_SERIALIZATION_NVP(hotPatch_);
69  }
70 #endif
71 
73  // Real constructors
74 protected:
75  // for serialization
76  RiscOperators();
77 
78  explicit RiscOperators(const SValuePtr &protoval, const SmtSolverPtr &solver = SmtSolverPtr());
79  explicit RiscOperators(const StatePtr &state, const SmtSolverPtr &solver = SmtSolverPtr());
80 
81 public:
84 
85 public:
86  virtual ~RiscOperators();
87 
89  // Static allocating constructors. None needed since this class is abstract.
90 
91 
93  // Virtual constructors.
94 public:
98  virtual RiscOperatorsPtr create(const SValuePtr &protoval, const SmtSolverPtr &solver = SmtSolverPtr()) const = 0;
99 
104  virtual RiscOperatorsPtr create(const StatePtr &state, const SmtSolverPtr &solver = SmtSolverPtr()) const = 0;
105 
107  // Dynamic pointer casts. No-op since this is the base class.
108 public:
109  static RiscOperatorsPtr promote(const RiscOperatorsPtr &x) {
110  ASSERT_not_null(x);
111  return x;
112  }
113 
115  // Other methods part of our API
116 public:
120  virtual SValuePtr protoval() const { return protoval_; }
121 
130  virtual SmtSolverPtr solver() const { return solver_; }
131  virtual void solver(const SmtSolverPtr &s) { solver_ = s; }
140  const HotPatch& hotPatch() const { return hotPatch_; }
141  HotPatch& hotPatch() { return hotPatch_; }
142  void hotPatch(const HotPatch &hp) { hotPatch_ = hp; }
156  virtual StatePtr currentState() const { return currentState_; }
157  virtual void currentState(const StatePtr &s) { currentState_ = s; }
197  virtual StatePtr initialState() const { return initialState_; }
198  virtual void initialState(const StatePtr &s) { initialState_ = s; }
206  virtual const std::string& name() const { return name_; }
207  virtual void name(const std::string &s) { name_ = s; }
212  void print(std::ostream &stream, const std::string prefix="") const;
213  virtual void print(std::ostream &stream, Formatter &fmt) const;
218  RiscOperatorsPtr obj;
219  Formatter &fmt;
220  public:
221  WithFormatter(const RiscOperatorsPtr &obj, Formatter &fmt): obj(obj), fmt(fmt) {}
222  void print(std::ostream &stream) const { obj->print(stream, fmt); }
223  };
224 
232  WithFormatter with_format(Formatter &fmt) { return WithFormatter(shared_from_this(), fmt); }
241  virtual size_t nInsns() const { return nInsns_; }
242  virtual void nInsns(size_t n) { nInsns_ = n; }
250  return currentInsn_;
251  }
252 
255  virtual void startInstruction(SgAsmInstruction *insn);
256 
259  virtual void finishInstruction(SgAsmInstruction *insn);
260 
261 
263  // Value Construction Operations
265  // The trailing underscores are necessary for for undefined_() on some machines, so we just add one to the end of all the
266  // virtual constructors for consistency.
267 
271  virtual SValuePtr undefined_(size_t nbits);
272  virtual SValuePtr unspecified_(size_t nbits);
276  virtual SValuePtr number_(size_t nbits, uint64_t value);
277 
279  virtual SValuePtr boolean_(bool value);
280 
282  virtual SValuePtr bottom_(size_t nbits);
283 
284 
286  // x86-specific Operations (FIXME)
288 
291  virtual SValuePtr filterCallTarget(const SValuePtr &a);
292 
296  virtual SValuePtr filterReturnTarget(const SValuePtr &a);
297 
301  virtual SValuePtr filterIndirectJumpTarget(const SValuePtr &a);
302 
304  virtual void hlt() {}
305 
307  virtual void cpuid() {}
308 
310  virtual SValuePtr rdtsc() { return unspecified_(64); }
311 
312 
314  // Boolean Operations
316 
319  virtual SValuePtr and_(const SValuePtr &a, const SValuePtr &b) = 0;
320 
323  virtual SValuePtr or_(const SValuePtr &a, const SValuePtr &b) = 0;
324 
327  virtual SValuePtr xor_(const SValuePtr &a, const SValuePtr &b) = 0;
328 
330  virtual SValuePtr invert(const SValuePtr &a) = 0;
331 
335  virtual SValuePtr extract(const SValuePtr &a, size_t begin_bit, size_t end_bit) = 0;
336 
342  virtual SValuePtr concat(const SValuePtr &lowBits, const SValuePtr &highBits) = 0;
343 
349  virtual std::pair<SValuePtr /*low*/, SValuePtr /*high*/> split(const SValuePtr &a, size_t splitPoint);
350 
353  virtual SValuePtr leastSignificantSetBit(const SValuePtr &a) = 0;
354 
357  virtual SValuePtr mostSignificantSetBit(const SValuePtr &a) = 0;
358 
362  virtual SValuePtr rotateLeft(const SValuePtr &a, const SValuePtr &nbits) = 0;
363 
367  virtual SValuePtr rotateRight(const SValuePtr &a, const SValuePtr &nbits) = 0;
368 
372  virtual SValuePtr shiftLeft(const SValuePtr &a, const SValuePtr &nbits) = 0;
373 
377  virtual SValuePtr shiftRight(const SValuePtr &a, const SValuePtr &nbits) = 0;
378 
383  virtual SValuePtr shiftRightArithmetic(const SValuePtr &a, const SValuePtr &nbits) = 0;
384 
385 
387  // Comparison Operations
389 
392  virtual SValuePtr equalToZero(const SValuePtr &a) = 0;
393 
397  virtual SValuePtr ite(const SValuePtr &cond, const SValuePtr &a, const SValuePtr &b) = 0;
398 
405  virtual SValuePtr isEqual(const SValuePtr &a, const SValuePtr &b);
406  virtual SValuePtr isNotEqual(const SValuePtr &a, const SValuePtr &b);
416  virtual SValuePtr isUnsignedLessThan(const SValuePtr &a, const SValuePtr &b);
417  virtual SValuePtr isUnsignedLessThanOrEqual(const SValuePtr &a, const SValuePtr &b);
418  virtual SValuePtr isUnsignedGreaterThan(const SValuePtr &a, const SValuePtr &b);
419  virtual SValuePtr isUnsignedGreaterThanOrEqual(const SValuePtr &a, const SValuePtr &b);
429  virtual SValuePtr isSignedLessThan(const SValuePtr &a, const SValuePtr &b);
430  virtual SValuePtr isSignedLessThanOrEqual(const SValuePtr &a, const SValuePtr &b);
431  virtual SValuePtr isSignedGreaterThan(const SValuePtr &a, const SValuePtr &b);
432  virtual SValuePtr isSignedGreaterThanOrEqual(const SValuePtr &a, const SValuePtr &b);
435  // Integer Arithmetic Operations
438 
441  virtual SValuePtr unsignedExtend(const SValuePtr &a, size_t new_width);
442 
445  virtual SValuePtr signExtend(const SValuePtr &a, size_t new_width) = 0;
446 
449  virtual SValuePtr add(const SValuePtr &a, const SValuePtr &b) = 0;
450 
455  virtual SValuePtr addCarry(const SValuePtr &a, const SValuePtr &b,
456  SValuePtr &carryOut /*out*/, SValuePtr &overflowed /*out*/);
457 
463  virtual SValuePtr subtract(const SValuePtr &minuend, const SValuePtr &subtrahend);
464 
473  virtual SValuePtr subtractCarry(const SValuePtr &minuend, const SValuePtr &subtrahend,
474  SValuePtr &carryOut /*out*/, SValuePtr &overflowed /*out*/);
475 
492  virtual SValuePtr addWithCarries(const SValuePtr &a, const SValuePtr &b, const SValuePtr &c,
493  SValuePtr &carry_out/*output*/) = 0;
494 
496  virtual SValuePtr negate(const SValuePtr &a) = 0;
497 
499  virtual SValuePtr signedDivide(const SValuePtr &dividend, const SValuePtr &divisor) = 0;
500 
502  virtual SValuePtr signedModulo(const SValuePtr &a, const SValuePtr &b) = 0;
503 
505  virtual SValuePtr signedMultiply(const SValuePtr &a, const SValuePtr &b) = 0;
506 
508  virtual SValuePtr unsignedDivide(const SValuePtr &dividend, const SValuePtr &divisor) = 0;
509 
511  virtual SValuePtr unsignedModulo(const SValuePtr &a, const SValuePtr &b) = 0;
512 
514  virtual SValuePtr unsignedMultiply(const SValuePtr &a, const SValuePtr &b) = 0;
515 
516 
518  // Interrupt and system calls
520 
525  virtual void interrupt(int /*majr*/, int /*minr*/) {}
526 
527 
529  // Floating-point operations
530  //
531  // For now these all have default implementations that throw NotImplemented, but we might change them to pure virtual
532  // sometime in the future so they're consistent with most other RISC operators. [Robb P. Matzke 2015-08-03]
534 
536  virtual SValuePtr fpFromInteger(const SValuePtr &intValue, SgAsmFloatType *fpType);
537 
543  virtual SValuePtr fpToInteger(const SValuePtr &fpValue, SgAsmFloatType *fpType, const SValuePtr &dflt);
544 
548  virtual SValuePtr fpConvert(const SValuePtr &a, SgAsmFloatType *aType, SgAsmFloatType *retType);
549 
551  virtual SValuePtr fpIsNan(const SValuePtr &fpValue, SgAsmFloatType *fpType);
552 
554  virtual SValuePtr fpIsDenormalized(const SValuePtr &fpValue, SgAsmFloatType *fpType);
555 
557  virtual SValuePtr fpIsZero(const SValuePtr &fpValue, SgAsmFloatType *fpType);
558 
563  virtual SValuePtr fpIsInfinity(const SValuePtr &fpValue, SgAsmFloatType *fpType);
564 
568  virtual SValuePtr fpSign(const SValuePtr &fpValue, SgAsmFloatType *fpType);
569 
575  virtual SValuePtr fpEffectiveExponent(const SValuePtr &fpValue, SgAsmFloatType *fpType);
576 
580  virtual SValuePtr fpAdd(const SValuePtr &a, const SValuePtr &b, SgAsmFloatType *fpType);
581 
586  virtual SValuePtr fpSubtract(const SValuePtr &a, const SValuePtr &b, SgAsmFloatType *fpType);
587 
591  virtual SValuePtr fpMultiply(const SValuePtr &a, const SValuePtr &b, SgAsmFloatType *fpType);
592 
596  virtual SValuePtr fpDivide(const SValuePtr &a, const SValuePtr &b, SgAsmFloatType *fpType);
597 
601  virtual SValuePtr fpSquareRoot(const SValuePtr &a, SgAsmFloatType *fpType);
602 
606  virtual SValuePtr fpRoundTowardZero(const SValuePtr &a, SgAsmFloatType *fpType);
607 
609  // Conversion operations
611 
617  virtual SValuePtr reinterpret(const SValuePtr &a, SgAsmType *retType);
618 
629  virtual SValuePtr convert(const SValuePtr &a, SgAsmType *srcType, SgAsmType *dstType);
630 
631 
633  // State Accessing Operations
635 
660  virtual SValuePtr readRegister(RegisterDescriptor reg) { // old subclasses can still override this if they want,
661  return readRegister(reg, undefined_(reg.nBits())); // but new subclasses should not override this method.
662  }
663  virtual SValuePtr readRegister(RegisterDescriptor reg, const SValuePtr &dflt); // new subclasses override this
675  virtual void writeRegister(RegisterDescriptor reg, const SValuePtr &a);
676 
684  virtual SValuePtr peekRegister(RegisterDescriptor, const SValuePtr &dflt);
686  return peekRegister(reg, undefined_(reg.nBits()));
687  }
712  virtual SValuePtr readMemory(RegisterDescriptor segreg, const SValuePtr &addr, const SValuePtr &dflt,
713  const SValuePtr &cond) = 0;
714 
725  virtual void writeMemory(RegisterDescriptor segreg, const SValuePtr &addr, const SValuePtr &data,
726  const SValuePtr &cond) = 0;
727 
732  virtual SValuePtr peekMemory(RegisterDescriptor segreg, const SValuePtr &addr, const SValuePtr &dflt) = 0;
733 };
734 
735 std::ostream& operator<<(std::ostream&, const RiscOperators&);
736 std::ostream& operator<<(std::ostream&, const RiscOperators::WithFormatter&);
737 
738 } // namespace
739 } // namespace
740 } // namespace
741 } // namespace
742 
743 // Class versions must be at global scope
745 
746 #endif
virtual SValuePtr signedMultiply(const SValuePtr &a, const SValuePtr &b)=0
Multiplies two signed values.
boost::shared_ptr< RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to a RISC operators object.
virtual SValuePtr fpIsDenormalized(const SValuePtr &fpValue, SgAsmFloatType *fpType)
Whether a floating-point value is denormalized.
virtual SgAsmInstruction * currentInstruction() const
Returns current instruction.
virtual SValuePtr rotateRight(const SValuePtr &a, const SValuePtr &nbits)=0
Rotate bits to the right.
virtual SValuePtr filterIndirectJumpTarget(const SValuePtr &a)
Invoked to filter indirect jumps.
virtual SValuePtr isEqual(const SValuePtr &a, const SValuePtr &b)
Equality comparison.
virtual void interrupt(int, int)
Invoked for instructions that cause an interrupt.
size_t nBits() const
Property: Size in bits.
virtual SValuePtr fpMultiply(const SValuePtr &a, const SValuePtr &b, SgAsmFloatType *fpType)
Multiply two floating-point values.
virtual SValuePtr undefined_(size_t nbits)
Returns a new undefined value.
virtual SValuePtr isSignedGreaterThanOrEqual(const SValuePtr &a, const SValuePtr &b)
Comparison for signed values.
virtual SValuePtr isSignedLessThan(const SValuePtr &a, const SValuePtr &b)
Comparison for signed values.
Describes how to modify machine state after each instruction.
virtual SValuePtr leastSignificantSetBit(const SValuePtr &a)=0
Returns position of least significant set bit; zero when no bits are set.
virtual SValuePtr convert(const SValuePtr &a, SgAsmType *srcType, SgAsmType *dstType)
Convert value from one type to another.
virtual void writeMemory(RegisterDescriptor segreg, const SValuePtr &addr, const SValuePtr &data, const SValuePtr &cond)=0
Writes a value to memory.
Base class for machine instructions.
WithFormatter operator+(Formatter &fmt)
Used for printing RISC operators with formatting.
virtual void finishInstruction(SgAsmInstruction *insn)
Called at the end of every instruction.
const HotPatch & hotPatch() const
Property: Post-instruction hot patches.
virtual SValuePtr fpFromInteger(const SValuePtr &intValue, SgAsmFloatType *fpType)
Construct a floating-point value from an integer value.
virtual SValuePtr unsignedDivide(const SValuePtr &dividend, const SValuePtr &divisor)=0
Divides two unsigned values.
virtual SValuePtr fpRoundTowardZero(const SValuePtr &a, SgAsmFloatType *fpType)
Round toward zero.
boost::shared_ptr< State > StatePtr
Shared-ownership pointer to a semantic state.
virtual SValuePtr rotateLeft(const SValuePtr &a, const SValuePtr &nbits)=0
Rotate bits to the left.
virtual SValuePtr extract(const SValuePtr &a, size_t begin_bit, size_t end_bit)=0
Extracts bits from a value.
virtual SValuePtr fpDivide(const SValuePtr &a, const SValuePtr &b, SgAsmFloatType *fpType)
Divide one floating-point value by another.
virtual SValuePtr signedDivide(const SValuePtr &dividend, const SValuePtr &divisor)=0
Divides two signed values.
virtual SValuePtr fpSign(const SValuePtr &fpValue, SgAsmFloatType *fpType)
Sign of floating-point value.
virtual SValuePtr protoval() const
Property: Prototypical semantic value.
Main namespace for the ROSE library.
virtual SValuePtr fpToInteger(const SValuePtr &fpValue, SgAsmFloatType *fpType, const SValuePtr &dflt)
Construct an integer value from a floating-point value.
virtual SValuePtr unsignedMultiply(const SValuePtr &a, const SValuePtr &b)=0
Multiply two unsigned values.
virtual SValuePtr addWithCarries(const SValuePtr &a, const SValuePtr &b, const SValuePtr &c, SValuePtr &carry_out)=0
Add two values of equal size and a carry bit.
virtual SValuePtr peekMemory(RegisterDescriptor segreg, const SValuePtr &addr, const SValuePtr &dflt)=0
Read memory without side effects.
virtual void solver(const SmtSolverPtr &s)
Property: Satisfiability module theory (SMT) solver.
virtual SValuePtr readMemory(RegisterDescriptor segreg, const SValuePtr &addr, const SValuePtr &dflt, const SValuePtr &cond)=0
Reads a value from memory.
virtual SValuePtr or_(const SValuePtr &a, const SValuePtr &b)=0
Computes bit-wise OR of two values.
virtual SValuePtr boolean_(bool value)
Returns a Boolean value.
virtual size_t nInsns() const
Property: Number of instructions processed.
virtual SValuePtr shiftRight(const SValuePtr &a, const SValuePtr &nbits)=0
Returns arg shifted right logically (no sign bit).
virtual StatePtr currentState() const
Property: Current semantic state.
Sawyer::SharedPointer< class SmtSolver > SmtSolverPtr
Reference-counting pointer for SMT solvers.
virtual SValuePtr add(const SValuePtr &a, const SValuePtr &b)=0
Adds two integers of equal size.
virtual SValuePtr isSignedGreaterThan(const SValuePtr &a, const SValuePtr &b)
Comparison for signed values.
virtual SValuePtr ite(const SValuePtr &cond, const SValuePtr &a, const SValuePtr &b)=0
If-then-else.
virtual SValuePtr reinterpret(const SValuePtr &a, SgAsmType *retType)
Reinterpret an expression as a different type.
virtual SValuePtr equalToZero(const SValuePtr &a)=0
Determines whether a value is equal to zero.
virtual SValuePtr isUnsignedLessThanOrEqual(const SValuePtr &a, const SValuePtr &b)
Comparison for unsigned values.
RiscOperatorsPtr Ptr
Shared-ownership pointer for a RiscOperators object.
virtual SValuePtr subtractCarry(const SValuePtr &minuend, const SValuePtr &subtrahend, SValuePtr &carryOut, SValuePtr &overflowed)
Subtract one value from another and carry.
virtual SValuePtr shiftRightArithmetic(const SValuePtr &a, const SValuePtr &nbits)=0
Returns arg shifted right arithmetically (with sign bit).
virtual SValuePtr xor_(const SValuePtr &a, const SValuePtr &b)=0
Computes bit-wise XOR of two values.
virtual SValuePtr subtract(const SValuePtr &minuend, const SValuePtr &subtrahend)
Subtract one value from another.
virtual SValuePtr fpIsInfinity(const SValuePtr &fpValue, SgAsmFloatType *fpType)
Whether a floating-point value is infinity.
virtual SValuePtr filterReturnTarget(const SValuePtr &a)
Invoked to filter return targets.
Describes (part of) a physical CPU register.
virtual SValuePtr addCarry(const SValuePtr &a, const SValuePtr &b, SValuePtr &carryOut, SValuePtr &overflowed)
Adds two integers of equal size and carry.
virtual void nInsns(size_t n)
Property: Number of instructions processed.
virtual SValuePtr fpIsZero(const SValuePtr &fpValue, SgAsmFloatType *fpType)
Whether a floating-point value is equal to zero.
virtual SValuePtr invert(const SValuePtr &a)=0
One's complement.
virtual SValuePtr fpSquareRoot(const SValuePtr &a, SgAsmFloatType *fpType)
Square root.
virtual SValuePtr unsignedExtend(const SValuePtr &a, size_t new_width)
Extend (or shrink) operand a so it is nbits wide by adding or removing high-order bits...
virtual SValuePtr filterCallTarget(const SValuePtr &a)
Invoked to filter call targets.
virtual SValuePtr isUnsignedGreaterThanOrEqual(const SValuePtr &a, const SValuePtr &b)
Comparison for unsigned values.
virtual SValuePtr fpAdd(const SValuePtr &a, const SValuePtr &b, SgAsmFloatType *fpType)
Add two floating-point values.
virtual void currentState(const StatePtr &s)
Property: Current semantic state.
void print(std::ostream &stream, const std::string prefix="") const
Print multi-line output for this object.
virtual SValuePtr concat(const SValuePtr &lowBits, const SValuePtr &highBits)=0
Concatenates the bits of two values.
virtual StatePtr initialState() const
Property: Optional lazily updated initial state.
virtual SValuePtr fpIsNan(const SValuePtr &fpValue, SgAsmFloatType *fpType)
Whether a floating-point value is a special not-a-number bit pattern.
Base class for most instruction semantics RISC operators.
virtual SValuePtr rdtsc()
Invoked for the x86 RDTSC instruction.
virtual SValuePtr unsignedModulo(const SValuePtr &a, const SValuePtr &b)=0
Calculates modulo with unsigned values.
SValuePtr peekRegister(RegisterDescriptor reg)
Obtain a register value without side effects.
virtual void initialState(const StatePtr &s)
Property: Optional lazily updated initial state.
virtual SValuePtr fpConvert(const SValuePtr &a, SgAsmFloatType *aType, SgAsmFloatType *retType)
Convert from one floating-point type to another.
Base class for binary types.
virtual std::pair< SValuePtr, SValuePtr > split(const SValuePtr &a, size_t splitPoint)
Split a value into two narrower values.
virtual SValuePtr fpEffectiveExponent(const SValuePtr &fpValue, SgAsmFloatType *fpType)
Exponent of floating-point value.
virtual SValuePtr isUnsignedLessThan(const SValuePtr &a, const SValuePtr &b)
Comparison for unsigned values.
virtual SValuePtr signExtend(const SValuePtr &a, size_t new_width)=0
Sign extends a value.
virtual void name(const std::string &s)
Property: Name used for debugging.
virtual SValuePtr unspecified_(size_t nbits)
Returns a new undefined value.
virtual void startInstruction(SgAsmInstruction *insn)
Called at the beginning of every instruction.
virtual SValuePtr bottom_(size_t nbits)
Returns a data-flow bottom value.
WithFormatter with_format(Formatter &fmt)
Used for printing RISC operators with formatting.
virtual SValuePtr mostSignificantSetBit(const SValuePtr &a)=0
Returns position of most significant set bit; zero when no bits are set.
virtual void writeRegister(RegisterDescriptor reg, const SValuePtr &a)
Writes a value to a register.
virtual SValuePtr negate(const SValuePtr &a)=0
Two's complement.
virtual SValuePtr shiftLeft(const SValuePtr &a, const SValuePtr &nbits)=0
Returns arg shifted left.
virtual SValuePtr isUnsignedGreaterThan(const SValuePtr &a, const SValuePtr &b)
Comparison for unsigned values.
virtual SValuePtr peekRegister(RegisterDescriptor, const SValuePtr &dflt)
Obtain a register value without side effects.
virtual SmtSolverPtr solver() const
Property: Satisfiability module theory (SMT) solver.
void hotPatch(const HotPatch &hp)
Property: Post-instruction hot patches.
virtual RiscOperatorsPtr create(const SValuePtr &protoval, const SmtSolverPtr &solver=SmtSolverPtr()) const =0
Virtual allocating constructor.
virtual const std::string & name() const
Property: Name used for debugging.
virtual SValuePtr readRegister(RegisterDescriptor reg)
Reads a value from a register.
virtual SValuePtr number_(size_t nbits, uint64_t value)
Returns a number of the specified bit width.
virtual SValuePtr fpSubtract(const SValuePtr &a, const SValuePtr &b, SgAsmFloatType *fpType)
Subtract one floating-point value from another.
virtual SValuePtr signedModulo(const SValuePtr &a, const SValuePtr &b)=0
Calculates modulo with signed values.
virtual SValuePtr isNotEqual(const SValuePtr &a, const SValuePtr &b)
Equality comparison.
Floating point types.
virtual SValuePtr isSignedLessThanOrEqual(const SValuePtr &a, const SValuePtr &b)
Comparison for signed values.
virtual SValuePtr and_(const SValuePtr &a, const SValuePtr &b)=0
Computes bit-wise AND of two values.