1#ifndef ROSE_BinaryAnalysis_InstructionSemantics_DispatcherM68k_H
2#define ROSE_BinaryAnalysis_InstructionSemantics_DispatcherM68k_H
3#include <featureTests.h>
4#ifdef ROSE_ENABLE_BINARY_ANALYSIS
6#include <Rose/BinaryAnalysis/BasicTypes.h>
7#include <Rose/BinaryAnalysis/InstructionEnumsM68k.h>
8#include <Rose/BinaryAnalysis/InstructionSemantics/BaseSemantics.h>
10#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
11#include <boost/serialization/access.hpp>
12#include <boost/serialization/base_object.hpp>
13#include <boost/serialization/export.hpp>
14#include <boost/serialization/nvp.hpp>
15#include <boost/serialization/split_member.hpp>
19namespace BinaryAnalysis {
20namespace InstructionSemantics {
55#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
57 friend class boost::serialization::access;
60 void save(S &s,
const unsigned )
const {
61 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Super);
65 void load(S &s,
const unsigned ) {
66 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Super);
72 BOOST_SERIALIZATION_SPLIT_MEMBER();
163#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
Dispatches instructions through the RISC layer.
Base class for most instruction semantics RISC operators.
Dispatches Motorola 68k instructions through the semantics layer.
RegisterDescriptor REG_MACSR_C
Cached register.
RegisterDescriptor REG_MACEXT3
Cached register.
void iproc_init()
Loads the iproc table with instruction processing functors.
RegisterDescriptor REG_AEXC_OVFL
Cached register.
void adjustFpConditionCodes(const BaseSemantics::SValuePtr &result, SgAsmFloatType *)
Set floating point condition codes according to result.
RegisterDescriptor REG_MACEXT2
Cached register.
RegisterDescriptor REG_MACEXT1
Cached register.
void updateFpsrExcInex()
Set or clear FPSR EXC INEX bit.
RegisterDescriptor REG_VBR
Cached register.
RegisterDescriptor REG_CCR
Cached register.
RegisterDescriptor REG_SSP
Cached register.
void updateFpsrExcIde(const BaseSemantics::SValuePtr &a, SgAsmType *aType, const BaseSemantics::SValuePtr &b, SgAsmType *bType)
Set or clear FPSR EXC IDE bit.
RegisterDescriptor REG_EXC_OPERR
Cached register.
virtual RegisterDescriptor stackPointerRegister() const override
Returns the stack pointer register.
RegisterDescriptor REG_FPCC_I
Cached register.
static DispatcherM68kPtr promote(const BaseSemantics::DispatcherPtr &)
Dynamic cast to DispatcherM68kPtr with assertion.
RegisterDescriptor REG_AEXC_IOP
Cached register.
virtual RegisterDescriptor instructionPointerRegister() const override
Returns the instruction pointer register.
RegisterDescriptor REG_EXC_IDE
Cached register.
void updateFpsrExcOvfl(const BaseSemantics::SValuePtr &intermediate, SgAsmType *valueType, SgAsmType *rounding, SgAsmType *dstType)
Set or clear FPSR EXC OVFL bit.
RegisterDescriptor REG_EXC_OVFL
Cached register.
BaseSemantics::Dispatcher Super
Base type.
static DispatcherM68kPtr instance(const Architecture::BaseConstPtr &, const BaseSemantics::RiscOperatorsPtr &)
Constructor.
virtual BaseSemantics::SValuePtr read(SgAsmExpression *, size_t value_nbits, size_t addr_nbits=0) override
Reads an R-value expression.
static DispatcherM68kPtr instance(const Architecture::BaseConstPtr &)
Construct a prototypical dispatcher.
RegisterDescriptor REG_FP[8]
Cached register.
RegisterDescriptor REG_FPCC_N
Cached register.
RegisterDescriptor REG_PC
Cached register.
RegisterDescriptor REG_MACSR_N
Cached register.
RegisterDescriptor REG_EXC_INEX
Cached register.
RegisterDescriptor REG_A[8]
Cached register.
RegisterDescriptor REG_MACEXT0
Cached register.
RegisterDescriptor REG_EXC_DZ
Cached register.
RegisterDescriptor REG_CCR_V
Cached register.
DispatcherM68kPtr Ptr
Shared-ownership pointer.
void memory_init()
Make sure memory is set up correctly.
RegisterDescriptor REG_EXC_INAN
Cached register.
RegisterDescriptor REG_MACSR_V
Cached register.
RegisterDescriptor REG_SR_S
Cached register.
void updateFpsrExcInan(const BaseSemantics::SValuePtr &a, SgAsmType *aType, const BaseSemantics::SValuePtr &b, SgAsmType *bType)
Set or clear FPSR EXC INAN bit.
void accumulateFpExceptions()
Update accrued floating-point exceptions.
void updateFpsrExcUnfl(const BaseSemantics::SValuePtr &intermediate, SgAsmType *valueType, SgAsmType *rounding, SgAsmType *dstType)
Set or clear FPSR EXC UVFL bit.
RegisterDescriptor REG_CCR_C
Cached register.
virtual BaseSemantics::DispatcherPtr create(const BaseSemantics::RiscOperatorsPtr &) const override
Virtual constructor.
RegisterDescriptor REG_FPCC_NAN
Cached register.
RegisterDescriptor REG_MACSR_Z
Cached register.
RegisterDescriptor REG_MACSR_SU
Cached register.
RegisterDescriptor REG_AEXC_DZ
Cached register.
BaseSemantics::SValuePtr condition(M68kInstructionKind, BaseSemantics::RiscOperators *)
Determines if an instruction should branch.
RegisterDescriptor REG_EXC_UNFL
Cached register.
RegisterDescriptor REG_MACSR_FI
Cached register.
RegisterDescriptor REG_CCR_N
Cached register.
RegisterDescriptor REG_AEXC_UNFL
Cached register.
RegisterDescriptor REG_CCR_X
Cached register.
RegisterDescriptor REG_AEXC_INEX
Cached register.
void regcache_init()
Load the cached register descriptors.
virtual int iprocKey(SgAsmInstruction *insn_) const override
Given an instruction, return the InsnProcessor key that can be used as an index into the iproc_table.
RegisterDescriptor REG_MAC_MASK
Cached register.
RegisterDescriptor REG_D[8]
Cached register.
RegisterDescriptor REG_CCR_Z
Cached register.
RegisterDescriptor REG_EXC_BSUN
Cached register.
RegisterDescriptor REG_SR
Cached register.
RegisterDescriptor REG_FPCC_Z
Cached register.
Describes (part of) a physical CPU register.
Base class for expressions.
Base class for machine instructions.
Base class for binary types.
std::shared_ptr< const Base > BaseConstPtr
Reference counted pointer for Architecture::Base.
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.
boost::shared_ptr< class DispatcherM68k > DispatcherM68kPtr
Shared-ownership pointer to an M68k instruction dispatcher.