X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Fxtensa-isa.c;h=138f6eceb7254e696c3c8cf0876c863489b6e43c;hb=e9e0a58e87c33963dda1800900c0e43b7c0213c0;hp=362e47c31797a04ef9f69525d49f2137d06dad34;hpb=3db64b009284dda3a1ce10a91beb1297475e60a7;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/xtensa-isa.c b/bfd/xtensa-isa.c index 362e47c317..138f6eceb7 100644 --- a/bfd/xtensa-isa.c +++ b/bfd/xtensa-isa.c @@ -1,11 +1,11 @@ /* 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. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -15,7 +15,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ #include "sysdep.h" #include "bfd.h" @@ -410,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++) @@ -1520,6 +1526,17 @@ xtensa_state_is_exported (xtensa_isa isa, xtensa_state st) } +int +xtensa_state_is_shared_or (xtensa_isa isa, xtensa_state st) +{ + xtensa_isa_internal *intisa = (xtensa_isa_internal *) isa; + CHECK_STATE (intisa, st, XTENSA_UNDEFINED); + if ((intisa->states[st].flags & XTENSA_STATE_IS_SHARED_OR) != 0) + return 1; + return 0; +} + + /* Sysregs. */