Go to the documentation of this file.
55 "template-extra-bits";
123 const string procName =
"BinaryEncoding::moveSlot";
124 throw OutOfRange(__FILE__, __LINE__, procName);
139 for (MoveSlotContainer::const_iterator iter =
moveSlots_.begin();
142 if (slot->
name() == name) {
161 for (MoveSlotContainer::const_iterator iter =
moveSlots_.begin();
164 if (slot->
name() == name) {
169 const string procName =
"BinaryEncoding::moveSlot";
188 const string procName =
"BinaryEncoding::addMoveSlot";
236 const string procName =
"BinaryEncoding::immediateSlot";
237 throw OutOfRange(__FILE__, __LINE__, procName);
254 for (ImmediateSlotContainer::const_iterator iter =
258 if (slot->
name() == name) {
277 for (ImmediateSlotContainer::const_iterator iter =
281 if (slot->
name() == name) {
286 const string procName =
"BinaryEncoding::immediateSlot";
305 const string procName =
"BinaryEncoding::addImmediateSlot";
372 const string procName =
"BinaryEncoding::setImmediateControlField";
435 const std::string& iTemp,
const std::string& dstUnit)
const {
437 for (
int i = 0; i < fields; i++) {
506 return it->name() == name;
543 const string procName =
"BinaryEncoding::addInstructionFormat";
585 const string procName =
"BinaryEncoding::socketCodeTable";
586 throw OutOfRange(__FILE__, __LINE__, procName);
605 if (table.
name() == name) {
630 const string procName =
"BinaryEncoding::addSocketCodeTable";
665 int w =
width(iTemplate);
668 longestTemplate = iTemplate;
706 const string procName =
"BinaryEncoding::childField";
707 throw OutOfRange(__FILE__, __LINE__, procName);
716 for (
int i = 0; i < moveSlots; i++) {
724 for (
int i = 0; i < immediateSlots; i++) {
732 for (
int i = 0; i < limmDstRegFields; i++) {
757 int w =
width(iTemplate);
758 if (w > maxWidth) maxWidth = w;
774 for (
int i = 0; i < moveSlots; i++) {
779 for (
int i = 0; i < immediateSlots; i++) {
784 for (
int i = 0; i < limmDstRegFields; i++) {
809 const string procName =
"BinaryEncoding::loadState";
814 for (
int i = 0; i < state->
childCount(); i++) {
825 for (
int i = 0; i < newState->
childCount(); i++) {
829 }
else if (child->
name() ==
832 }
else if (child->
name() ==
835 }
else if (child->
name() ==
864 for (
int i = 0; i < moveSlots; i++) {
871 for (
int i = 0; i < immediateSlots; i++) {
878 for (
int i = 0; i < limmDstRegFields; i++) {
885 for (
int i = 0; i < tableCount; i++) {
895 for (TemplateExtraBitCountMap::const_iterator
900 int bitCount = (*i).second;
906 templateNameObj->
setValue(templateName);
936 for (SocketCodeTableContainer::const_iterator iter =
socketCodes_.begin();
939 if (table->
name() == name) {
996 const TCEString& templateName,
int bitCount) {
1002 TemplateExtraBitCountMap::const_iterator pos =
1006 return (*pos).second;
InstructionFormat & instructionFormat(int index) const
virtual int childFieldCount() const
static const std::string OSNAME_MOVE_SLOT
ObjectState name for move slot.
ImmediateSlotField & immediateSlot(int index) const
bool hasMoveSlot(const std::string &name) const
void deleteImmediateSlots()
void removeInstructionFormat(InstructionFormat &format)
void removeMoveSlot(MoveSlot &slot)
InstructionFormatContainer instructionFormats_
A container for instruction formats.
int longImmDstRegisterFieldCount() const
MoveSlotContainer moveSlots_
A container for move slots.
void setImmediateControlField(ImmediateControlField &field)
void unsetImmediateControlField()
static const std::string OSNAME_TEMPLATE_EXTRA_BITS
bool hasImmediateControlField() const
int socketCodeTableCount() const
virtual int width() const
virtual ObjectState * saveState() const
bool hasInstructionFormat(const std::string name) const
SocketCodeTable & socketCodeTable(int index) const
static NullInstructionField & instance()
static const std::string OSNAME_TEMPLATE_NAME
ObjectState * childByName(const std::string &name) const
virtual ObjectState * saveState() const
int templateExtraBits(const TCEString &templateName) const
#define assert(condition)
BinaryEncoding * parent() const
virtual ObjectState * saveState() const
void addLongImmDstRegisterField(LImmDstRegisterField &field)
ImmediateControlField * immediateField_
The immediate control field.
InstructionField * parent() const
int longestTemplateExtraBits() const
std::string immediateUnit(const std::string &instructionTemplate) const
virtual void loadState(const ObjectState *state)
ObjectState * child(int index) const
void addChild(ObjectState *child)
LImmDstRegisterFieldContainer longImmDstRegFields_
A container for long immediate register fields.
static NullSocketCodeTable & instance()
virtual int width() const
static void reorderSubfields(ObjectState *state)
void removeSocketCodeTable(SocketCodeTable &table)
virtual int width() const
SocketCodeTableContainer socketCodes_
A container for socket code tables.
int instructionFormatCount() const
static const std::string OSNAME_LIMM_DST_REGISTER_FIELD
ObjectState name for long immediate destination register field.
void removeImmediateSlot(ImmediateSlotField &slot)
virtual ObjectState * saveState() const
TemplateExtraBitCountMap extraTemplateBits_
Extra (padding) bits per instruction template.
int immediateSlotCount() const
bool usedByInstructionTemplate(const std::string &instructionTemplate) const
static const std::string OSNAME_TEMPLATE_EXTRA_BIT_COUNT
bool hasImmediateSlot(const std::string &name) const
void setTemplateExtraBits(const TCEString &templateName, int bitCount)
virtual ~BinaryEncoding()
void addMoveSlot(MoveSlot &slot)
BinaryEncoding * parent() const
bool hasSocketCodeTable(const std::string &name) const
void addInstructionFormat(InstructionFormat &format)
static const std::string OSNAME_BEM
ObjectState name for binary encoding.
void addSocketCodeTable(SocketCodeTable &table)
static const std::string OSNAME_SOCKET_CODE_TABLE
ObjectState name for socket code table.
void deleteInstructionFormats()
ImmediateSlotContainer immediateSlots_
A container for immediate slots.
int relativePosition() const
std::string stringValue() const
ImmediateControlField & immediateControlField() const
void removeLongImmDstRegisterField(LImmDstRegisterField &field)
MoveSlot & moveSlot(int index) const
virtual InstructionField & childField(int position) const
void deleteLongImmDstRegisterFields()
BinaryEncoding * parent() const
int moveSlotCount() const
void addImmediateSlot(ImmediateSlotField &slot)
LImmDstRegisterField & longImmDstRegisterField(int index) const
void setValue(const std::string &value)