8 #ifndef ROSE_BinaryAnalysis_InstructionSemantics2_DispatcherPowerpc_H
9 #define ROSE_BinaryAnalysis_InstructionSemantics2_DispatcherPowerpc_H
10 #include <featureTests.h>
11 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
13 #include <Rose/BinaryAnalysis/InstructionSemantics2/BaseSemantics.h>
15 #include <boost/serialization/access.hpp>
16 #include <boost/serialization/base_object.hpp>
17 #include <boost/serialization/export.hpp>
18 #include <boost/serialization/split_member.hpp>
21 namespace BinaryAnalysis {
22 namespace InstructionSemantics2 {
45 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
47 friend class boost::serialization::access;
50 void save(S &s,
const unsigned )
const {
51 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Super);
55 void load(S &s,
const unsigned ) {
56 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Super);
62 BOOST_SERIALIZATION_SPLIT_MEMBER();
70 DispatcherPowerpc(
size_t addrWidth,
const RegisterDictionary *regs)
75 ASSERT_require(32==addrWidth || 64==addrWidth);
118 return instance(ops, addrWidth, regs);
124 assert(retval!=NULL);
164 #ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
const RegisterDictionary * registerDictionary() const
Property: Register dictionary.
boost::shared_ptr< RiscOperators > RiscOperatorsPtr
Shared-ownership pointer to a RISC operators object.
virtual void initializeState(const StatePtr &)
Initialize the state.
RegisterDescriptor REG_CTR
Cached register.
virtual BaseSemantics::DispatcherPtr create(const BaseSemantics::RiscOperatorsPtr &ops, size_t addrWidth=0, const RegisterDictionary *regs=NULL) const override
Virtual constructor.
virtual RegisterDescriptor stackPointerRegister() const override
Returns the stack pointer register.
RegisterDescriptor REG_CR
Cached register.
Base class for machine instructions.
BaseSemantics::SValuePtr readAndUpdate(BaseSemantics::RiscOperators *, SgAsmExpression *, size_t valueNBits)
Reads from a memory address and updates a register with the effective address that was read...
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_LR
Cached register.
Main namespace for the ROSE library.
void regcache_init()
Load the cached register descriptors.
void memory_init()
Make sure memory is set up correctly.
RegisterDescriptor REG_CR0
Cached register.
virtual RegisterDescriptor instructionPointerRegister() const override
Returns the instruction pointer register.
boost::shared_ptr< Dispatcher > DispatcherPtr
Shared-ownership pointer to a semantics instruction dispatcher.
virtual RegisterDescriptor callReturnRegister() const override
Returns the function call return address register.
Base classes for instruction semantics.
RegisterDescriptor REG_XER_OV
Cached register.
DispatcherPowerpcPtr Ptr
Shared-ownership pointer.
Describes (part of) a physical CPU register.
size_t addressWidth() const
Property: Width of memory addresses.
RegisterDescriptor REG_XER
Cached register.
boost::shared_ptr< class DispatcherPowerpc > DispatcherPowerpcPtr
Shared-ownership pointer to a PowerPC instruction dispatcher.
Represents one PowerPC machine instruction.
Rose::BinaryAnalysis::PowerpcInstructionKind get_kind() const
Property: Instruction kind.
RegisterDescriptor REG_XER_CA
Cached register.
BaseSemantics::Dispatcher Super
Base type.
void iproc_init()
Loads the iproc table with instruction processing functors.
Base class for most instruction semantics RISC operators.
const RegisterDictionary * regdict
See registerDictionary property.
Base class for expressions.
Dispatches instructions through the RISC layer.
void setXerOverflow(const BaseSemantics::SValuePtr &hadOverflow)
Set the XER OV and SO bits as specified.
RegisterDescriptor REG_XER_SO
Cached register.
static DispatcherPowerpcPtr instance()
Construct a prototypical dispatcher.
RegisterDescriptor REG_IAR
Cached register.
virtual RegisterDescriptor stackFrameRegister() const override
Returns the stack call frame register.
static DispatcherPowerpcPtr instance(const BaseSemantics::RiscOperatorsPtr &ops, size_t addrWidth, const RegisterDictionary *regs=NULL)
Constructor.
Defines registers available for a particular architecture.
static DispatcherPowerpcPtr instance(size_t addrWidth, const RegisterDictionary *regs=NULL)
Constructor.
virtual void updateCr0(const BaseSemantics::SValuePtr &result)
Write status flags for result.
static DispatcherPowerpcPtr promote(const BaseSemantics::DispatcherPtr &d)
Dynamic cast to a DispatcherPowerpcPtr with assertion.
RegisterDescriptor REG_CR0_LT
Cached register.
void writeAndUpdate(BaseSemantics::RiscOperators *, SgAsmExpression *destination, const BaseSemantics::SValuePtr &value)
Writes a value to a memory address and updates a register with the effective address to which the val...