projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Sync config.guess and config.sub with GCC
[deliverable/binutils-gdb.git]
/
opcodes
/
xstormy16-ibld.c
diff --git
a/opcodes/xstormy16-ibld.c
b/opcodes/xstormy16-ibld.c
index 57ef85cdf0c02f5c2a6589bbe50e080e6c7cd0ad..caae89ba34e0109460e753d9bec9a154de79e7ac 100644
(file)
--- a/
opcodes/xstormy16-ibld.c
+++ b/
opcodes/xstormy16-ibld.c
@@
-3,20
+3,20
@@
THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator.
- the resultant file is machine generated, cgen-ibld.in isn't
THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator.
- the resultant file is machine generated, cgen-ibld.in isn't
- Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2005
- Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2005
, 2006, 2007,
+
2008, 2010
Free Software Foundation, Inc.
- This file is part of
the GNU Binutils and GDB, the GNU debugger
.
+ This file is part of
libopcodes
.
- This
program
is free software; you can redistribute it and/or modify
+ This
library
is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version
2
, or (at your option)
+ the Free Software Foundation; either version
3
, or (at your option)
any later version.
any later version.
- 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.,
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.,
@@
-33,6
+33,7
@@
#include "symcat.h"
#include "xstormy16-desc.h"
#include "xstormy16-opc.h"
#include "symcat.h"
#include "xstormy16-desc.h"
#include "xstormy16-opc.h"
+#include "cgen/basic-modes.h"
#include "opintl.h"
#include "safe-ctype.h"
#include "opintl.h"
#include "safe-ctype.h"
@@
-137,7
+138,7
@@
insert_normal (CGEN_CPU_DESC cd,
if (length == 0)
return NULL;
if (length == 0)
return NULL;
- if (word_length >
32
)
+ if (word_length >
8 * sizeof (CGEN_INSN_INT)
)
abort ();
/* For architectures with insns smaller than the base-insn-bitsize,
abort ();
/* For architectures with insns smaller than the base-insn-bitsize,
@@
-168,13
+169,21
@@
insert_normal (CGEN_CPU_DESC cd,
else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
{
unsigned long maxval = mask;
else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
{
unsigned long maxval = mask;
-
- if ((unsigned long) value > maxval)
+ unsigned long val = (unsigned long) value;
+
+ /* For hosts with a word size > 32 check to see if value has been sign
+ extended beyond 32 bits. If so then ignore these higher sign bits
+ as the user is attempting to store a 32-bit signed value into an
+ unsigned 32-bit field which is allowed. */
+ if (sizeof (unsigned long) > 4 && ((value >> 32) == -1))
+ val &= 0xFFFFFFFF;
+
+ if (val > maxval)
{
/* xgettext:c-format */
sprintf (errbuf,
{
/* xgettext:c-format */
sprintf (errbuf,
- _("operand out of range (
%lu not between 0 and %lu
)"),
- val
ue
, maxval);
+ _("operand out of range (
0x%lx not between 0 and 0x%lx
)"),
+ val, maxval);
return errbuf;
}
}
return errbuf;
}
}
@@
-433,16
+442,15
@@
extract_normal (CGEN_CPU_DESC cd,
return 1;
}
return 1;
}
- if (word_length >
32
)
+ if (word_length >
8 * sizeof (CGEN_INSN_INT)
)
abort ();
/* For architectures with insns smaller than the insn-base-bitsize,
word_length may be too big. */
if (cd->min_insn_bitsize < cd->base_insn_bitsize)
{
abort ();
/* For architectures with insns smaller than the insn-base-bitsize,
word_length may be too big. */
if (cd->min_insn_bitsize < cd->base_insn_bitsize)
{
- if (word_offset == 0
- && word_length > total_length)
- word_length = total_length;
+ if (word_offset + word_length > total_length)
+ word_length = total_length - word_offset;
}
/* Does the value reside in INSN_VALUE, and at the right alignment? */
}
/* Does the value reside in INSN_VALUE, and at the right alignment? */
@@
-461,7
+469,7
@@
extract_normal (CGEN_CPU_DESC cd,
{
unsigned char *bufp = ex_info->insn_bytes + word_offset / 8;
{
unsigned char *bufp = ex_info->insn_bytes + word_offset / 8;
- if (word_length >
32
)
+ if (word_length >
8 * sizeof (CGEN_INSN_INT)
)
abort ();
if (fill_cache (cd, ex_info, word_offset / 8, word_length / 8, pc) == 0)
abort ();
if (fill_cache (cd, ex_info, word_offset / 8, word_length / 8, pc) == 0)
@@
-580,7
+588,7
@@
xstormy16_cgen_insert_operand (CGEN_CPU_DESC cd,
{
{
FLD (f_abs24_1) = ((FLD (f_abs24)) & (255));
{
{
FLD (f_abs24_1) = ((FLD (f_abs24)) & (255));
- FLD (f_abs24_2) = ((
unsigned int
) (FLD (f_abs24)) >> (8));
+ FLD (f_abs24_2) = ((
UINT
) (FLD (f_abs24)) >> (8));
}
errmsg = insert_normal (cd, fields->f_abs24_1, 0, 0, 8, 8, 32, total_length, buffer);
if (errmsg)
}
errmsg = insert_normal (cd, fields->f_abs24_1, 0, 0, 8, 8, 32, total_length, buffer);
if (errmsg)
@@
-640,7
+648,7
@@
xstormy16_cgen_insert_operand (CGEN_CPU_DESC cd,
case XSTORMY16_OPERAND_REL12A :
{
long value = fields->f_rel12a;
case XSTORMY16_OPERAND_REL12A :
{
long value = fields->f_rel12a;
- value = ((
int
) (((value) - (((pc) + (2))))) >> (1));
+ value = ((
SI
) (((value) - (((pc) + (2))))) >> (1));
errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 4, 11, 32, total_length, buffer);
}
break;
errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 4, 11, 32, total_length, buffer);
}
break;
This page took
0.025368 seconds
and
4
git commands to generate.