mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-06 23:50:09 +08:00
* cgen-ibld.in (insert_normal): Cope with attempts to insert a signed 32-bit
value into an unsigned 32-bit field when the host is a 64-bit machine.
This commit is contained in:
@ -1,8 +1,23 @@
|
|||||||
|
2006-03-05 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
* cgen-ibld.in (insert_normal): Cope with attempts to insert a
|
||||||
|
signed 32-bit value into an unsigned 32-bit field when the host is
|
||||||
|
a 64-bit machine.
|
||||||
|
* fr30-ibld.c: Regenerate.
|
||||||
|
* frv-ibld.c: Regenerate.
|
||||||
|
* ip2k-ibld.c: Regenerate.
|
||||||
|
* iq2000-asm.c: Regenerate.
|
||||||
|
* iq2000-ibld.c: Regenerate.
|
||||||
|
* m32c-ibld.c: Regenerate.
|
||||||
|
* m32r-ibld.c: Regenerate.
|
||||||
|
* openrisc-ibld.c: Regenerate.
|
||||||
|
* xc16x-ibld.c: Regenerate.
|
||||||
|
* xstormy16-ibld.c: Regenerate.
|
||||||
|
|
||||||
2006-03-03 Shrirang Khisti <shrirangk@kpitcummins.com)
|
2006-03-03 Shrirang Khisti <shrirangk@kpitcummins.com)
|
||||||
|
|
||||||
* xc16x-asm.c: Regenerate.
|
* xc16x-asm.c: Regenerate.
|
||||||
* xc16x-dis.c: Regenerate.
|
* xc16x-dis.c: Regenerate.
|
||||||
* xc16x-ibld.c: Regenerate.
|
|
||||||
|
|
||||||
2006-02-27 Carlos O'Donell <carlos@codesourcery.com>
|
2006-02-27 Carlos O'Donell <carlos@codesourcery.com>
|
||||||
|
|
||||||
|
@ -168,13 +168,21 @@ insert_normal (CGEN_CPU_DESC cd,
|
|||||||
else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
|
else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
|
||||||
{
|
{
|
||||||
unsigned long maxval = mask;
|
unsigned long maxval = mask;
|
||||||
|
unsigned long val = (unsigned long) value;
|
||||||
if ((unsigned long) value > maxval)
|
|
||||||
|
/* 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 */
|
/* xgettext:c-format */
|
||||||
sprintf (errbuf,
|
sprintf (errbuf,
|
||||||
_("operand out of range (%lu not between 0 and %lu)"),
|
_("operand out of range (0x%lx not between 0 and 0x%lx)"),
|
||||||
value, maxval);
|
val, maxval);
|
||||||
return errbuf;
|
return errbuf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator.
|
THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator.
|
||||||
- the resultant file is machine generated, cgen-ibld.in isn't
|
- the resultant file is machine generated, cgen-ibld.in isn't
|
||||||
|
|
||||||
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2005
|
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2005, 2006
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of the GNU Binutils and GDB, the GNU debugger.
|
This file is part of the GNU Binutils and GDB, the GNU debugger.
|
||||||
@ -168,13 +168,21 @@ insert_normal (CGEN_CPU_DESC cd,
|
|||||||
else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
|
else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
|
||||||
{
|
{
|
||||||
unsigned long maxval = mask;
|
unsigned long maxval = mask;
|
||||||
|
unsigned long val = (unsigned long) value;
|
||||||
if ((unsigned long) value > maxval)
|
|
||||||
|
/* 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 */
|
/* xgettext:c-format */
|
||||||
sprintf (errbuf,
|
sprintf (errbuf,
|
||||||
_("operand out of range (%lu not between 0 and %lu)"),
|
_("operand out of range (0x%lx not between 0 and 0x%lx)"),
|
||||||
value, maxval);
|
val, maxval);
|
||||||
return errbuf;
|
return errbuf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -440,9 +448,8 @@ extract_normal (CGEN_CPU_DESC cd,
|
|||||||
word_length may be too big. */
|
word_length may be too big. */
|
||||||
if (cd->min_insn_bitsize < cd->base_insn_bitsize)
|
if (cd->min_insn_bitsize < cd->base_insn_bitsize)
|
||||||
{
|
{
|
||||||
if (word_offset == 0
|
if (word_offset + word_length > total_length)
|
||||||
&& word_length > total_length)
|
word_length = total_length - word_offset;
|
||||||
word_length = total_length;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Does the value reside in INSN_VALUE, and at the right alignment? */
|
/* Does the value reside in INSN_VALUE, and at the right alignment? */
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator.
|
THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator.
|
||||||
- the resultant file is machine generated, cgen-ibld.in isn't
|
- the resultant file is machine generated, cgen-ibld.in isn't
|
||||||
|
|
||||||
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2005
|
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2005, 2006
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of the GNU Binutils and GDB, the GNU debugger.
|
This file is part of the GNU Binutils and GDB, the GNU debugger.
|
||||||
@ -168,13 +168,21 @@ insert_normal (CGEN_CPU_DESC cd,
|
|||||||
else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
|
else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
|
||||||
{
|
{
|
||||||
unsigned long maxval = mask;
|
unsigned long maxval = mask;
|
||||||
|
unsigned long val = (unsigned long) value;
|
||||||
if ((unsigned long) value > maxval)
|
|
||||||
|
/* 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 */
|
/* xgettext:c-format */
|
||||||
sprintf (errbuf,
|
sprintf (errbuf,
|
||||||
_("operand out of range (%lu not between 0 and %lu)"),
|
_("operand out of range (0x%lx not between 0 and 0x%lx)"),
|
||||||
value, maxval);
|
val, maxval);
|
||||||
return errbuf;
|
return errbuf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -440,9 +448,8 @@ extract_normal (CGEN_CPU_DESC cd,
|
|||||||
word_length may be too big. */
|
word_length may be too big. */
|
||||||
if (cd->min_insn_bitsize < cd->base_insn_bitsize)
|
if (cd->min_insn_bitsize < cd->base_insn_bitsize)
|
||||||
{
|
{
|
||||||
if (word_offset == 0
|
if (word_offset + word_length > total_length)
|
||||||
&& word_length > total_length)
|
word_length = total_length - word_offset;
|
||||||
word_length = total_length;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Does the value reside in INSN_VALUE, and at the right alignment? */
|
/* Does the value reside in INSN_VALUE, and at the right alignment? */
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator.
|
THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator.
|
||||||
- the resultant file is machine generated, cgen-ibld.in isn't
|
- the resultant file is machine generated, cgen-ibld.in isn't
|
||||||
|
|
||||||
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2005
|
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2005, 2006
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of the GNU Binutils and GDB, the GNU debugger.
|
This file is part of the GNU Binutils and GDB, the GNU debugger.
|
||||||
@ -168,13 +168,21 @@ insert_normal (CGEN_CPU_DESC cd,
|
|||||||
else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
|
else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
|
||||||
{
|
{
|
||||||
unsigned long maxval = mask;
|
unsigned long maxval = mask;
|
||||||
|
unsigned long val = (unsigned long) value;
|
||||||
if ((unsigned long) value > maxval)
|
|
||||||
|
/* 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 */
|
/* xgettext:c-format */
|
||||||
sprintf (errbuf,
|
sprintf (errbuf,
|
||||||
_("operand out of range (%lu not between 0 and %lu)"),
|
_("operand out of range (0x%lx not between 0 and 0x%lx)"),
|
||||||
value, maxval);
|
val, maxval);
|
||||||
return errbuf;
|
return errbuf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -440,9 +448,8 @@ extract_normal (CGEN_CPU_DESC cd,
|
|||||||
word_length may be too big. */
|
word_length may be too big. */
|
||||||
if (cd->min_insn_bitsize < cd->base_insn_bitsize)
|
if (cd->min_insn_bitsize < cd->base_insn_bitsize)
|
||||||
{
|
{
|
||||||
if (word_offset == 0
|
if (word_offset + word_length > total_length)
|
||||||
&& word_length > total_length)
|
word_length = total_length - word_offset;
|
||||||
word_length = total_length;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Does the value reside in INSN_VALUE, and at the right alignment? */
|
/* Does the value reside in INSN_VALUE, and at the right alignment? */
|
||||||
|
@ -213,8 +213,8 @@ parse_hi16 (CGEN_CPU_DESC cd,
|
|||||||
1 to the resultant %hi value. */
|
1 to the resultant %hi value. */
|
||||||
if (value & 0x8000)
|
if (value & 0x8000)
|
||||||
value += 0x10000;
|
value += 0x10000;
|
||||||
value &= 0xffff;
|
|
||||||
value >>= 16;
|
value >>= 16;
|
||||||
|
value &= 0xffff;
|
||||||
}
|
}
|
||||||
*valuep = value;
|
*valuep = value;
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator.
|
THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator.
|
||||||
- the resultant file is machine generated, cgen-ibld.in isn't
|
- the resultant file is machine generated, cgen-ibld.in isn't
|
||||||
|
|
||||||
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2005
|
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2005, 2006
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of the GNU Binutils and GDB, the GNU debugger.
|
This file is part of the GNU Binutils and GDB, the GNU debugger.
|
||||||
@ -168,13 +168,21 @@ insert_normal (CGEN_CPU_DESC cd,
|
|||||||
else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
|
else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
|
||||||
{
|
{
|
||||||
unsigned long maxval = mask;
|
unsigned long maxval = mask;
|
||||||
|
unsigned long val = (unsigned long) value;
|
||||||
if ((unsigned long) value > maxval)
|
|
||||||
|
/* 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 */
|
/* xgettext:c-format */
|
||||||
sprintf (errbuf,
|
sprintf (errbuf,
|
||||||
_("operand out of range (%lu not between 0 and %lu)"),
|
_("operand out of range (0x%lx not between 0 and 0x%lx)"),
|
||||||
value, maxval);
|
val, maxval);
|
||||||
return errbuf;
|
return errbuf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -440,9 +448,8 @@ extract_normal (CGEN_CPU_DESC cd,
|
|||||||
word_length may be too big. */
|
word_length may be too big. */
|
||||||
if (cd->min_insn_bitsize < cd->base_insn_bitsize)
|
if (cd->min_insn_bitsize < cd->base_insn_bitsize)
|
||||||
{
|
{
|
||||||
if (word_offset == 0
|
if (word_offset + word_length > total_length)
|
||||||
&& word_length > total_length)
|
word_length = total_length - word_offset;
|
||||||
word_length = total_length;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Does the value reside in INSN_VALUE, and at the right alignment? */
|
/* Does the value reside in INSN_VALUE, and at the right alignment? */
|
||||||
|
@ -168,13 +168,21 @@ insert_normal (CGEN_CPU_DESC cd,
|
|||||||
else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
|
else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
|
||||||
{
|
{
|
||||||
unsigned long maxval = mask;
|
unsigned long maxval = mask;
|
||||||
|
unsigned long val = (unsigned long) value;
|
||||||
if ((unsigned long) value > maxval)
|
|
||||||
|
/* 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 */
|
/* xgettext:c-format */
|
||||||
sprintf (errbuf,
|
sprintf (errbuf,
|
||||||
_("operand out of range (%lu not between 0 and %lu)"),
|
_("operand out of range (0x%lx not between 0 and 0x%lx)"),
|
||||||
value, maxval);
|
val, maxval);
|
||||||
return errbuf;
|
return errbuf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator.
|
THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator.
|
||||||
- the resultant file is machine generated, cgen-ibld.in isn't
|
- the resultant file is machine generated, cgen-ibld.in isn't
|
||||||
|
|
||||||
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2005
|
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2005, 2006
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of the GNU Binutils and GDB, the GNU debugger.
|
This file is part of the GNU Binutils and GDB, the GNU debugger.
|
||||||
@ -168,13 +168,21 @@ insert_normal (CGEN_CPU_DESC cd,
|
|||||||
else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
|
else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
|
||||||
{
|
{
|
||||||
unsigned long maxval = mask;
|
unsigned long maxval = mask;
|
||||||
|
unsigned long val = (unsigned long) value;
|
||||||
if ((unsigned long) value > maxval)
|
|
||||||
|
/* 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 */
|
/* xgettext:c-format */
|
||||||
sprintf (errbuf,
|
sprintf (errbuf,
|
||||||
_("operand out of range (%lu not between 0 and %lu)"),
|
_("operand out of range (0x%lx not between 0 and 0x%lx)"),
|
||||||
value, maxval);
|
val, maxval);
|
||||||
return errbuf;
|
return errbuf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -440,9 +448,8 @@ extract_normal (CGEN_CPU_DESC cd,
|
|||||||
word_length may be too big. */
|
word_length may be too big. */
|
||||||
if (cd->min_insn_bitsize < cd->base_insn_bitsize)
|
if (cd->min_insn_bitsize < cd->base_insn_bitsize)
|
||||||
{
|
{
|
||||||
if (word_offset == 0
|
if (word_offset + word_length > total_length)
|
||||||
&& word_length > total_length)
|
word_length = total_length - word_offset;
|
||||||
word_length = total_length;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Does the value reside in INSN_VALUE, and at the right alignment? */
|
/* Does the value reside in INSN_VALUE, and at the right alignment? */
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator.
|
THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator.
|
||||||
- the resultant file is machine generated, cgen-ibld.in isn't
|
- the resultant file is machine generated, cgen-ibld.in isn't
|
||||||
|
|
||||||
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2005
|
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2005, 2006
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of the GNU Binutils and GDB, the GNU debugger.
|
This file is part of the GNU Binutils and GDB, the GNU debugger.
|
||||||
@ -168,13 +168,21 @@ insert_normal (CGEN_CPU_DESC cd,
|
|||||||
else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
|
else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
|
||||||
{
|
{
|
||||||
unsigned long maxval = mask;
|
unsigned long maxval = mask;
|
||||||
|
unsigned long val = (unsigned long) value;
|
||||||
if ((unsigned long) value > maxval)
|
|
||||||
|
/* 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 */
|
/* xgettext:c-format */
|
||||||
sprintf (errbuf,
|
sprintf (errbuf,
|
||||||
_("operand out of range (%lu not between 0 and %lu)"),
|
_("operand out of range (0x%lx not between 0 and 0x%lx)"),
|
||||||
value, maxval);
|
val, maxval);
|
||||||
return errbuf;
|
return errbuf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -440,9 +448,8 @@ extract_normal (CGEN_CPU_DESC cd,
|
|||||||
word_length may be too big. */
|
word_length may be too big. */
|
||||||
if (cd->min_insn_bitsize < cd->base_insn_bitsize)
|
if (cd->min_insn_bitsize < cd->base_insn_bitsize)
|
||||||
{
|
{
|
||||||
if (word_offset == 0
|
if (word_offset + word_length > total_length)
|
||||||
&& word_length > total_length)
|
word_length = total_length - word_offset;
|
||||||
word_length = total_length;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Does the value reside in INSN_VALUE, and at the right alignment? */
|
/* Does the value reside in INSN_VALUE, and at the right alignment? */
|
||||||
|
@ -168,13 +168,21 @@ insert_normal (CGEN_CPU_DESC cd,
|
|||||||
else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
|
else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
|
||||||
{
|
{
|
||||||
unsigned long maxval = mask;
|
unsigned long maxval = mask;
|
||||||
|
unsigned long val = (unsigned long) value;
|
||||||
if ((unsigned long) value > maxval)
|
|
||||||
|
/* 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 */
|
/* xgettext:c-format */
|
||||||
sprintf (errbuf,
|
sprintf (errbuf,
|
||||||
_("operand out of range (%lu not between 0 and %lu)"),
|
_("operand out of range (0x%lx not between 0 and 0x%lx)"),
|
||||||
value, maxval);
|
val, maxval);
|
||||||
return errbuf;
|
return errbuf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator.
|
THIS FILE IS MACHINE GENERATED WITH CGEN: Cpu tools GENerator.
|
||||||
- the resultant file is machine generated, cgen-ibld.in isn't
|
- the resultant file is machine generated, cgen-ibld.in isn't
|
||||||
|
|
||||||
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2005
|
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2005, 2006
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of the GNU Binutils and GDB, the GNU debugger.
|
This file is part of the GNU Binutils and GDB, the GNU debugger.
|
||||||
@ -168,13 +168,21 @@ insert_normal (CGEN_CPU_DESC cd,
|
|||||||
else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
|
else if (! CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED))
|
||||||
{
|
{
|
||||||
unsigned long maxval = mask;
|
unsigned long maxval = mask;
|
||||||
|
unsigned long val = (unsigned long) value;
|
||||||
if ((unsigned long) value > maxval)
|
|
||||||
|
/* 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 */
|
/* xgettext:c-format */
|
||||||
sprintf (errbuf,
|
sprintf (errbuf,
|
||||||
_("operand out of range (%lu not between 0 and %lu)"),
|
_("operand out of range (0x%lx not between 0 and 0x%lx)"),
|
||||||
value, maxval);
|
val, maxval);
|
||||||
return errbuf;
|
return errbuf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -440,9 +448,8 @@ extract_normal (CGEN_CPU_DESC cd,
|
|||||||
word_length may be too big. */
|
word_length may be too big. */
|
||||||
if (cd->min_insn_bitsize < cd->base_insn_bitsize)
|
if (cd->min_insn_bitsize < cd->base_insn_bitsize)
|
||||||
{
|
{
|
||||||
if (word_offset == 0
|
if (word_offset + word_length > total_length)
|
||||||
&& word_length > total_length)
|
word_length = total_length - word_offset;
|
||||||
word_length = total_length;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Does the value reside in INSN_VALUE, and at the right alignment? */
|
/* Does the value reside in INSN_VALUE, and at the right alignment? */
|
||||||
|
Reference in New Issue
Block a user