Otawa  0.10
otawa::sem::inst Class Reference

This structure class represents an instruction in the semantics representation of machine instruction. More...

#include <otawa/sem/inst.h>

Public Member Functions

 inst (void)
 
 inst (opcode _op)
 
 inst (opcode _op, int d)
 
 inst (opcode _op, int d, int a)
 
 inst (opcode _op, int d, int a, int b)
 
t::int16 d (void) const
 
t::int16 a (void) const
 
t::int16 b (void) const
 
t::uint32 cst (void) const
 
t::int16 reg (void) const
 
t::int16 addr (void) const
 
type_t type (void) const
 
cond_t cond (void) const
 
t::int16 sr (void) const
 
t::uint16 jump (void) const
 
void print (elm::io::Output &out) const
 Output the current instruction to the given output. More...
 

Public Attributes

t::uint16 op
 
t::int16 _d
 
union {
   t::uint32   cst
 
   struct {
      t::int16   a
 
      t::int16   b
 
   }   regs
 
args
 

Detailed Description

This structure class represents an instruction in the semantics representation of machine instruction.

It contains an opcode, giving the performed operation, and arguments depending on this opcode.

The variable is ever used to store the result of an instruction. A variable may match a register (index is positive and matches the register unique number in otawa::hard::Platform description) or a temporary (index is strictly negative).

LOAD, STORE access memory data and uses variable a to get the address and b is an immediate value given the size of the accessed data item.

SCRATCH means that the register is replaced with meaningless value.

SET and SETI assigns to d the variable in b or the immediate value in cst.

CMP, ADD, SUB, SHL, SHR and ASR uses both variable a and b to perform, respectively, comparison, addition, subtraction, logical shift left, logical shift right, arithmetics shift right.

Constructor & Destructor Documentation

otawa::sem::inst::inst ( opcode  _op)
inline
otawa::sem::inst::inst ( opcode  _op,
int  d 
)
inline
otawa::sem::inst::inst ( opcode  _op,
int  d,
int  a 
)
inline
otawa::sem::inst::inst ( opcode  _op,
int  d,
int  a,
int  b 
)
inline

Member Function Documentation

t::int16 otawa::sem::inst::a ( void  ) const
inline
t::int16 otawa::sem::inst::addr ( void  ) const
inline
t::int16 otawa::sem::inst::b ( void  ) const
inline
cond_t otawa::sem::inst::cond ( void  ) const
inline
t::uint32 otawa::sem::inst::cst ( void  ) const
inline
t::uint16 otawa::sem::inst::jump ( void  ) const
inline
void otawa::sem::inst::print ( elm::io::Output out) const

Output the current instruction to the given output.

Parameters
outOutput to print to.

References otawa::sem::Printer::print().

Referenced by otawa::sem::operator<<().

t::int16 otawa::sem::inst::reg ( void  ) const
inline
t::int16 otawa::sem::inst::sr ( void  ) const
inline
type_t otawa::sem::inst::type ( void  ) const
inline

Member Data Documentation

t::int16 otawa::sem::inst::_d
union { ... } otawa::sem::inst::args
struct { ... } otawa::sem::inst::regs

The documentation for this class was generated from the following files: