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/InstructionEnumsAarch64.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 DispatcherAarch64Ptr = boost::shared_ptr<class DispatcherAarch64>;
28 using Ptr = DispatcherAarch64Ptr;
37 RegisterDescriptor REG_PC, REG_SP, REG_LR;
38 RegisterDescriptor REG_CPSR_N, REG_CPSR_Z, REG_CPSR_C, REG_CPSR_V;
41#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
43 friend class boost::serialization::access;
46 void save(S &s,
const unsigned )
const {
47 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Super);
51 void load(S &s,
const unsigned ) {
52 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Super);
53 initializeRegisterDescriptors();
54 initializeInsnDispatchTable();
58 BOOST_SERIALIZATION_SPLIT_MEMBER();
66 DispatcherAarch64(
const Architecture::BaseConstPtr&);
76 static DispatcherAarch64Ptr instance(
const Architecture::BaseConstPtr&);
89 void initializeRegisterDescriptors();
94 void initializeInsnDispatchTable();
97 void initializeMemory();
116 : n(n), z(z), c(c), v(v) {}
129 std::pair<uint64_t, uint64_t> decodeBitMasks(
size_t m,
bool immN, uint64_t imms, uint64_t immr,
bool immediate);
133 uint64_t immR, uint64_t immS);
137 uint64_t immR, uint64_t immS);
141 uint64_t immR, uint64_t immS);
145 RegisterDescriptor instructionPointerRegister()
const override;
146 RegisterDescriptor stackPointerRegister()
const override;
147 RegisterDescriptor stackFrameRegister()
const override;
148 RegisterDescriptor callReturnRegister()
const override;
155#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
156BOOST_CLASS_EXPORT_KEY(Rose::BinaryAnalysis::InstructionSemantics::DispatcherAarch64);
Dispatches instructions through the RISC layer.
Base class for most instruction semantics RISC operators.
Base class for expressions.
Base class for machine instructions.
Base class for binary types.
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.