1 #ifndef ROSE_BinaryAnalysis_InstructionSemantics_DispatcherAarch64_H
2 #define ROSE_BinaryAnalysis_InstructionSemantics_DispatcherAarch64_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_ASM_AARCH64
6 #include <Rose/BinaryAnalysis/BasicTypes.h>
7 #include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics.h>
9 #include <boost/serialization/access.hpp>
10 #include <boost/serialization/base_object.hpp>
11 #include <boost/serialization/export.hpp>
12 #include <boost/serialization/split_member.hpp>
15 namespace BinaryAnalysis {
16 namespace InstructionSemantics {
19 using DispatcherAarch64Ptr = boost::shared_ptr<class DispatcherAarch64>;
27 using Ptr = DispatcherAarch64Ptr;
36 RegisterDescriptor REG_PC, REG_SP, REG_LR;
37 RegisterDescriptor REG_CPSR_N, REG_CPSR_Z, REG_CPSR_C, REG_CPSR_V;
40 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
42 friend class boost::serialization::access;
45 void save(S &s,
const unsigned )
const {
46 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Super);
50 void load(S &s,
const unsigned ) {
51 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Super);
52 initializeRegisterDescriptors();
53 initializeInsnDispatchTable();
57 BOOST_SERIALIZATION_SPLIT_MEMBER();
72 static DispatcherAarch64Ptr instance();
86 void initializeRegisterDescriptors();
91 void initializeInsnDispatchTable();
94 void initializeMemory();
113 : n(n), z(z), c(c), v(v) {}
126 std::pair<uint64_t, uint64_t> decodeBitMasks(
size_t m,
bool immN, uint64_t imms, uint64_t immr,
bool immediate);
130 uint64_t immR, uint64_t immS);
134 uint64_t immR, uint64_t immS);
138 uint64_t immR, uint64_t immS);
142 RegisterDescriptor instructionPointerRegister()
const override;
143 RegisterDescriptor stackPointerRegister()
const override;
144 RegisterDescriptor stackFrameRegister()
const override;
145 RegisterDescriptor callReturnRegister()
const override;
153 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
154 BOOST_CLASS_EXPORT_KEY(Rose::BinaryAnalysis::InstructionSemantics::DispatcherAarch64);
Sum< T >::Ptr sum()
Factory for value agumenter.
boost::shared_ptr< RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to a RISC operators object.
Base class for machine instructions.
Sawyer::SharedPointer< RegisterDictionary > RegisterDictionaryPtr
Reference counting pointer.
Main namespace for the ROSE library.
boost::shared_ptr< Dispatcher > DispatcherPtr
Shared-ownership pointer to a semantics instruction dispatcher.
Dispatches instructions through the RISC layer.
ROSE_DLL_API void load(SgProject *project, std::list< std::string > const &filepaths)
Load ASTs that have been saved to files.
Base class for expressions.
Base class for binary types.
Sawyer::SharedPointer< Node > Ptr
Reference counting pointer.
Base class for most instruction semantics RISC operators.