+2005-12-20 Sterling Augustine <sterling@tensilica.com>
+
+ * config/tc-xtensa.c (xg_find_narrowest_format): Optimize 1 slot case.
+ (xg_init_vinsn): Remove redundant initialization.
+ (xg_clear_vinsn): Zero all the slots with a single memset.
+ * config/xtensa-istack.h (vliw_insn): Move insnbuf field after slots.
+
2005-12-20 Nathan Sidwell <nathan@codesourcery.com>
* doc/t-mt.texi: Update MS1 to MT.
vliw_insn v_copy = *vinsn;
xtensa_opcode nop_opcode = xtensa_nop_opcode;
+ if (vinsn->num_slots == 1)
+ return xg_get_single_format (vinsn->slots[0].opcode);
+
for (format = 0; format < xtensa_isa_num_formats (isa); format++)
{
v_copy = *vinsn;
for (i = 0; i < MAX_SLOTS; i++)
{
- tinsn_init (&v->slots[i]);
- v->slots[i].opcode = XTENSA_UNDEFINED;
v->slotbuf[i] = xtensa_insnbuf_alloc (isa);
if (v->slotbuf[i] == NULL)
as_fatal (_("out of memory"));
xg_clear_vinsn (vliw_insn *v)
{
int i;
+
+ memset (v, 0, offsetof (vliw_insn, insnbuf));
+
v->format = XTENSA_UNDEFINED;
v->num_slots = 0;
v->inside_bundle = FALSE;
debug_type = xt_saved_debug_type;
for (i = 0; i < MAX_SLOTS; i++)
- {
- memset (&v->slots[i], 0, sizeof (TInsn));
- v->slots[i].opcode = XTENSA_UNDEFINED;
- }
+ v->slots[i].opcode = XTENSA_UNDEFINED;
}
typedef struct vliw_insn
{
xtensa_format format;
- xtensa_insnbuf insnbuf;
int num_slots;
unsigned int inside_bundle;
TInsn slots[MAX_SLOTS];
+ xtensa_insnbuf insnbuf;
xtensa_insnbuf slotbuf[MAX_SLOTS];
} vliw_insn;