+2015-11-09 Dominik Vogt <vogt@linux.vnet.ibm.com>
+
+ * read.c (parse_bitfield_cons): Fix left shift of negative value.
+ * config/tc-xstormy16.c (md_section_align): Likewise.
+ * config/tc-xgate.c (md_section_align): Likewise.
+ * config/tc-visium.c (md_section_align): Likewise.
+ * config/tc-v850.c (md_section_align): Likewise.
+ * config/tc-tic6x.c (md_section_align): Likewise.
+ * config/tc-sh.c (SH64PCREL32_M, SH64PCREL48_M, SH64PCREL32_M)
+ (MOVI_32_M, MOVI_48_M, MOVI_32_M, md_section_align): Likewise.
+ * config/tc-sh64.c (shmedia_md_estimate_size_before_relax): Likewise.
+ * config/tc-score.c (s3_section_align): Likewise.
+ * config/tc-score7.c (s7_section_align): Likewise.
+ * config/tc-s390.c (md_section_align): Likewise.
+ * config/tc-rx.c (md_section_align): Likewise.
+ * config/tc-rl78.c (md_section_align): Likewise.
+ * config/tc-ppc.c (md_section_align): Likewise.
+ * config/tc-or1k.c (md_section_align): Likewise.
+ * config/tc-nds32.c (md_section_align): Likewise.
+ * config/tc-mt.c (md_section_align): Likewise.
+ * config/tc-msp430.c (md_section_align): Likewise.
+ * config/tc-mn10300.c (md_section_align): Likewise.
+ * config/tc-mn10200.c (md_section_align): Likewise.
+ * config/tc-mips.c (md_section_align): Likewise.
+ * config/tc-microblaze.c (parse_imm): Likewise.
+ * config/tc-mep.c (md_section_align): Likewise.
+ * config/tc-m68k.c (md_section_align): Likewise.
+ * config/tc-m68hc11.c (md_section_align): Likewise.
+ * config/tc-m32r.c (md_section_align): Likewise.
+ * config/tc-m32c.c (md_section_align): Likewise.
+ * config/tc-lm32.c (md_section_align): Likewise.
+ * config/tc-iq2000.c (md_section_align): Likewise.
+ * config/tc-ip2k.c (md_section_align): Likewise.
+ * config/tc-ia64.c (dot_save, dot_vframe): Likewise.
+ * config/tc-i960.c (md_number_to_field, md_section_align): Likewise.
+ * config/tc-i386.c (md_section_align): Likewise.
+ * config/tc-i370.c (md_section_align): Likewise.
+ * config/tc-frv.c (md_section_align): Likewise.
+ * config/tc-fr30.c (md_section_align): Likewise.
+ * config/tc-epiphany.c (md_section_align): Likewise.
+ * config/tc-d30v.c (md_section_align): Likewise.
+ * config/tc-d10v.c (md_section_align): Likewise.
+ * config/tc-cr16.c (l_cons): Likewise.
+ * config/tc-bfin.c (md_section_align): Likewise.
+ * config/tc-arm.c (md_section_align): Likewise.
+ * config/tc-arc.c (md_section_align): Likewise.
+ * config/bfin-parse.y (expr_1): Likewise.
+
2015-11-02 Nick Clifton <nickc@redhat.com>
* config/rx-parse.y: Allow zero value for 5-bit displacements.
value_match (Expr_Node *exp, int sz, int sign, int mul, int issigned)
{
int umax = (1 << sz) - 1;
- int min = -1 << (sz - 1);
+ int min = -(1 << (sz - 1));
int max = (1 << (sz - 1)) - 1;
int v = (EXPR_VALUE (exp)) & 0xffffffff;
{
int align = bfd_get_section_alignment (stdoutput, segment);
- return ((size + (1 << align) - 1) & (-1 << align));
+ return ((size + (1 << align) - 1) & -(1 << align));
}
/* The location from which a PC relative jump should be calculated,
int align;
align = bfd_get_section_alignment (stdoutput, segment);
- size = ((size + (1 << align) - 1) & ((valueT) -1 << align));
+ size = ((size + (1 << align) - 1) & (-((valueT) 1 << align)));
}
#endif
valueT size;
{
int boundary = bfd_get_section_alignment (stdoutput, segment);
- return ((size + (1 << boundary) - 1) & (-1 << boundary));
+ return ((size + (1 << boundary) - 1) & -(1 << boundary));
}
return;
}
- value |= ((~(-1 << width) & exp.X_add_number)
+ value |= ((~(-(1 << width)) & exp.X_add_number)
<< ((BITS_PER_CHAR * nbytes) - bits_available));
if ((bits_available -= width) == 0
md_section_align (asection *seg, valueT addr)
{
int align = bfd_get_section_alignment (stdoutput, seg);
- return ((addr + (1 << align) - 1) & (-1 << align));
+ return ((addr + (1 << align) - 1) & -(1 << align));
}
void
md_section_align (asection *seg, valueT addr)
{
int align = bfd_get_section_alignment (stdoutput, seg);
- return ((addr + (1 << align) - 1) & (-1 << align));
+ return ((addr + (1 << align) - 1) & -(1 << align));
}
void
{
int align = bfd_get_section_alignment (stdoutput, segment);
- return ((size + (1 << align) - 1) & (-1 << align));
+ return ((size + (1 << align) - 1) & -(1 << align));
}
\f
{
int align = bfd_get_section_alignment (stdoutput, segment);
- return ((size + (1 << align) - 1) & (-1 << align));
+ return ((size + (1 << align) - 1) & -(1 << align));
}
symbolS *
md_section_align (segT segment, valueT size)
{
int align = bfd_get_section_alignment (stdoutput, segment);
- return ((size + (1 << align) - 1) & (-1 << align));
+ return ((size + (1 << align) - 1) & -(1 << align));
}
symbolS *
{
int align = bfd_get_section_alignment (stdoutput, seg);
- return (addr + (1 << align) - 1) & (-1 << align);
+ return (addr + (1 << align) - 1) & -(1 << align);
}
/* We don't have any form of relaxing. */
int align;
align = bfd_get_section_alignment (stdoutput, segment);
- size = ((size + (1 << align) - 1) & ((valueT) -1 << align));
+ size = ((size + (1 << align) - 1) & (-((valueT) 1 << align)));
}
#endif
{
/* Put bit field into instruction and write back in target
* byte order. */
- val &= ~(-1 << (int) numbits); /* Clear unused sign bits. */
+ val &= ~(-(1 << (int) numbits)); /* Clear unused sign bits. */
instr |= val;
md_number_to_chars (instrP, instr, 4);
}
int align;
align = bfd_get_section_alignment (stdoutput, seg);
- return (addr + (1 << align) - 1) & (-1 << align);
+ return (addr + (1 << align) - 1) & -(1 << align);
}
extern int coff_flags;
if (! (unwind.prologue_mask & 2))
add_unwind_entry (output_psp_gr (reg), NOT_A_CHAR);
else if (reg != unwind.prologue_gr
- + (unsigned) popcount (unwind.prologue_mask & (-2 << 1)))
+ + (unsigned) popcount (unwind.prologue_mask & -(2 << 1)))
as_warn (_("Operand of .vframe contradicts .prologue"));
}
if (! (unwind.prologue_mask & 4))
add_unwind_entry (output_pfs_gr (reg2), NOT_A_CHAR);
else if (reg2 != unwind.prologue_gr
- + (unsigned) popcount (unwind.prologue_mask & (-4 << 1)))
+ + (unsigned) popcount (unwind.prologue_mask & -(4 << 1)))
as_warn (_("Second operand of .save contradicts .prologue"));
break;
case REG_AR + AR_LC:
if (! (unwind.prologue_mask & 1))
add_unwind_entry (output_preds_gr (reg2), NOT_A_CHAR);
else if (reg2 != unwind.prologue_gr
- + (unsigned) popcount (unwind.prologue_mask & (-1 << 1)))
+ + (unsigned) popcount (unwind.prologue_mask & -(1 << 1)))
as_warn (_("Second operand of .save contradicts .prologue"));
break;
case REG_PRIUNAT:
{
int align = bfd_get_section_alignment (stdoutput, segment);
- return ((size + (1 << align) - 1) & (-1 << align));
+ return ((size + (1 << align) - 1) & -(1 << align));
}
md_section_align (segT segment, valueT size)
{
int align = bfd_get_section_alignment (stdoutput, segment);
- return ((size + (1 << align) - 1) & (-1 << align));
+ return ((size + (1 << align) - 1) & -(1 << align));
}
symbolS *
md_section_align (asection *seg, valueT addr)
{
int align = bfd_get_section_alignment (stdoutput, seg);
- return ((addr + (1 << align) - 1) & (-1 << align));
+ return ((addr + (1 << align) - 1) & -(1 << align));
}
/* This function assembles the instructions. It emits the frags/bytes to the
md_section_align (segT segment, valueT size)
{
int align = bfd_get_section_alignment (stdoutput, segment);
- return ((size + (1 << align) - 1) & (-1 << align));
+ return ((size + (1 << align) - 1) & -(1 << align));
}
symbolS *
{
int align = bfd_get_section_alignment (stdoutput, segment);
- return ((size + (1 << align) - 1) & (-1 << align));
+ return ((size + (1 << align) - 1) & -(1 << align));
}
symbolS *
md_section_align (asection *seg, valueT addr)
{
int align = bfd_get_section_alignment (stdoutput, seg);
- return ((addr + (1 << align) - 1) & (-1 << align));
+ return ((addr + (1 << align) - 1) & -(1 << align));
}
static int
int align;
align = bfd_get_section_alignment (stdoutput, segment);
- size = ((size + (1 << align) - 1) & ((valueT) -1 << align));
+ size = ((size + (1 << align) - 1) & (-((valueT) 1 << align)));
#endif
return size;
md_section_align (segT segment, valueT size)
{
int align = bfd_get_section_alignment (stdoutput, segment);
- return ((size + (1 << align) - 1) & (-1 << align));
+ return ((size + (1 << align) - 1) & -(1 << align));
}
{
/* Special case: sign extend negative 32-bit values to 64-bits. */
if ((e->X_add_number >> 31) == 1)
- e->X_add_number |= (-1 << 31);
+ e->X_add_number |= -(1 << 31);
if (e->X_add_number < min || e->X_add_number > max)
{
if (align > 4)
align = 4;
- return ((addr + (1 << align) - 1) & (-1 << align));
+ return ((addr + (1 << align) - 1) & -(1 << align));
}
/* Utility routine, called from above as well. If called while the
md_section_align (asection *seg, valueT addr)
{
int align = bfd_get_section_alignment (stdoutput, seg);
- return ((addr + (1 << align) - 1) & (-1 << align));
+ return ((addr + (1 << align) - 1) & -(1 << align));
}
void
{
int align = bfd_get_section_alignment (stdoutput, seg);
- return ((addr + (1 << align) - 1) & (-1 << align));
+ return ((addr + (1 << align) - 1) & -(1 << align));
}
void
{
int align = bfd_get_section_alignment (stdoutput, seg);
- return ((addr + (1 << align) - 1) & (-1 << align));
+ return ((addr + (1 << align) - 1) & -(1 << align));
}
/* If you define this macro, it should return the offset between the
{
int align = bfd_get_section_alignment (stdoutput, segment);
- return ((size + (1 << align) - 1) & (-1 << align));
+ return ((size + (1 << align) - 1) & -(1 << align));
}
symbolS *
{
int align = bfd_get_section_alignment (stdoutput, segment);
- return ((size + (1 << align) - 1) & (-1 << align));
+ return ((size + (1 << align) - 1) & -(1 << align));
}
/* GAS will call this function when a symbol table lookup fails, before it
md_section_align (segT segment, valueT size)
{
int align = bfd_get_section_alignment (stdoutput, segment);
- return ((size + (1 << align) - 1) & (-1 << align));
+ return ((size + (1 << align) - 1) & -(1 << align));
}
symbolS *
#else
int align = bfd_get_section_alignment (stdoutput, seg);
- return ((addr + (1 << align) - 1) & (-1 << align));
+ return ((addr + (1 << align) - 1) & -(1 << align));
#endif
}
md_section_align (segT segment, valueT size)
{
int align = bfd_get_section_alignment (stdoutput, segment);
- return ((size + (1 << align) - 1) & (-1 << align));
+ return ((size + (1 << align) - 1) & -(1 << align));
}
md_section_align (segT segment, valueT size)
{
int align = bfd_get_section_alignment (stdoutput, segment);
- return ((size + (1 << align) - 1) & (-1 << align));
+ return ((size + (1 << align) - 1) & -(1 << align));
}
/* NOP - 1 cycle */
{
int align = bfd_get_section_alignment (stdoutput, seg);
- return ((addr + (1 << align) - 1) & (-1 << align));
+ return ((addr + (1 << align) - 1) & -(1 << align));
}
/* We don't have any form of relaxing. */
s3_section_align (segT segment ATTRIBUTE_UNUSED, valueT size)
{
int align = bfd_get_section_alignment (stdoutput, segment);
- return ((size + (1 << align) - 1) & (-1 << align));
+ return ((size + (1 << align) - 1) & -(1 << align));
}
static void
{
int align = bfd_get_section_alignment (stdoutput, segment);
- return ((size + (1 << align) - 1) & (-1 << align));
+ return ((size + (1 << align) - 1) & -(1 << align));
}
static void
#if BFD_HOST_64BIT_LONG
/* The "reach" type is long, so we can only do this for a 64-bit-long
host. */
-#define SH64PCREL32_M (((long) -1 << 30) * 2 - 4)
+#define SH64PCREL32_M ((-((long) 1 << 30)) * 2 - 4)
#define SH64PCREL48_F ((((long) 1 << 47) - 1) - 4)
-#define SH64PCREL48_M (((long) -1 << 47) - 4)
+#define SH64PCREL48_M ((-((long) 1 << 47)) - 4)
#define SH64PCREL48_LENGTH (3 * 4)
#else
/* If the host does not have 64-bit longs, just make this state identical
in reach to the 32-bit state. Note that we have a slightly incorrect
reach, but the correct one above will overflow a 32-bit number. */
-#define SH64PCREL32_M (((long) -1 << 30) * 2)
+#define SH64PCREL32_M ((-((long) 1 << 30)) * 2)
#define SH64PCREL48_F SH64PCREL32_F
#define SH64PCREL48_M SH64PCREL32_M
#define SH64PCREL48_LENGTH (3 * 4)
#if BFD_HOST_64BIT_LONG
/* The "reach" type is long, so we can only do this for a 64-bit-long
host. */
-#define MOVI_32_M (((long) -1 << 30) * 2 - 4)
+#define MOVI_32_M ((-((long) 1 << 30)) * 2 - 4)
#define MOVI_48_F ((((long) 1 << 47) - 1) - 4)
-#define MOVI_48_M (((long) -1 << 47) - 4)
+#define MOVI_48_M ((-((long) 1 << 47)) - 4)
#else
/* If the host does not have 64-bit longs, just make this state identical
in reach to the 32-bit state. Note that we have a slightly incorrect
reach, but the correct one above will overflow a 32-bit number. */
-#define MOVI_32_M (((long) -1 << 30) * 2)
+#define MOVI_32_M ((-((long) 1 << 30)) * 2)
#define MOVI_48_F MOVI_32_F
#define MOVI_48_M MOVI_32_M
#endif /* BFD_HOST_64BIT_LONG */
return size;
#else /* ! OBJ_ELF */
return ((size + (1 << bfd_get_section_alignment (stdoutput, seg)) - 1)
- & (-1 << bfd_get_section_alignment (stdoutput, seg)));
+ & -(1 << bfd_get_section_alignment (stdoutput, seg)));
#endif /* ! OBJ_ELF */
}
offsetT value = fragP->fr_offset
+ (fragP->fr_symbol == NULL ? 0 : S_GET_VALUE (fragP->fr_symbol));
- if (value >= ((offsetT) -1 << 15) && value < ((offsetT) 1 << 15))
+ if (value >= (-((offsetT) 1 << 15)) && value < ((offsetT) 1 << 15))
{
/* Fits in 16-bit signed number. */
int what = GET_WHAT (fragP->fr_subtype);
/* Round up section sizes to ensure that text sections consist of
whole fetch packets. */
int align = bfd_get_section_alignment (stdoutput, segment);
- return ((size + (1 << align) - 1) & ((valueT) -1 << align));
+ return ((size + (1 << align) - 1) & (-((valueT) 1 << align)));
}
/* No special undefined symbol handling needed for now. */
md_section_align (asection *seg, valueT addr)
{
int align = bfd_get_section_alignment (stdoutput, seg);
- return ((addr + (1 << align) - 1) & (-1 << align));
+ return ((addr + (1 << align) - 1) & -(1 << align));
}
void
{
int align = bfd_get_section_alignment (stdoutput, seg);
- return ((addr + (1 << align) - 1) & (-1 << align));
+ return ((addr + (1 << align) - 1) & -(1 << align));
}
void
md_section_align (segT segment, valueT size)
{
int align = bfd_get_section_alignment (stdoutput, segment);
- return ((size + (1 << align) - 1) & (-1 << align));
+ return ((size + (1 << align) - 1) & -(1 << align));
}
symbolS *
md_section_align (asection * seg, valueT addr)
{
int align = bfd_get_section_alignment (stdoutput, seg);
- return ((addr + (1 << align) - 1) & (-1 << align));
+ return ((addr + (1 << align) - 1) & -(1 << align));
}
void
{
int align = bfd_get_section_alignment (stdoutput, segment);
- return ((size + (1 << align) - 1) & (-1 << align));
+ return ((size + (1 << align) - 1) & -(1 << align));
}
symbolS *
return;
} /* Too complex. */
- value |= ((~(-1 << width) & exp->X_add_number)
+ value |= ((~(-(1 << width)) & exp->X_add_number)
<< ((BITS_PER_CHAR * nbytes) - bits_available));
if ((bits_available -= width) == 0
+2015-11-09 Dominik Vogt <vogt@linux.vnet.ibm.com>
+
+ * gas/all/test-gen.c (random_order_16s, random_order_24s)
+ (random_order_32s): Fix left shift of negative value.
+
2015-11-02 Nick Clifton <nickc@redhat.com>
* gas/rx/max.d: Update expected disassembly.
generated often enough. */
-32768,
32767,
- (-1 << 15) | (64 << 8) | 32,
+ (-(1 << 15)) | (64 << 8) | 32,
(64 << 8) | 32,
0x1234,
- (-1 << 15) | 0x8765,
+ (-(1 << 15)) | 0x8765,
0x0180,
- (-1 << 15) | 0x8001
+ (-(1 << 15)) | 0x8001
};
/* Use `24s' to generate 24-bit signed values. Good for selecting
intermediate values selected by chance. Keep the number of
intermediate values low, to ensure that the limit values are
generated often enough. */
- -1 << 23,
+ -(1 << 23),
1 << 23 -1,
- (-1 << 23) | (((64 << 8) | 32) << 8) | 16,
+ (-(1 << 23)) | (((64 << 8) | 32) << 8) | 16,
(((64 << 8) | 32) << 8) | 16,
0x123456,
- (-1 << 23) | 0x876543,
+ (-(1 << 23)) | 0x876543,
0x01ff80,
- (-1 << 23) | 0x80ff01
+ (-(1 << 23)) | 0x80ff01
};
/* Use `32s' to generate 32-bit signed values. Good for selecting
intermediate values selected by chance. Keep the number of
intermediate values low, to ensure that the limit values are
generated often enough. */
- -1 << 31,
+ -(1 << 31),
1 << 31 - 1,
- (-1 << 31) | (((((64 << 8) | 32) << 8) | 16) << 8) | 8,
+ (-(1 << 31)) | (((((64 << 8) | 32) << 8) | 16) << 8) | 8,
(((((64 << 8) | 32) << 8) | 16) << 8) | 8,
0x12345678,
- (-1 << 31) | 0x87654321,
+ (-(1 << 31)) | 0x87654321,
0x01ffff80,
- (-1 << 31) | 0x80ffff01
+ (-(1 << 31)) | 0x80ffff01
};
/* This function computes the number of digits needed to represent a