projects
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated French translation for the opcodes directory.
[binutils-gdb.git]
/
opcodes
/
m32c-ibld.c
diff --git
a/opcodes/m32c-ibld.c
b/opcodes/m32c-ibld.c
index 6ad4da967da56711f3fa00bedc90f1c9f886219e..98ab8636e560236d171a6bd075c09c720a594572 100644
(file)
--- a/
opcodes/m32c-ibld.c
+++ b/
opcodes/m32c-ibld.c
@@
-4,7
+4,7
@@
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 (C) 1996-202
0
Free Software Foundation, Inc.
+ Copyright (C) 1996-202
1
Free Software Foundation, Inc.
This file is part of libopcodes.
This file is part of libopcodes.
@@
-85,13
+85,13
@@
insert_1 (CGEN_CPU_DESC cd,
int word_length,
unsigned char *bufp)
{
int word_length,
unsigned char *bufp)
{
- unsigned long x,mask;
+ unsigned long x,
mask;
int shift;
x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
/* Written this way to avoid undefined behaviour. */
int shift;
x = cgen_get_insn_value (cd, bufp, word_length, cd->endian);
/* Written this way to avoid undefined behaviour. */
- mask = (
((1L << (length - 1)) - 1) << 1) |
1;
+ mask = (
1UL << (length - 1) << 1) -
1;
if (CGEN_INSN_LSB0_P)
shift = (start + 1) - length;
else
if (CGEN_INSN_LSB0_P)
shift = (start + 1) - length;
else
@@
-131,13
+131,15
@@
insert_normal (CGEN_CPU_DESC cd,
CGEN_INSN_BYTES_PTR buffer)
{
static char errbuf[100];
CGEN_INSN_BYTES_PTR buffer)
{
static char errbuf[100];
- /* Written this way to avoid undefined behaviour. */
- unsigned long mask = (((1L << (length - 1)) - 1) << 1) | 1;
+ unsigned long mask;
/* If LENGTH is zero, this operand doesn't contribute to the value. */
if (length == 0)
return NULL;
/* If LENGTH is zero, this operand doesn't contribute to the value. */
if (length == 0)
return NULL;
+ /* Written this way to avoid undefined behaviour. */
+ mask = (1UL << (length - 1) << 1) - 1;
+
if (word_length > 8 * sizeof (CGEN_INSN_INT))
abort ();
if (word_length > 8 * sizeof (CGEN_INSN_INT))
abort ();
@@
-153,7
+155,7
@@
insert_normal (CGEN_CPU_DESC cd,
/* Ensure VALUE will fit. */
if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGN_OPT))
{
/* Ensure VALUE will fit. */
if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGN_OPT))
{
- long minval = - (1L << (length - 1));
+ long minval = - (1
U
L << (length - 1));
unsigned long maxval = mask;
if ((value > 0 && (unsigned long) value > maxval)
unsigned long maxval = mask;
if ((value > 0 && (unsigned long) value > maxval)
@@
-191,8
+193,8
@@
insert_normal (CGEN_CPU_DESC cd,
{
if (! cgen_signed_overflow_ok_p (cd))
{
{
if (! cgen_signed_overflow_ok_p (cd))
{
- long minval = - (1L << (length - 1));
- long maxval = (1L << (length - 1)) - 1;
+ long minval = - (1
U
L << (length - 1));
+ long maxval = (1
U
L << (length - 1)) - 1;
if (value < minval || value > maxval)
{
if (value < minval || value > maxval)
{
@@
-314,7
+316,7
@@
put_insn_int_value (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
{
int shift = insn_length - length;
/* Written this way to avoid undefined behaviour. */
{
int shift = insn_length - length;
/* Written this way to avoid undefined behaviour. */
- CGEN_INSN_INT mask =
(((1L << (length - 1)) - 1) << 1) |
1;
+ CGEN_INSN_INT mask =
length == 0 ? 0 : (1UL << (length - 1) << 1) -
1;
*buf = (*buf & ~(mask << shift)) | ((value & mask) << shift);
}
*buf = (*buf & ~(mask << shift)) | ((value & mask) << shift);
}
@@
-491,12
+493,12
@@
extract_normal (CGEN_CPU_DESC cd,
#endif /* ! CGEN_INT_INSN_P */
/* Written this way to avoid undefined behaviour. */
#endif /* ! CGEN_INT_INSN_P */
/* Written this way to avoid undefined behaviour. */
- mask = (
((1L << (length - 1)) - 1) << 1) |
1;
+ mask = (
1UL << (length - 1) << 1) -
1;
value &= mask;
/* sign extend? */
if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED)
value &= mask;
/* sign extend? */
if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED)
- && (value & (1L << (length - 1))))
+ && (value & (1
U
L << (length - 1))))
value |= ~mask;
*valuep = value;
value |= ~mask;
*valuep = value;