+2020-03-10 Alan Modra <amodra@gmail.com>
+
+ * config/tc-csky.c (get_operand_value): Rewrite 1 << 31 expressions
+ to avoid signed overflow.
+ * config/tc-mcore.c (md_assemble): Likewise.
+ * config/tc-mips.c (gpr_read_mask, gpr_write_mask): Likewise.
+ * config/tc-nds32.c (SET_ADDEND): Likewise.
+ * config/tc-nios2.c (nios2_assemble_arg_R): Likewise.
+
2020-03-09 Jan Beulich <jbeulich@suse.com>
* testsuite/gas/i386/avx.s: Add long-form VCMP[PS][SD] pseudos.
case OPRND_TYPE_IMM5b_1_31:
return is_imm_over_range (oper, 1, 31, -1);
case OPRND_TYPE_IMM5b_POWER:
- if (is_imm_over_range (oper, 1, ~(1 << 31), 1 << 31))
+ if (is_imm_over_range (oper, 1, (1u << 31) - 1, 1u << 31))
{
int log;
int val = csky_insn.val[csky_insn.idx - 1];
/* This type for "mgeni" in csky v1 ISA. */
case OPRND_TYPE_IMM5b_7_31_POWER:
- if (is_imm_over_range (oper, 1, ~(1 << 31), 1 << 31))
+ if (is_imm_over_range (oper, 1, (1u << 31) - 1, 1u << 31))
{
int log;
int val = csky_insn.val[csky_insn.idx - 1];
if (* op_end == ',')
{
- op_end = parse_imm (op_end + 1, & reg, 1, 1 << 31);
+ op_end = parse_imm (op_end + 1, & reg, 1, 1u << 31);
/* Further restrict the immediate to a power of two. */
if ((reg & (reg - 1)) == 0)
reg = mylog2 (reg);
if (* op_end == ',')
{
- op_end = parse_imm (op_end + 1, & reg, 1, 1 << 31);
+ op_end = parse_imm (op_end + 1, & reg, 1, 1u << 31);
/* Further restrict the immediate to a power of two. */
if ((reg & (reg - 1)) == 0)
if (pinfo2 & INSN2_READ_SP)
mask |= 1 << SP;
if (pinfo2 & INSN2_READ_GPR_31)
- mask |= 1 << 31;
+ mask |= 1u << 31;
/* Don't include register 0. */
return mask & ~1;
}
if (pinfo & INSN_WRITE_GPR_24)
mask |= 1 << 24;
if (pinfo & INSN_WRITE_GPR_31)
- mask |= 1 << 31;
+ mask |= 1u << 31;
if (pinfo & INSN_UDI)
/* UDI instructions have traditionally been assumed to write to RD. */
mask |= 1 << EXTRACT_OPERAND (mips_opts.micromips, RD, *ip);
not, optimize option, 16 bit instruction is enable. */
#define SET_ADDEND(size, convertible, optimize, insn16_on) \
- (((size) & 0xff) | ((convertible) ? 1 << 31 : 0) \
- | ((optimize) ? 1<< 30 : 0) | (insn16_on ? 1 << 29 : 0))
+ (((size) & 0xff) | ((convertible) ? 1u << 31 : 0) \
+ | ((optimize) ? 1 << 30 : 0) | (insn16_on ? 1 << 29 : 0))
#define MAC_COMBO (E_NDS32_HAS_FPU_MAC_INST|E_NDS32_HAS_MAC_DX_INST)
static void
mask = (reglist & 0x00ffc000) >> 14;
if (reglist & (1 << 28))
mask |= 1 << 10;
- if (reglist & (1 << 31))
+ if (reglist & (1u << 31))
mask |= 1 << 11;
}
insn->insn_code |= SET_IW_F1X4L17_REGMASK (mask);