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;
562 const string procName =
"BinaryEncoding::addInstructionFormat";
604 const string procName =
"BinaryEncoding::socketCodeTable";
605 throw OutOfRange(__FILE__, __LINE__, procName);
624 if (table.
name() == name) {
649 const string procName =
"BinaryEncoding::addSocketCodeTable";
684 int w =
width(iTemplate);
687 longestTemplate = iTemplate;
725 const string procName =
"BinaryEncoding::childField";
726 throw OutOfRange(__FILE__, __LINE__, procName);
735 for (
int i = 0; i < moveSlots; i++) {
743 for (
int i = 0; i < immediateSlots; i++) {
751 for (
int i = 0; i < limmDstRegFields; i++) {
776 int w =
width(iTemplate);
777 if (w > maxWidth) maxWidth = w;
793 for (
int i = 0; i < moveSlots; i++) {
798 for (
int i = 0; i < immediateSlots; i++) {
803 for (
int i = 0; i < limmDstRegFields; i++) {
828 const string procName =
"BinaryEncoding::loadState";
833 for (
int i = 0; i < state->
childCount(); i++) {
844 for (
int i = 0; i < newState->
childCount(); i++) {
848 }
else if (child->
name() ==
851 }
else if (child->
name() ==
854 }
else if (child->
name() ==
883 for (
int i = 0; i < moveSlots; i++) {
890 for (
int i = 0; i < immediateSlots; i++) {
897 for (
int i = 0; i < limmDstRegFields; i++) {
904 for (
int i = 0; i < tableCount; i++) {
914 for (TemplateExtraBitCountMap::const_iterator
919 int bitCount = (*i).second;
925 templateNameObj->
setValue(templateName);
955 for (SocketCodeTableContainer::const_iterator iter =
socketCodes_.begin();
958 if (table->
name() == name) {
1015 const TCEString& templateName,
int bitCount) {
1021 TemplateExtraBitCountMap::const_iterator pos =
1025 return (*pos).second;
#define assert(condition)
int instructionFormatCount() const
void addInstructionFormat(InstructionFormat &format)
ImmediateControlField & immediateControlField() const
static const std::string OSNAME_TEMPLATE_NAME
int socketCodeTableCount() const
LImmDstRegisterField & longImmDstRegisterField(int index) const
static const std::string OSNAME_BEM
ObjectState name for binary encoding.
int moveSlotCount() const
bool hasSocketCodeTable(const std::string &name) const
void addLongImmDstRegisterField(LImmDstRegisterField &field)
void addSocketCodeTable(SocketCodeTable &table)
virtual int width() const
bool hasInstructionFormat(const std::string &name) const
int longestTemplateExtraBits() const
void removeMoveSlot(MoveSlot &slot)
virtual ObjectState * saveState() const
ImmediateSlotContainer immediateSlots_
A container for immediate slots.
virtual int childFieldCount() const
void deleteInstructionFormats()
int templateExtraBits(const TCEString &templateName) const
int immediateSlotCount() const
static const std::string OSNAME_TEMPLATE_EXTRA_BIT_COUNT
MoveSlot & moveSlot(int index) const
InstructionFormatContainer instructionFormats_
A container for instruction formats.
int longImmDstRegisterFieldCount() const
MoveSlotContainer moveSlots_
A container for move slots.
void removeLongImmDstRegisterField(LImmDstRegisterField &field)
LImmDstRegisterFieldContainer longImmDstRegFields_
A container for long immediate register fields.
void addMoveSlot(MoveSlot &slot)
virtual void loadState(const ObjectState *state)
bool hasImmediateSlot(const std::string &name) const
void unsetImmediateControlField()
void addImmediateSlot(ImmediateSlotField &slot)
TemplateExtraBitCountMap extraTemplateBits_
Extra (padding) bits per instruction template.
void removeInstructionFormat(InstructionFormat &format)
void removeSocketCodeTable(SocketCodeTable &table)
void removeImmediateSlot(ImmediateSlotField &slot)
void deleteLongImmDstRegisterFields()
ImmediateSlotField & immediateSlot(int index) const
void setImmediateControlField(ImmediateControlField &field)
SocketCodeTableContainer socketCodes_
A container for socket code tables.
bool hasMoveSlot(const std::string &name) const
SocketCodeTable & socketCodeTable(int index) const
virtual ~BinaryEncoding()
bool hasImmediateControlField() const
static const std::string OSNAME_TEMPLATE_EXTRA_BITS
ImmediateControlField * immediateField_
The immediate control field.
virtual InstructionField & childField(int position) const
void deleteImmediateSlots()
InstructionFormat & instructionFormat(int index) const
void setTemplateExtraBits(const TCEString &templateName, int bitCount)
InstructionField * parent() const
static void reorderSubfields(ObjectState *state)
int relativePosition() const
BinaryEncoding * parent() const
bool usedByInstructionTemplate(const std::string &instructionTemplate) const
virtual int width() const
static const std::string OSNAME_LIMM_DST_REGISTER_FIELD
ObjectState name for long immediate destination register field.
virtual ObjectState * saveState() const
std::string immediateUnit(const std::string &instructionTemplate) const
BinaryEncoding * parent() const
virtual ObjectState * saveState() const
virtual int width() const
static const std::string OSNAME_MOVE_SLOT
ObjectState name for move slot.
static NullInstructionField & instance()
static NullSocketCodeTable & instance()
ObjectState * childByName(const std::string &name) const
void setValue(const std::string &value)
ObjectState * child(int index) const
void addChild(ObjectState *child)
std::string stringValue() const
static const std::string OSNAME_SOCKET_CODE_TABLE
ObjectState name for socket code table.
virtual ObjectState * saveState() const
BinaryEncoding * parent() const