1#ifndef ROSE_BinaryAnalysis_InstructionSemantics_DispatcherAarch32_H
2#define ROSE_BinaryAnalysis_InstructionSemantics_DispatcherAarch32_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_ASM_AARCH32
6#include <Rose/BinaryAnalysis/BasicTypes.h>
7#include <Rose/BinaryAnalysis/InstructionEnumsAarch32.h>
8#include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics.h>
10#include <boost/serialization/access.hpp>
11#include <boost/serialization/base_object.hpp>
12#include <boost/serialization/export.hpp>
13#include <boost/serialization/split_member.hpp>
16namespace BinaryAnalysis {
17namespace InstructionSemantics {
20using DispatcherAarch32Ptr = boost::shared_ptr<class DispatcherAarch32>;
28 using Ptr = DispatcherAarch32Ptr;
37 RegisterDescriptor REG_PC, REG_SP, REG_LR;
38 RegisterDescriptor REG_PSTATE_N, REG_PSTATE_Z, REG_PSTATE_C, REG_PSTATE_V, REG_PSTATE_T;
39 RegisterDescriptor REG_PSTATE_E, REG_PSTATE_Q, REG_PSTATE_GE;
40 RegisterDescriptor REG_PSTATE_NZCV;
41 RegisterDescriptor REG_SPSR, REG_CPSR;
42 RegisterDescriptor REG_DTRTX;
43 RegisterDescriptor REG_UNKNOWN;
46#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
48 friend class boost::serialization::access;
51 void save(S &s,
const unsigned )
const {
52 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Super);
56 void load(S &s,
const unsigned ) {
57 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Super);
58 initializeRegisterDescriptors();
59 initializeInsnDispatchTable();
63 BOOST_SERIALIZATION_SPLIT_MEMBER();
71 DispatcherAarch32(
const Architecture::BaseConstPtr&);
81 static DispatcherAarch32Ptr instance(
const Architecture::BaseConstPtr&);
94 void initializeRegisterDescriptors();
99 void initializeInsnDispatchTable();
102 void initializeMemory();
106 RegisterDescriptor instructionPointerRegister()
const override;
107 RegisterDescriptor stackPointerRegister()
const override;
108 RegisterDescriptor stackFrameRegister()
const override;
109 RegisterDescriptor callReturnRegister()
const override;
131 void setThumbMode(SgAsmAarch32Instruction*);
158 using TwoValues = std::tuple<BaseSemantics::SValuePtr, BaseSemantics::SValuePtr>;
160 enum class SrType { LSL, LSR, ASR, ROR, RRX };
194 BranchType branchType);
222#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
223BOOST_CLASS_EXPORT_KEY(Rose::BinaryAnalysis::InstructionSemantics::DispatcherAarch32);
Dispatches instructions through the RISC layer.
Base class for expressions.
Base class for machine instructions.
bool signBit(T value)
Returns true if the sign bit is set, false if clear.
ROSE_DLL_API void load(SgProject *project, std::list< std::string > const &filepaths)
Load ASTs that have been saved to files.
boost::shared_ptr< RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to a RISC operators object.
boost::shared_ptr< Dispatcher > DispatcherPtr
Shared-ownership pointer to a semantics instruction dispatcher.
Sawyer::SharedPointer< Node > Ptr
Reference counting pointer.
Unsigned signExtend(Unsigned src, size_t n)
Sign extend part of a value to the full width of the src type.
std::string join(const std::string &separator, const Container &container)
Join individual items to form a single string.
const char * SrType(int64_t)
Convert Rose::BinaryAnalysis::InstructionSemantics::DispatcherAarch32::SrType enum constant to a stri...
const char * BranchType(int64_t)
Convert Rose::BinaryAnalysis::InstructionSemantics::DispatcherAarch32::BranchType enum constant to a ...