diff options
author | Bob Wilson <bob.wilson@acm.org> | 2008-03-03 23:23:41 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@acm.org> | 2008-03-03 23:23:41 +0000 |
commit | 77cba8a32b4cec9c12249fa59391242c039a1842 (patch) | |
tree | d45203ee16e0e37165d0e50b0bbd552fe3c98cb8 /bfd | |
parent | 332fbd6f66ba68a2452e153e830b6d5c6560e066 (diff) | |
download | binutils-77cba8a32b4cec9c12249fa59391242c039a1842.zip binutils-77cba8a32b4cec9c12249fa59391242c039a1842.tar.gz binutils-77cba8a32b4cec9c12249fa59391242c039a1842.tar.bz2 |
bfd/
* 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.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/xtensa-isa.c | 9 |
2 files changed, 12 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 883d2e5..6490fcf 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -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. diff --git a/bfd/xtensa-isa.c b/bfd/xtensa-isa.c index ced8257..35b27db 100644 --- a/bfd/xtensa-isa.c +++ b/bfd/xtensa-isa.c @@ -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++) |