25 #include <elm/string.h>
27 #include <elm/genstruct/Table.h>
28 #include <elm/genstruct/Vector.h>
160 #endif // OTAWA_INST_H
bool isReturn(void)
Test if the instruction is a sub-program return, that is, it modifies the control flow retrieving its...
Definition: Inst.h:114
bool isBundle(void)
On VLIW architecture, mark an instruction that is part of a bundle but not last instruction.
Definition: Inst.h:123
bool isMulti(void)
Test if the instruction is multi-memory accesss load / store.
Definition: Inst.h:116
struct otawa::sem::inst inst
static const kind_t IS_INTERN
Mask of an instruction performing setup internal to the processor.
Definition: Inst.h:82
void set(T *target, int size, const T &v)
bool isIntern(void)
Test if the instruction neither access memory, nor modify control flow.
Definition: Inst.h:106
bool ended(void) const
Definition: Inst.h:51
static Inst & null
Null instruction with null address and null size (no kind).
Definition: Inst.h:91
static const kind_t IS_MUL
Mask of a multiplication instruction.
Definition: Inst.h:78
bool isStore(void)
Test if the instruction is a store, that is, it performs only one simple memory write.
Definition: Inst.h:110
t::uint32 mask
Definition: base.h:45
static const kind_t IS_INT
Mask of an instruction processing integer.
Definition: Inst.h:75
static const kind_t IS_CALL
Mask of a call instruction.
Definition: Inst.h:70
virtual Inst * toInst(void)
Return the instruction matching the current item.
Definition: instruction.cpp:471
static const kind_t IS_MEM
Mask of an instruction accessing the memory.
Definition: Inst.h:72
ProgItem * next(void) const
Get the next program item.
Definition: prog_ProgItem.cpp:44
Inst * nextInst(void) const
Definition: Inst.h:94
hard::Platform * pf
Definition: Inst.h:57
bool isUnknown(void)
Test if an instruction is unknown.
Definition: Inst.h:121
static const kind_t IS_COND
Mask of a conditional instruction of an instruction kind.
Definition: Inst.h:68
virtual delayed_t delayType(void)
For a branch instruction, returns the type of management for delay slots.
Definition: instruction.cpp:454
const hard::Register * item(void) const
Definition: Inst.h:52
A block represents a sequence of semantic instructions inst.
Definition: inst.h:183
bool isMul(void)
Test if the instruction is a multiplication.
Definition: Inst.h:118
virtual void dump(io::Output &out)
Output a displayable representation of the instruction.
Definition: instruction.cpp:320
elm::io::Output & operator<<(elm::io::Output &out, Address addr)
Definition: base.cpp:188
bool isCall(void)
Test if the instruction is a sub-program call, that is, it changes the control flow but stores the cu...
Definition: Inst.h:113
bool isControl(void)
Test if the instruction changes the control flow.
Definition: Inst.h:108
static const kind_t IS_SPECIAL
This mask denotes an instruction that is processed in a special way in the pipeline.
Definition: Inst.h:84
static const elm::genstruct::Table< hard::Register * > no_regs
A table containing no sets.
Definition: Inst.h:147
virtual Inst * toInst(void)
Return the instruction matching the current item.
Definition: prog_ProgItem.cpp:95
delayed_t
Enumeration giving the type of delayed modes used by control instruction.
Definition: features.h:30
bool isBundleEnd(void)
On VLIW architecture, mark an instruction that is the last instruction of a bundle.
Definition: Inst.h:124
RegIter(const RegSet &s, hard::Platform *p)
Definition: Inst.h:49
bool isLoad(void)
Test if the instruction is a load, that is, it performs only one simple memory read.
Definition: Inst.h:109
static const kind_t IS_ALU
Mask of an instruction performing a computation.
Definition: Inst.h:77
bool isConditional(void)
Test if this instruction is conditional.
Definition: Inst.h:115
Inst * prevInst(void) const
Definition: Inst.h:96
static const kind_t IS_FLOAT
Mask of an instruction processing floats.
Definition: Inst.h:76
void next(void)
Definition: Inst.h:53
bool noneOf(kind_t mask)
Definition: Inst.h:104
virtual kind_t kind(void)=0
Get the kind of the current instruction.
ProgItem * previous(void) const
Get the previous program item.
Definition: prog_ProgItem.cpp:57
virtual void semInsts(sem::Block &block)
Return a list of semantics pseudo-instruction representing the effect of the instruction.
Definition: instruction.cpp:413
friend class CodeItem
Definition: Inst.h:63
bool isDiv(void)
Test if the instruction is a division.
Definition: Inst.h:119
elm::t::uint32 kind_t
Definition: Inst.h:67
static const kind_t IS_SHIFT
Mask of an instruction performing a shift (this includes logicial shifts, arithmetic shifts and rotat...
Definition: Inst.h:80
virtual void readRegSet(RegSet &set)
Get the list of register read by the instruction.
Definition: instruction.cpp:355
sys::SystemOutStream & out
genstruct::Vector< t::uint16 > RegSet
Definition: Inst.h:46
static const kind_t IS_LOAD
Mask of an instruction performing a memory load.
Definition: Inst.h:73
static const kind_t IS_INDIRECT
Definition: Inst.h:85
virtual void writeRegSet(RegSet &set)
Get the list of register written by the instruction.
Definition: instruction.cpp:366
virtual int delaySlots(void)
For a branch instruction, returns the number of delayed instructions.
Definition: instruction.cpp:464
virtual ~Inst(void)
Definition: Inst.h:148
static const kind_t IS_MULTI
This mask denotes an instructions that perform multi-value store or load.
Definition: Inst.h:83
bool meets(kind_t mask)
Definition: Inst.h:102
virtual const elm::genstruct::Table< hard::Register * > & readRegs(void)
Get the registers read by the instruction.
Definition: instruction.cpp:379
bool oneOf(kind_t mask)
Definition: Inst.h:103
virtual Inst * target(void)
Get the target of the branch.
Definition: instruction.cpp:346
static const kind_t IS_ATOMIC
Definition: Inst.h:87
static const kind_t IS_BUNDLE
Applied on a VLIW architecture, marks instructions part of a bundle but not at end of the bundle...
Definition: Inst.h:88
virtual Type * type(void)
Definition: instruction.cpp:330
bool isIndirect(void)
Definition: Inst.h:120
static const kind_t IS_STORE
Definition: Inst.h:74
This class represents assembly instruction of a piece of code.
Definition: Inst.h:62
bool isAtomic(void)
Test if the instruction is an atomic synchronization instruction, that is, performing an atomic read-...
Definition: Inst.h:122
static const kind_t IS_CONTROL
Mask of a control instruction.
Definition: Inst.h:69
static const kind_t IS_RETURN
Mask of a return instruction.
Definition: Inst.h:71
bool isMem(void)
Test if the instruction access memory.
Definition: Inst.h:107
bool isBranch(void)
Test if the instruction is a branch, that is, it changes the control flow but performs neither a memo...
Definition: Inst.h:111
int i
Definition: Inst.h:56
virtual const elm::genstruct::Table< hard::Register * > & writtenRegs(void)
Get the registers written by the instruction.
Definition: instruction.cpp:390
Base class of the components of a program file segment.
Definition: ProgItem.h:23
Objects of this class are simple machine register, more accurately unbreakable atomic registers...
Definition: Register.h:38
static const kind_t IS_TRAP
Mask of a trap instruction.
Definition: Inst.h:81
bool isSpecial(void)
Test if the instruction is a complex special instruction.
Definition: Inst.h:117
static const kind_t IS_UNKNOWN
This mask denotes an unknown instruction: its opcode does not match any known instruction in the load...
Definition: Inst.h:86
This class describes the type of the data in the program.
Definition: type.h:39
const RegSet & set
Definition: Inst.h:55
static const kind_t IS_DIV
Mask of a division instruction.
Definition: Inst.h:79
virtual int semWriteBack(sem::Block &block, int temp)
VLIW instructions of a bundle perform read and write-back of registers in parallel.
Definition: instruction.cpp:443
virtual int multiCount(void)
This function is only defined for ISA supporting the IS_MULTI attribute.
Definition: instruction.cpp:482