diff options
author | Bob Wilson <bob.wilson@acm.org> | 2005-12-20 18:13:32 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@acm.org> | 2005-12-20 18:13:32 +0000 |
commit | 65738a7dbcb8f057258b0e3c6391a45c80f1dcc8 (patch) | |
tree | 03a83292583bd177318a30e6c4c4d762a271f3a0 /gas | |
parent | 0bcc32ae3bfa56e5beee79f1db5dc1324de6c53b (diff) | |
download | gdb-65738a7dbcb8f057258b0e3c6391a45c80f1dcc8.zip gdb-65738a7dbcb8f057258b0e3c6391a45c80f1dcc8.tar.gz gdb-65738a7dbcb8f057258b0e3c6391a45c80f1dcc8.tar.bz2 |
* 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.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 7 | ||||
-rw-r--r-- | gas/config/tc-xtensa.c | 13 | ||||
-rw-r--r-- | gas/config/xtensa-istack.h | 2 |
3 files changed, 15 insertions, 7 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index c39cf3d..a8df9a3 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +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. diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c index 57fb7b2..6b1b178 100644 --- a/gas/config/tc-xtensa.c +++ b/gas/config/tc-xtensa.c @@ -6403,6 +6403,9 @@ xg_find_narrowest_format (vliw_insn *vinsn) 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; @@ -11417,8 +11420,6 @@ xg_init_vinsn (vliw_insn *v) 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")); @@ -11430,6 +11431,9 @@ static void 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; @@ -11438,10 +11442,7 @@ xg_clear_vinsn (vliw_insn *v) 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; } diff --git a/gas/config/xtensa-istack.h b/gas/config/xtensa-istack.h index c7eaad7..248e73f 100644 --- a/gas/config/xtensa-istack.h +++ b/gas/config/xtensa-istack.h @@ -89,10 +89,10 @@ expressionS *tinsn_get_tok (TInsn *, int); 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; |