bfd/
authorBob Wilson <bob.wilson@acm.org>
Mon, 3 Mar 2008 23:23:41 +0000 (23:23 +0000)
committerBob Wilson <bob.wilson@acm.org>
Mon, 3 Mar 2008 23:23:41 +0000 (23:23 +0000)
* xtensa-isa.c (xtensa_isa_num_pipe_stages): Make max_stage static and
only compute its value once.
gas/
* config/tc-xtensa.c (xtensa_num_pipe_stages): New.
(md_begin): Initialize it.
(resources_conflict): Use it.

bfd/ChangeLog
bfd/xtensa-isa.c
gas/ChangeLog
gas/config/tc-xtensa.c

index 883d2e5..6490fcf 100644 (file)
@@ -1,3 +1,8 @@
+2008-03-03  Bob Wilson  <bob.wilson@acm.org>
+       
+       * xtensa-isa.c (xtensa_isa_num_pipe_stages): Make max_stage static and
+       only compute its value once.
+       
 2008-03-03  Alan Modra  <amodra@bigpond.net.au>
 
        * elf32-spu.c (struct got_entry): Add "addend" field.
index ced8257..35b27db 100644 (file)
@@ -1,5 +1,5 @@
 /* Configurable Xtensa ISA support.
-   Copyright 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+   Copyright 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -411,7 +411,12 @@ xtensa_isa_num_pipe_stages (xtensa_isa isa)
   xtensa_opcode opcode;
   xtensa_funcUnit_use *use;
   int num_opcodes, num_uses;
-  int i, stage, max_stage = XTENSA_UNDEFINED;
+  int i, stage;
+  static int max_stage = XTENSA_UNDEFINED;
+
+  /* Only compute the value once.  */
+  if (max_stage != XTENSA_UNDEFINED)
+    return max_stage + 1;
 
   num_opcodes = xtensa_isa_num_opcodes (isa);
   for (opcode = 0; opcode < num_opcodes; opcode++)
index 97a7aab..80337c4 100644 (file)
@@ -1,4 +1,11 @@
 2008-03-03  Sterling Augustine  <sterling@tensilica.com>
+           Bob Wilson  <bob.wilson@acm.org>
+       
+       * config/tc-xtensa.c (xtensa_num_pipe_stages): New.
+       (md_begin): Initialize it.
+       (resources_conflict): Use it.
+       
+2008-03-03  Sterling Augustine  <sterling@tensilica.com>
        
        * config/tc-xtensa.h (RELAX_XTENSA_NONE): New.
        
index 1321bfb..6ef1825 100644 (file)
@@ -79,6 +79,7 @@ bfd_boolean absolute_literals_supported = XSHAL_USE_ABSOLUTE_LITERALS;
 
 static vliw_insn cur_vinsn;
 
+unsigned xtensa_num_pipe_stages;
 unsigned xtensa_fetch_width = XCHAL_INST_FETCH_WIDTH;
 
 static enum debug_info_type xt_saved_debug_type = DEBUG_NONE;
@@ -5084,6 +5085,8 @@ md_begin (void)
   xtensa_rsr_lcount_opcode = xtensa_opcode_lookup (isa, "rsr.lcount");
   xtensa_waiti_opcode = xtensa_opcode_lookup (isa, "waiti");
 
+  xtensa_num_pipe_stages = xtensa_isa_num_pipe_stages (isa);
+
   init_op_placement_info_table ();
 
   /* Set up the assembly state.  */
@@ -6006,7 +6009,7 @@ resources_conflict (vliw_insn *vinsn)
     {
       xtensa_isa isa = xtensa_default_isa;
       rt = new_resource_table
-       (isa, xtensa_isa_num_pipe_stages (isa),
+       (isa, xtensa_num_pipe_stages,
         xtensa_isa_num_funcUnits (isa),
         (unit_num_copies_func) xtensa_funcUnit_num_copies,
         (opcode_num_units_func) xtensa_opcode_num_funcUnit_uses,