OpenASIP
2.0
|
#include <ImmInfo.hh>
Public Member Functions | |
ImmInfo ()=default | |
virtual | ~ImmInfo ()=default |
size_t | count (const ImmInfoKey &key) const |
size_t | count (const Operation &operation, const Operand &operand) const |
size_t | count (const Operation &operation, int inputOperandId) const |
const ImmInfoValue & | widestImmediate (const ImmInfoKey &key) const |
const ImmInfoValue & | widestImmediate (const Operation &operation, const Operand &operand) const |
const ImmInfoValue & | widestImmediate (const Operation &operation, int inputOperandId) const |
const ImmInfoValue & | narrowestImmediate (const ImmInfoKey &key) const |
std::pair< int64_t, int64_t > | immediateValueBounds (const ImmInfoKey &key, int destWidth) const |
std::pair< int64_t, int64_t > | immediateValueBounds (const Operation &operation, const Operand &operand, int destWidth) const |
std::pair< int64_t, int64_t > | immediateValueBounds (const Operation &operation, int inputOperandId, int destWidth) const |
bool | canTakeImmediate (const Operation &operation, int inputOperandId, int64_t value, int destWidth) |
bool | canTakeImmediateByWidth (const Operation &operation, int inputOperandId, int bitWidth) |
Static Public Member Functions | |
static ImmInfoKey | key (const Operation &operation, int inputOperandId) |
static ImmInfoKey | key (const Operation &operation, const Operand &operand) |
static int | registerImmediateLoadWidth (const TTAMachine::RegisterFile &targetRF, bool allowSignExtension=false) |
Definition at line 82 of file ImmInfo.hh.
|
default |
|
virtualdefault |
bool ImmInfo::canTakeImmediate | ( | const Operation & | operation, |
int | inputOperandId, | ||
int64_t | value, | ||
int | destWidth | ||
) |
Definition at line 252 of file ImmInfo.cc.
References key(), MathTools::requiredBits(), MathTools::requiredBitsSigned(), ImmInfoValue::signExtending(), and ImmInfoValue::width().
Referenced by TDGen::getLLVMPatternWithConstants().
bool ImmInfo::canTakeImmediateByWidth | ( | const Operation & | operation, |
int | inputOperandId, | ||
int | bitWidth | ||
) |
Definition at line 275 of file ImmInfo.cc.
References key(), and ImmInfoValue::width().
Referenced by TDGen::getLLVMPatternWithConstants().
|
inline |
Definition at line 87 of file ImmInfo.hh.
References key().
Referenced by TDGen::areImmediateOperandsLegal(), count(), and OperationDAGSelector::findDags().
Returns the entry count for operation, operand pair (key).
Definition at line 70 of file ImmInfo.cc.
References key().
size_t ImmInfo::count | ( | const Operation & | operation, |
int | inputOperandId | ||
) | const |
Returns the entry count for operation, operand pair (key).
Definition at line 80 of file ImmInfo.cc.
References count(), and Operation::operand().
std::pair< int64_t, int64_t > ImmInfo::immediateValueBounds | ( | const ImmInfoKey & | key, |
int | destWidth | ||
) | const |
Returns smallest and largest number that can be transported to operation operand.
The bounds are merged from multiple immediate sources. For example, if immediates can be transported from two different sources, where the one is 4 bits zero extending and the another is 3 bits sign extending, the resulting bound is [-4, 15].
if destination bit width is specified, then the bounds are ...TODO
destWidth | The destination width, where the immediates are transported to. By default it is unspecified/unlimited. |
Definition at line 219 of file ImmInfo.cc.
References key().
Referenced by TDGen::createConstantMaterializationPatterns(), and immediateValueBounds().
std::pair< int64_t, int64_t > ImmInfo::immediateValueBounds | ( | const Operation & | operation, |
const Operand & | operand, | ||
int | destWidth | ||
) | const |
Same as immediateValueBounds(const ImmInfoKey& key).
Definition at line 296 of file ImmInfo.cc.
References immediateValueBounds(), and key().
std::pair< int64_t, int64_t > ImmInfo::immediateValueBounds | ( | const Operation & | operation, |
int | inputOperandId, | ||
int | destWidth | ||
) | const |
Same as immediateValueBounds(const ImmInfoKey& key).
Definition at line 309 of file ImmInfo.cc.
References immediateValueBounds(), and Operation::operand().
|
static |
Definition at line 61 of file ImmInfo.cc.
References Operand::index(), Operation::name(), and TCEString::upper().
|
static |
Returns key for ImmInfo data structure.
Definition at line 57 of file ImmInfo.cc.
References Operation::name(), and TCEString::upper().
Referenced by canTakeImmediate(), canTakeImmediateByWidth(), count(), TDGen::dagNodeToString(), TDGen::immediateOperandNameForEmulatedOperation(), immediateValueBounds(), narrowestImmediate(), TDGen::patInputs(), widestImmediate(), and TDGen::writeIntegerImmediateDefs().
const ImmInfoValue & ImmInfo::narrowestImmediate | ( | const ImmInfoKey & | key | ) | const |
returns narrowest (non-zero width) immediate bit width by the key.
Definition at line 140 of file ImmInfo.cc.
References assert, key(), and THROW_EXCEPTION.
|
static |
Returns maximum immediate in bit width which can be transported to the RF.
targetRF | The target register file. |
allowSignExtension | If representation of the transported immediate should not change set it to false (default). |
Definition at line 326 of file ImmInfo.cc.
References assert, TTAMachine::Machine::busNavigator(), TTAMachine::Machine::immediateUnitNavigator(), TTAMachine::Machine::instructionTemplateNavigator(), and TTAMachine::Component::machine().
Referenced by llvm::TCETargetMachine::calculateSupportedImmediates().
const ImmInfoValue & ImmInfo::widestImmediate | ( | const ImmInfoKey & | key | ) | const |
Returns the entry count by the key.
Definition at line 89 of file ImmInfo.cc.
References assert, key(), and THROW_EXCEPTION.
Referenced by widestImmediate().
const ImmInfoValue & ImmInfo::widestImmediate | ( | const Operation & | operation, |
const Operand & | operand | ||
) | const |
returns widest immediate bit width by the key.
operation | The operation as the part of the key. |
inputOperandId | The input operand of the operation as the of the key. |
Definition at line 116 of file ImmInfo.cc.
References key(), and widestImmediate().
const ImmInfoValue & ImmInfo::widestImmediate | ( | const Operation & | operation, |
int | inputOperandId | ||
) | const |
returns widest immediate bit width by the key.
operation | The operation as the part of the key. |
inputOperandId | The input operand id of the operation as the of the key. |
Definition at line 130 of file ImmInfo.cc.
References Operation::operand(), and widestImmediate().