- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2005
- Free Software Foundation, Inc.
+ Copyright (C) 1996-2019 Free Software Foundation, Inc.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ It is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ License for more details.
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. */
#include "sysdep.h"
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. */
#include "sysdep.h"
static unsigned int hash_keyword_name
(const CGEN_KEYWORD *, const char *, int);
static unsigned int hash_keyword_value
static unsigned int hash_keyword_name
(const CGEN_KEYWORD *, const char *, int);
static unsigned int hash_keyword_value
&& ! strchr (kt->nonalpha_chars, ke->name[i]))
{
size_t idx = strlen (kt->nonalpha_chars);
&& ! strchr (kt->nonalpha_chars, ke->name[i]))
{
size_t idx = strlen (kt->nonalpha_chars);
/* If you hit this limit, please don't just
increase the size of the field, instead
look for a better algorithm. */
/* If you hit this limit, please don't just
increase the size of the field, instead
look for a better algorithm. */
if ((length % insn_chunk_bitsize) != 0)
abort ();
for (i = 0; i < length; i += insn_chunk_bitsize) /* NB: i == bits */
{
if ((length % insn_chunk_bitsize) != 0)
abort ();
for (i = 0; i < length; i += insn_chunk_bitsize) /* NB: i == bits */
{
- index = i; /* NB: not dependent on endianness; opposite of cgen_put_insn_value! */
- this_value = bfd_get_bits (& buf[index / 8], insn_chunk_bitsize, big_p);
+
+ bit_index = i; /* NB: not dependent on endianness; opposite of cgen_put_insn_value! */
+ this_value = bfd_get_bits (& buf[bit_index / 8], insn_chunk_bitsize, big_p);
if ((length % insn_chunk_bitsize) != 0)
abort ();
for (i = 0; i < length; i += insn_chunk_bitsize) /* NB: i == bits */
{
if ((length % insn_chunk_bitsize) != 0)
abort ();
for (i = 0; i < length; i += insn_chunk_bitsize) /* NB: i == bits */
{
- int index;
- index = (length - insn_chunk_bitsize - i); /* NB: not dependent on endianness! */
- bfd_put_bits ((bfd_vma) value, & buf[index / 8], insn_chunk_bitsize, big_p);
+ int bit_index;
+
+ bit_index = (length - insn_chunk_bitsize - i); /* NB: not dependent on endianness! */
+ bfd_put_bits ((bfd_vma) value, & buf[bit_index / 8], insn_chunk_bitsize, big_p);
- buf = (unsigned char *) alloca (cd->max_insn_bitsize / 8);
- cgen_put_insn_value (cd, buf, length, insn_int_value);
- base_insn = insn_int_value;
+ insn_bytes_value = (unsigned char *) xmalloc (cd->max_insn_bitsize / 8);
+ cgen_put_insn_value (cd, insn_bytes_value, length, insn_int_value);
- buf = insn_bytes_value;
- base_insn = cgen_get_insn_value (cd, buf, length);
+ insn_int_value = cgen_get_insn_value (cd, insn_bytes_value, length);
/* The instructions are stored in hash lists.
Pick the first one and keep trying until we find the right one. */
/* The instructions are stored in hash lists.
Pick the first one and keep trying until we find the right one. */
== CGEN_INSN_BASE_VALUE (insn))
{
/* ??? 0 is passed for `pc' */
int elength = CGEN_EXTRACT_FN (cd, insn)
== CGEN_INSN_BASE_VALUE (insn))
{
/* ??? 0 is passed for `pc' */
int elength = CGEN_EXTRACT_FN (cd, insn)
- (cd, insn, info, base_insn, fields, (bfd_vma) 0);
+ (cd, insn, info, insn_int_value, fields, (bfd_vma) 0);
/* ??? 0 is passed for `pc' */
length = CGEN_EXTRACT_FN (cd, insn)
/* ??? 0 is passed for `pc' */
length = CGEN_EXTRACT_FN (cd, insn)
- (cd, insn, info, base_insn, fields, (bfd_vma) 0);
+ (cd, insn, info, insn_int_value, fields, (bfd_vma) 0);