OpenASIP  2.0
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
Operand Class Reference

#include <Operand.hh>

Inheritance diagram for Operand:
Inheritance graph
Collaboration diagram for Operand:
Collaboration graph

Public Types

enum  OperandType {
  SINT_WORD, UINT_WORD, FLOAT_WORD, DOUBLE_WORD,
  HALF_FLOAT_WORD, BOOL, RAW_DATA, SLONG_WORD,
  ULONG_WORD
}
 

Public Member Functions

 Operand (bool isInput)
 
 Operand (bool isInput, int index, OperandType type)
 
 Operand (const Operand &op)
 
virtual ~Operand ()
 
virtual int index () const
 
virtual bool isInput () const
 
virtual bool isOutput () const
 
virtual OperandType type () const
 
virtual void setType (OperandType type)
 
virtual const std::string & typeString () const
 
virtual TCEString CTypeString () const
 
virtual bool isVector () const
 
virtual int elementWidth () const
 
virtual void setElementWidth (int elementWidth)
 
virtual int elementCount () const
 
virtual void setElementCount (int elementCount)
 
virtual int width () const
 
virtual bool isAddress () const
 
virtual int memoryUnits () const
 
virtual bool isMemoryData () const
 
virtual bool canSwap (const Operand &op) const
 
virtual const std::set< int > & swap () const
 
virtual void loadState (const ObjectState *state)
 
virtual ObjectStatesaveState () const
 
virtual bool isNull () const
 
- Public Member Functions inherited from Serializable
virtual ~Serializable ()
 

Static Public Member Functions

static int defaultElementWidth (OperandType type)
 

Static Public Attributes

static const std::string SLONG_WORD_STRING = "SLongWord"
 
static const std::string ULONG_WORD_STRING = "ULongWord"
 
static const std::string SINT_WORD_STRING = "SIntWord"
 
static const std::string UINT_WORD_STRING = "UIntWord"
 
static const std::string HALF_FLOAT_WORD_STRING = "HalfFloatWord"
 
static const std::string FLOAT_WORD_STRING = "FloatWord"
 
static const std::string DOUBLE_WORD_STRING = "DoubleWord"
 
static const std::string BOOL_STRING = "Bool"
 
static const std::string RAW_DATA_STRING = "RawData"
 
static const std::string UNKNOWN_TYPE_STRING = "InvalidValue"
 
static const std::string OPRND_ID = "id"
 Object state name for operand id. More...
 
static const std::string OPRND_TYPE = "type"
 Object state name for operand type. More...
 
static const std::string OPRND_MEM_ADDRESS = "mem-address"
 Object state name for memory address. More...
 
static const std::string OPRND_MEM_UNITS = "mem-units"
 Object state name for memory unit count. More...
 
static const std::string OPRND_MEM_DATA = "mem-data"
 Object state name for memory data. More...
 
static const std::string OPRND_CAN_SWAP = "can-swap"
 Object state name for can swap. More...
 
static const std::string OPRND_IN = "in"
 Object state name for input operand. More...
 
static const std::string OPRND_OUT = "out"
 Object state name for output operand. More...
 
static const std::string OPRND_ELEM_WIDTH = "element-width"
 Object state name for element width. More...
 
static const std::string OPRND_ELEM_COUNT = "element-count"
 Object state name for element count. More...
 

Private Member Functions

void clear ()
 
Operandoperator= (const Operand &)
 Assignment not allowed. More...
 

Private Attributes

int index_
 Index of the Operand. More...
 
bool isInput_
 Direction of operand. More...
 
OperandType type_
 Type of the Operand. More...
 
int elementWidth_
 Width of an element. More...
 
int elementCount_
 Number of total elements. More...
 
bool isAddress_
 Flag indicating whether Operand is address or not. More...
 
int addressUnits_
 size of the data this operation addresses. 0 if unknown. More...
 
bool isMemoryData_
 Flag indicating whether Operand is memory data or not. More...
 
std::set< int > swap_
 Indexes of Operands which can be swapped with this Operand. More...
 

Detailed Description

Class that models Operation Operand.

Contains the static properties of Operation inputs and outputs.

Definition at line 52 of file Operand.hh.

Member Enumeration Documentation

◆ OperandType

Type of operand.

Enumerator
SINT_WORD 
UINT_WORD 
FLOAT_WORD 
DOUBLE_WORD 
HALF_FLOAT_WORD 
BOOL 
RAW_DATA 
SLONG_WORD 
ULONG_WORD 

Definition at line 58 of file Operand.hh.

58  {
59  SINT_WORD,
60  UINT_WORD,
61  FLOAT_WORD,
64  BOOL,
65  RAW_DATA,
66  SLONG_WORD,
68  };

Constructor & Destructor Documentation

◆ Operand() [1/3]

Operand::Operand ( bool  isInput)
explicit

Default constructor.

Definition at line 75 of file Operand.cc.

References defaultElementWidth(), elementWidth_, and type_.

Here is the call graph for this function:

◆ Operand() [2/3]

Operand::Operand ( bool  isInput,
int  index,
OperandType  type 
)
explicit

Constructor.

Parameters
indexIndex of operand.

Definition at line 87 of file Operand.cc.

References defaultElementWidth(), elementWidth_, and type_.

Here is the call graph for this function:

◆ Operand() [3/3]

Operand::Operand ( const Operand op)

Copy constructor.

Parameters
opOperand to be copied.

Definition at line 99 of file Operand.cc.

99  :
100  Serializable(), index_(op.index()), isInput_(op.isInput()),
101  type_(op.type()), elementWidth_(op.elementWidth()),
104  swap_(op.swap()) {
105 }

◆ ~Operand()

Operand::~Operand ( )
virtual

Destructor.

Definition at line 110 of file Operand.cc.

110  {
111 }

Member Function Documentation

◆ canSwap()

bool Operand::canSwap ( const Operand op) const
virtual

Returns true if Operand can be swapped with op.

Parameters
opOperand being investigated.
Returns
True if Operand can be swapped with op, false otherwise.

Reimplemented in NullOperand.

Definition at line 372 of file Operand.cc.

372  {
374 }

References ContainerTools::containsValue(), index(), and swap_.

Referenced by OperationPimpl::canSwap(), loadState(), and saveState().

Here is the call graph for this function:

◆ clear()

void Operand::clear ( )
private

Clears the operand.

This is used when operand state is reloaded from ObjectState tree. Old must be cleared first.

Definition at line 120 of file Operand.cc.

120  {
121  index_ = 0;
122  elementWidth_ = 0;
123  elementCount_ = 0;
124  isAddress_ = false;
125  isMemoryData_ = false;
126  swap_.clear();
127 }

References elementCount_, elementWidth_, index_, isAddress_, isMemoryData_, and swap_.

Referenced by loadState().

◆ CTypeString()

TCEString Operand::CTypeString ( ) const
virtual

Definition at line 222 of file Operand.cc.

222  {
223  if (isVector()) {
224  return "";
225  }
226  TCEString type;
227  switch (this->type()) {
228  case Operand::SINT_WORD:
229  type = "signed";
230  break;
231  case Operand::UINT_WORD:
232  type = "unsigned";
233  break;
234  case Operand::FLOAT_WORD:
235  return "float";
236  break;
238  return "double";
239  break;
240  case Operand::RAW_DATA:
241  return "";
242  break;
243  default:
244  // TODO: how do halffloats work?
245  // they should not need any casts.
246  // cannot return half as it's only supported in opencl.
247  return "";
248  }
249  if (elementWidth() <= 8) {
250  return type + " char";
251  }
252  if (elementWidth() <= 16) {
253  return type + " short";
254  }
255  if (elementWidth() == 64) {
256  return type + " long";
257  }
258  return type + " int";
259 }

References DOUBLE_WORD, elementWidth(), FLOAT_WORD, isVector(), RAW_DATA, SINT_WORD, type(), and UINT_WORD.

Here is the call graph for this function:

◆ defaultElementWidth()

int Operand::defaultElementWidth ( OperandType  type)
static

Returns default element width depending on operand's type.

Parameters
typeOperand type.
Returns
Element bit width of the operand.

Definition at line 557 of file Operand.cc.

557  {
558  if (type == DOUBLE_WORD || type == SLONG_WORD || type == ULONG_WORD) {
559  return 64;
560  } else if (type == HALF_FLOAT_WORD) {
561  return 16;
562  } else if (type == BOOL) {
563  return 1;
564  } else {
565  return 32;
566  }
567 }

References BOOL, DOUBLE_WORD, HALF_FLOAT_WORD, SLONG_WORD, type(), and ULONG_WORD.

Referenced by loadState(), OutputOperandDialog::onType(), InputOperandDialog::onType(), and Operand().

Here is the call graph for this function:

◆ elementCount()

int Operand::elementCount ( ) const
virtual

Returns total number of elements.

Returns
Number of elements.

Definition at line 298 of file Operand.cc.

298  {
299  return elementCount_;
300 }

References elementCount_.

Referenced by setElementCount(), and TDGenerator::ValueType::valueTypeStr().

◆ elementWidth()

int Operand::elementWidth ( ) const
virtual

Returns width of an operand element in bits.

Returns
Bit width of an element.

Definition at line 278 of file Operand.cc.

278  {
279  return elementWidth_;
280 }

References elementWidth_.

Referenced by TDGen::analyzeMachineVectorRegisterClasses(), CTypeString(), TDGen::operandChar(), setElementWidth(), TDGen::subwordWidthOfRawData(), and TDGenerator::ValueType::valueTypeStr().

◆ index()

int Operand::index ( ) const
virtual

◆ isAddress()

bool Operand::isAddress ( ) const
virtual

◆ isInput()

bool Operand::isInput ( ) const
virtual

◆ isMemoryData()

bool Operand::isMemoryData ( ) const
virtual

Returns true if Operand is memory data.

Returns
True if Operand is memory data, false otherwise.

Reimplemented in NullOperand.

Definition at line 351 of file Operand.cc.

351  {
352  return isMemoryData_;
353 }

References isMemoryData_.

Referenced by OSEdInfoView::operationPropertyView().

◆ isNull()

virtual bool Operand::isNull ( ) const
inlinevirtual

Reimplemented in NullOperand.

Definition at line 130 of file Operand.hh.

130 { return false; }

Referenced by llvm::LLVMTCEBuilder::emitInstruction(), and ConstantTransformer::runOnMachineFunction().

◆ isOutput()

bool Operand::isOutput ( ) const
virtual

Returns true if operand is output.

Returns
True if operand is output.

Reimplemented in NullOperand.

Definition at line 155 of file Operand.cc.

155  {
156  return !isInput_;
157 }

References isInput_.

Referenced by OperationDAGBuilder::connectOperandToNode(), OpsetDialog::createOperation(), TDGen::dagNodeToString(), llvm::LLVMTCEBuilder::emitInstruction(), and TDGen::patOutputs().

◆ isVector()

bool Operand::isVector ( ) const
virtual

Tells if the operand is a vector operand, in other words, has subwords.

Returns
True, if the operand is a vector operand.

Definition at line 268 of file Operand.cc.

268  {
269  return (elementCount_ > 1);
270 }

References elementCount_.

Referenced by TDGen::analyzeMachineVectorRegisterClasses(), CTypeString(), TDGen::hasRawOperands(), TDGen::hasRegisterClassSupport(), TDGen::operandChar(), TDGen::operandToString(), TDGen::subwordWidthOfRawData(), and writeCustomOpMacro().

◆ loadState()

void Operand::loadState ( const ObjectState state)
virtual

Loads Operand state from an ObjectState object.

Parameters
stateState containing operand properties.
Exceptions
ObjectStateLoadingExceptionIf loading fails for some reason.

Implements Serializable.

Definition at line 383 of file Operand.cc.

383  {
384  clear();
385 
386  string method = "Operand::loadState()";
387 
388  try {
389  index_ = state->intAttribute(OPRND_ID);
390  std::string typeString = state->stringAttribute(OPRND_TYPE);
391 
392  if (typeString.compare(SINT_WORD_STRING) == 0) {
393  type_ = SINT_WORD;
394  } else if (typeString.compare(UINT_WORD_STRING) == 0) {
395  type_ = UINT_WORD;
396  } else if (typeString.compare(SLONG_WORD_STRING) == 0) {
397  type_ = SLONG_WORD;
398  } else if (typeString.compare(ULONG_WORD_STRING) == 0) {
399  type_ = ULONG_WORD;
400  } else if (typeString.compare(FLOAT_WORD_STRING) == 0) {
401  type_ = FLOAT_WORD;
402  } else if (typeString.compare(DOUBLE_WORD_STRING) == 0) {
403  type_ = DOUBLE_WORD;
404  } else if (typeString.compare(HALF_FLOAT_WORD_STRING) == 0) {
406  } else if (typeString.compare(BOOL_STRING) == 0) {
407  type_ = BOOL;
408  } else if (typeString.compare(RAW_DATA_STRING) == 0) {
409  type_ = RAW_DATA;
410  } else {
411  string msg = "Invalid operand type: \"" + typeString + "\"";
412  throw Exception(__FILE__, __LINE__, method, msg);
413  }
414 
415  if (state->hasAttribute(OPRND_ELEM_WIDTH)) {
417  } else {
419  }
420 
421  if (state->hasAttribute(OPRND_ELEM_COUNT)) {
423  } else {
424  elementCount_ = 1;
425  }
426 
429 
430  if (state->hasAttribute(OPRND_MEM_UNITS)) {
432  }
433 
434  if (state->childCount() > 1) {
435  string msg = "Erronous number of children";
436  throw Exception(__FILE__, __LINE__, method, msg);
437  }
438 
439  for (int j = 0; j < state->childCount(); j++) {
440  ObjectState* child = state->child(j);
441  if (child->name() == OPRND_CAN_SWAP) {
442  for (int i = 0; i < child->childCount(); i++) {
443  ObjectState* canSwap = child->child(i);
444  int id =
445  Conversion::toInt(canSwap->stringAttribute(OPRND_ID));
446  swap_.insert(id);
447  }
448  } else {
449  string msg = "Unknown attribute: " + child->name();
450  throw Exception(__FILE__, __LINE__, method, msg);
451  }
452  }
453 
454  } catch (const NumberFormatException& n) {
455  string message = "Conversion failed: " + n.errorMessage();
457  __FILE__, __LINE__, method, message);
458 
459  } catch (const KeyNotFound& k) {
460  string message = "Attribute not found: " + k.errorMessage();
462  __FILE__, __LINE__, method, message);
463  error.setCause(k);
464  throw error;
465  } catch (Exception& e) {
466  string message =
467  "Error while loading operation operand settings. "
468  "An error in the operation format?" + e.errorMessageStack();
470  __FILE__, __LINE__, __func__, message);
471  newe.setCause(e);
472  throw newe;
473  }
474  catch (...) {
475  string message =
476  "Error while loading operation operand settings. "
477  "An error in the operation format?";
479  __FILE__, __LINE__, __func__, message);
480  throw newe;
481  }
482 }

References __func__, addressUnits_, BOOL, BOOL_STRING, ObjectState::boolAttribute(), canSwap(), ObjectState::child(), ObjectState::childCount(), clear(), defaultElementWidth(), DOUBLE_WORD, DOUBLE_WORD_STRING, elementCount_, elementWidth_, Exception::errorMessage(), Exception::errorMessageStack(), FLOAT_WORD, FLOAT_WORD_STRING, HALF_FLOAT_WORD, HALF_FLOAT_WORD_STRING, ObjectState::hasAttribute(), index_, ObjectState::intAttribute(), isAddress_, isMemoryData_, ObjectState::name(), OPRND_CAN_SWAP, OPRND_ELEM_COUNT, OPRND_ELEM_WIDTH, OPRND_ID, OPRND_MEM_ADDRESS, OPRND_MEM_DATA, OPRND_MEM_UNITS, OPRND_TYPE, RAW_DATA, RAW_DATA_STRING, Exception::setCause(), SINT_WORD, SINT_WORD_STRING, SLONG_WORD, SLONG_WORD_STRING, ObjectState::stringAttribute(), swap_, Conversion::toInt(), type_, typeString(), UINT_WORD, UINT_WORD_STRING, ULONG_WORD, and ULONG_WORD_STRING.

Referenced by OperationPimpl::loadState(), OutputOperandDialog::onOk(), InputOperandDialog::updateOperand(), and OperationPropertyDialog::updateSwapLists().

Here is the call graph for this function:

◆ memoryUnits()

int Operand::memoryUnits ( ) const
virtual

Returns the count of MAU's which this operand addresses.

returns 0 if the operand is not a memory address, or the size of the memory access int MAU's this operation accesses.

Returns
count of MAUs addressed by this operand.

Definition at line 341 of file Operand.cc.

341  {
342  return addressUnits_;
343 }

References addressUnits_.

Referenced by MemoryAliasAnalyzer::mausOfOperation().

◆ operator=()

Operand& Operand::operator= ( const Operand )
private

Assignment not allowed.

◆ saveState()

ObjectState * Operand::saveState ( ) const
virtual

Saves the state of the Operation to ObjectState object.

Returns
The created ObjectState tree.

Implements Serializable.

Definition at line 490 of file Operand.cc.

490  {
491 
492  ObjectState* root = new ObjectState("");
493  root->setAttribute(OPRND_ID, index_);
494 
495  switch(type_) {
496  case SINT_WORD:
498  break;
499  case UINT_WORD:
501  break;
502  case SLONG_WORD:
504  break;
505  case ULONG_WORD:
507  break;
508  case FLOAT_WORD:
510  break;
511  case DOUBLE_WORD:
513  break;
514  case HALF_FLOAT_WORD:
516  break;
517  case BOOL:
519  break;
520  case RAW_DATA:
522  break;
523  default:
525  }
526 
529 
532  if (addressUnits_ != 0) {
534  }
535 
536  if (swap_.size() > 0) {
538  set<int>::const_iterator it = swap_.begin();
539  while (it != swap_.end()) {
540  ObjectState* canSwapChild = new ObjectState(OPRND_IN);
541  canSwapChild->setAttribute(OPRND_ID, *it);
542  canSwap->addChild(canSwapChild);
543  it++;
544  }
545  root->addChild(canSwap);
546  }
547  return root;
548 }

References ObjectState::addChild(), addressUnits_, BOOL, BOOL_STRING, canSwap(), DOUBLE_WORD, DOUBLE_WORD_STRING, elementCount_, elementWidth_, FLOAT_WORD, FLOAT_WORD_STRING, HALF_FLOAT_WORD, HALF_FLOAT_WORD_STRING, index_, isAddress_, isMemoryData_, OPRND_CAN_SWAP, OPRND_ELEM_COUNT, OPRND_ELEM_WIDTH, OPRND_ID, OPRND_IN, OPRND_MEM_ADDRESS, OPRND_MEM_DATA, OPRND_MEM_UNITS, OPRND_TYPE, RAW_DATA, RAW_DATA_STRING, ObjectState::setAttribute(), SINT_WORD, SINT_WORD_STRING, SLONG_WORD, SLONG_WORD_STRING, swap_, type_, UINT_WORD, UINT_WORD_STRING, ULONG_WORD, ULONG_WORD_STRING, and UNKNOWN_TYPE_STRING.

Referenced by OperationPropertyDialog::updateSwapLists().

Here is the call graph for this function:

◆ setElementCount()

void Operand::setElementCount ( int  elementCount)
virtual

Sets the number of elements.

Parameters
Newelement count.

Definition at line 308 of file Operand.cc.

308  {
310 }

References elementCount(), and elementCount_.

Referenced by TDGen::writeOperationDefUsingGivenOperandTypes().

Here is the call graph for this function:

◆ setElementWidth()

void Operand::setElementWidth ( int  elementWidth)
virtual

Sets the element bit width.

Parameters
Newelement bit width.

Definition at line 288 of file Operand.cc.

288  {
290 }

References elementWidth(), and elementWidth_.

Referenced by TDGen::writeOperationDefUsingGivenOperandTypes().

Here is the call graph for this function:

◆ setType()

void Operand::setType ( OperandType  type)
virtual

Sets the operand type.

Parameters
typeThe new type of the operand.

Definition at line 175 of file Operand.cc.

175  {
176  type_ = type;
177 }

References type(), and type_.

Referenced by TDGen::writeOperationDefUsingGivenOperandTypes().

Here is the call graph for this function:

◆ swap()

const std::set< int > & Operand::swap ( ) const
virtual

Returns the set of operands that can be swapped with this operand.

Returns
The set of operands that can be swapped with this operand.

Reimplemented in NullOperand.

Definition at line 361 of file Operand.cc.

361  {
362  return swap_;
363 }

References swap_.

Referenced by TDGen::areImmediateOperandsLegal(), OSEdInfoView::operationPropertyView(), and TDGen::writeIntegerImmediateDefs().

◆ type()

Operand::OperandType Operand::type ( ) const
virtual

◆ typeString()

const std::string & Operand::typeString ( ) const
virtual

Returns the string type of the Operand.

Returns
The string type of the Operand.

Definition at line 185 of file Operand.cc.

185  {
186  switch (type_)
187  {
188  case SINT_WORD:
189  return SINT_WORD_STRING;
190  break;
191  case UINT_WORD:
192  return UINT_WORD_STRING;
193  break;
194  case SLONG_WORD:
195  return SLONG_WORD_STRING;
196  break;
197  case ULONG_WORD:
198  return ULONG_WORD_STRING;
199  break;
200  case FLOAT_WORD:
201  return FLOAT_WORD_STRING;
202  break;
203  case DOUBLE_WORD:
204  return DOUBLE_WORD_STRING;
205  break;
206  case HALF_FLOAT_WORD:
207  return HALF_FLOAT_WORD_STRING;
208  break;
209  case BOOL:
210  return BOOL_STRING;
211  break;
212  case RAW_DATA:
213  return RAW_DATA_STRING;
214  break;
215  default:
216  return UNKNOWN_TYPE_STRING;
217  break;
218  }
219 }

References BOOL, BOOL_STRING, DOUBLE_WORD, DOUBLE_WORD_STRING, FLOAT_WORD, FLOAT_WORD_STRING, HALF_FLOAT_WORD, HALF_FLOAT_WORD_STRING, RAW_DATA, RAW_DATA_STRING, SINT_WORD, SINT_WORD_STRING, SLONG_WORD, SLONG_WORD_STRING, type_, UINT_WORD, UINT_WORD_STRING, ULONG_WORD, ULONG_WORD_STRING, and UNKNOWN_TYPE_STRING.

Referenced by loadState(), and OSEdInfoView::operationPropertyView().

◆ width()

int Operand::width ( ) const
virtual

Member Data Documentation

◆ addressUnits_

int Operand::addressUnits_
private

size of the data this operation addresses. 0 if unknown.

Definition at line 153 of file Operand.hh.

Referenced by loadState(), memoryUnits(), and saveState().

◆ BOOL_STRING

const std::string Operand::BOOL_STRING = "Bool"
static

◆ DOUBLE_WORD_STRING

const std::string Operand::DOUBLE_WORD_STRING = "DoubleWord"
static

◆ elementCount_

int Operand::elementCount_
private

Number of total elements.

Definition at line 149 of file Operand.hh.

Referenced by clear(), elementCount(), isVector(), loadState(), saveState(), setElementCount(), and width().

◆ elementWidth_

int Operand::elementWidth_
private

Width of an element.

Definition at line 147 of file Operand.hh.

Referenced by clear(), elementWidth(), loadState(), Operand(), saveState(), setElementWidth(), and width().

◆ FLOAT_WORD_STRING

const std::string Operand::FLOAT_WORD_STRING = "FloatWord"
static

◆ HALF_FLOAT_WORD_STRING

const std::string Operand::HALF_FLOAT_WORD_STRING = "HalfFloatWord"
static

◆ index_

int Operand::index_
private

Index of the Operand.

Definition at line 141 of file Operand.hh.

Referenced by clear(), index(), loadState(), and saveState().

◆ isAddress_

bool Operand::isAddress_
private

Flag indicating whether Operand is address or not.

Definition at line 151 of file Operand.hh.

Referenced by clear(), isAddress(), loadState(), and saveState().

◆ isInput_

bool Operand::isInput_
private

Direction of operand.

Definition at line 143 of file Operand.hh.

Referenced by isInput(), and isOutput().

◆ isMemoryData_

bool Operand::isMemoryData_
private

Flag indicating whether Operand is memory data or not.

Definition at line 155 of file Operand.hh.

Referenced by clear(), isMemoryData(), loadState(), and saveState().

◆ OPRND_CAN_SWAP

const string Operand::OPRND_CAN_SWAP = "can-swap"
static

◆ OPRND_ELEM_COUNT

const string Operand::OPRND_ELEM_COUNT = "element-count"
static

◆ OPRND_ELEM_WIDTH

const string Operand::OPRND_ELEM_WIDTH = "element-width"
static

◆ OPRND_ID

const string Operand::OPRND_ID = "id"
static

◆ OPRND_IN

const string Operand::OPRND_IN = "in"
static

Object state name for input operand.

Definition at line 94 of file Operand.hh.

Referenced by saveState(), OperationSerializer::toXMLFormat(), and InputOperandDialog::updateOperand().

◆ OPRND_MEM_ADDRESS

const string Operand::OPRND_MEM_ADDRESS = "mem-address"
static

◆ OPRND_MEM_DATA

const string Operand::OPRND_MEM_DATA = "mem-data"
static

◆ OPRND_MEM_UNITS

const string Operand::OPRND_MEM_UNITS = "mem-units"
static

Object state name for memory unit count.

Definition at line 88 of file Operand.hh.

Referenced by loadState(), saveState(), OperationSerializer::setOperandProperties(), and OperationSerializer::toXMLFormat().

◆ OPRND_OUT

const string Operand::OPRND_OUT = "out"
static

Object state name for output operand.

Definition at line 96 of file Operand.hh.

◆ OPRND_TYPE

const string Operand::OPRND_TYPE = "type"
static

◆ RAW_DATA_STRING

const std::string Operand::RAW_DATA_STRING = "RawData"
static

◆ SINT_WORD_STRING

const std::string Operand::SINT_WORD_STRING = "SIntWord"
static

◆ SLONG_WORD_STRING

const std::string Operand::SLONG_WORD_STRING = "SLongWord"
static

◆ swap_

std::set<int> Operand::swap_
private

Indexes of Operands which can be swapped with this Operand.

Definition at line 157 of file Operand.hh.

Referenced by canSwap(), clear(), loadState(), saveState(), and swap().

◆ type_

OperandType Operand::type_
private

Type of the Operand.

Definition at line 145 of file Operand.hh.

Referenced by loadState(), Operand(), saveState(), setType(), type(), and typeString().

◆ UINT_WORD_STRING

const std::string Operand::UINT_WORD_STRING = "UIntWord"
static

◆ ULONG_WORD_STRING

const std::string Operand::ULONG_WORD_STRING = "ULongWord"
static

◆ UNKNOWN_TYPE_STRING

const std::string Operand::UNKNOWN_TYPE_STRING = "InvalidValue"
static

Definition at line 79 of file Operand.hh.

Referenced by saveState(), and typeString().


The documentation for this class was generated from the following files:
Operand::elementCount_
int elementCount_
Number of total elements.
Definition: Operand.hh:149
Operand::OPRND_ELEM_COUNT
static const std::string OPRND_ELEM_COUNT
Object state name for element count.
Definition: Operand.hh:100
ObjectState::hasAttribute
bool hasAttribute(const std::string &name) const
Definition: ObjectState.cc:205
Operand::OPRND_MEM_DATA
static const std::string OPRND_MEM_DATA
Object state name for memory data.
Definition: Operand.hh:90
Operand::BOOL
@ BOOL
Definition: Operand.hh:64
Operand::SINT_WORD_STRING
static const std::string SINT_WORD_STRING
Definition: Operand.hh:72
NumberFormatException
Definition: Exception.hh:421
ObjectState::stringAttribute
std::string stringAttribute(const std::string &name) const
Definition: ObjectState.cc:249
Operand::SLONG_WORD_STRING
static const std::string SLONG_WORD_STRING
Definition: Operand.hh:70
Operand::OPRND_MEM_ADDRESS
static const std::string OPRND_MEM_ADDRESS
Object state name for memory address.
Definition: Operand.hh:86
Operand::addressUnits_
int addressUnits_
size of the data this operation addresses. 0 if unknown.
Definition: Operand.hh:153
Operand::HALF_FLOAT_WORD
@ HALF_FLOAT_WORD
Definition: Operand.hh:63
Operand::OPRND_MEM_UNITS
static const std::string OPRND_MEM_UNITS
Object state name for memory unit count.
Definition: Operand.hh:88
Operand::elementCount
virtual int elementCount() const
Definition: Operand.cc:298
ObjectStateLoadingException
Definition: Exception.hh:551
Operand::elementWidth_
int elementWidth_
Width of an element.
Definition: Operand.hh:147
Operand::isAddress_
bool isAddress_
Flag indicating whether Operand is address or not.
Definition: Operand.hh:151
Serializable
Definition: Serializable.hh:44
Operand::UINT_WORD
@ UINT_WORD
Definition: Operand.hh:60
Operand::OPRND_CAN_SWAP
static const std::string OPRND_CAN_SWAP
Object state name for can swap.
Definition: Operand.hh:92
ObjectState
Definition: ObjectState.hh:59
Operand::elementWidth
virtual int elementWidth() const
Definition: Operand.cc:278
Operand::RAW_DATA_STRING
static const std::string RAW_DATA_STRING
Definition: Operand.hh:78
Operand::HALF_FLOAT_WORD_STRING
static const std::string HALF_FLOAT_WORD_STRING
Definition: Operand.hh:74
Operand::FLOAT_WORD_STRING
static const std::string FLOAT_WORD_STRING
Definition: Operand.hh:75
Operand::isVector
virtual bool isVector() const
Definition: Operand.cc:268
Operand::OPRND_ID
static const std::string OPRND_ID
Object state name for operand id.
Definition: Operand.hh:82
Operand::canSwap
virtual bool canSwap(const Operand &op) const
Definition: Operand.cc:372
Operand::isInput_
bool isInput_
Direction of operand.
Definition: Operand.hh:143
Operand::SLONG_WORD
@ SLONG_WORD
Definition: Operand.hh:66
Operand::DOUBLE_WORD_STRING
static const std::string DOUBLE_WORD_STRING
Definition: Operand.hh:76
Operand::typeString
virtual const std::string & typeString() const
Definition: Operand.cc:185
__func__
#define __func__
Definition: Application.hh:67
Operand::FLOAT_WORD
@ FLOAT_WORD
Definition: Operand.hh:61
Operand::UINT_WORD_STRING
static const std::string UINT_WORD_STRING
Definition: Operand.hh:73
Operand::index
virtual int index() const
Definition: Operand.cc:135
Exception::errorMessageStack
std::string errorMessageStack(bool messagesOnly=false) const
Definition: Exception.cc:138
ObjectState::child
ObjectState * child(int index) const
Definition: ObjectState.cc:471
ObjectState::addChild
void addChild(ObjectState *child)
Definition: ObjectState.cc:376
Operand::swap_
std::set< int > swap_
Indexes of Operands which can be swapped with this Operand.
Definition: Operand.hh:157
ObjectState::childCount
int childCount() const
Operand::SINT_WORD
@ SINT_WORD
Definition: Operand.hh:59
Exception
Definition: Exception.hh:54
Operand::OPRND_IN
static const std::string OPRND_IN
Object state name for input operand.
Definition: Operand.hh:94
Operand::ULONG_WORD
@ ULONG_WORD
Definition: Operand.hh:67
Operand::clear
void clear()
Definition: Operand.cc:120
Operand::RAW_DATA
@ RAW_DATA
Definition: Operand.hh:65
ObjectState::name
std::string name() const
Exception::errorMessage
std::string errorMessage() const
Definition: Exception.cc:123
Operand::UNKNOWN_TYPE_STRING
static const std::string UNKNOWN_TYPE_STRING
Definition: Operand.hh:79
Operand::OPRND_TYPE
static const std::string OPRND_TYPE
Object state name for operand type.
Definition: Operand.hh:84
Operand::DOUBLE_WORD
@ DOUBLE_WORD
Definition: Operand.hh:62
Operand::OPRND_ELEM_WIDTH
static const std::string OPRND_ELEM_WIDTH
Object state name for element width.
Definition: Operand.hh:98
Operand::type
virtual OperandType type() const
Definition: Operand.cc:165
TCEString
Definition: TCEString.hh:53
ObjectState::boolAttribute
bool boolAttribute(const std::string &name) const
Definition: ObjectState.cc:338
Operand::isMemoryData
virtual bool isMemoryData() const
Definition: Operand.cc:351
Operand::type_
OperandType type_
Type of the Operand.
Definition: Operand.hh:145
Operand::BOOL_STRING
static const std::string BOOL_STRING
Definition: Operand.hh:77
ObjectState::intAttribute
int intAttribute(const std::string &name) const
Definition: ObjectState.cc:276
ContainerTools::containsValue
static bool containsValue(const ContainerType &aContainer, const ElementType &aKey)
KeyNotFound
Definition: Exception.hh:285
Operand::isAddress
virtual bool isAddress() const
Definition: Operand.cc:328
Conversion::toInt
static int toInt(const T &source)
Operand::isMemoryData_
bool isMemoryData_
Flag indicating whether Operand is memory data or not.
Definition: Operand.hh:155
Operand::isInput
virtual bool isInput() const
Definition: Operand.cc:145
Operand::ULONG_WORD_STRING
static const std::string ULONG_WORD_STRING
Definition: Operand.hh:71
Operand::defaultElementWidth
static int defaultElementWidth(OperandType type)
Definition: Operand.cc:557
Operand::index_
int index_
Index of the Operand.
Definition: Operand.hh:141
ObjectState::setAttribute
void setAttribute(const std::string &name, const std::string &value)
Definition: ObjectState.cc:100
Operand::swap
virtual const std::set< int > & swap() const
Definition: Operand.cc:361