mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-23 03:22:56 +08:00
* config/tc-mips.c (normalize_constant_expr): New function to fix sign
extensions broken by gas' expression evaluation of constants. (check_absolute_expr): Use it. (mips_ip): Likewise.
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
2003-10-19 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
|
||||||
|
|
||||||
|
* config/tc-mips.c (normalize_constant_expr): New function to fix sign
|
||||||
|
extensions broken by gas' expression evaluation of constants.
|
||||||
|
(check_absolute_expr): Use it.
|
||||||
|
(mips_ip): Likewise.
|
||||||
|
|
||||||
2003-10-18 Hans-Peter Nilsson <hp@bitrange.com>
|
2003-10-18 Hans-Peter Nilsson <hp@bitrange.com>
|
||||||
|
|
||||||
Generate BFD_RELOC_MMIX_PUSHJ_STUBBABLE for PUSHJ when possible.
|
Generate BFD_RELOC_MMIX_PUSHJ_STUBBABLE for PUSHJ when possible.
|
||||||
|
@ -3329,6 +3329,14 @@ set_at (int *counter, int reg, int unsignedp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
normalize_constant_expr (expressionS *ex)
|
||||||
|
{
|
||||||
|
if (ex->X_op == O_constant && HAVE_32BIT_GPRS)
|
||||||
|
ex->X_add_number = (((ex->X_add_number & 0xffffffff) ^ 0x80000000)
|
||||||
|
- 0x80000000);
|
||||||
|
}
|
||||||
|
|
||||||
/* Warn if an expression is not a constant. */
|
/* Warn if an expression is not a constant. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -3338,6 +3346,8 @@ check_absolute_expr (struct mips_cl_insn *ip, expressionS *ex)
|
|||||||
as_bad (_("unsupported large constant"));
|
as_bad (_("unsupported large constant"));
|
||||||
else if (ex->X_op != O_constant)
|
else if (ex->X_op != O_constant)
|
||||||
as_bad (_("Instruction %s requires absolute expression"), ip->insn_mo->name);
|
as_bad (_("Instruction %s requires absolute expression"), ip->insn_mo->name);
|
||||||
|
|
||||||
|
normalize_constant_expr (ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Count the leading zeroes by performing a binary chop. This is a
|
/* Count the leading zeroes by performing a binary chop. This is a
|
||||||
@ -8562,6 +8572,7 @@ do_msbd:
|
|||||||
if (imm2_expr.X_op != O_big
|
if (imm2_expr.X_op != O_big
|
||||||
&& imm2_expr.X_op != O_constant)
|
&& imm2_expr.X_op != O_constant)
|
||||||
insn_error = _("absolute expression required");
|
insn_error = _("absolute expression required");
|
||||||
|
normalize_constant_expr (&imm2_expr);
|
||||||
s = expr_end;
|
s = expr_end;
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -9050,6 +9061,7 @@ do_msbd:
|
|||||||
if (imm_expr.X_op != O_big
|
if (imm_expr.X_op != O_big
|
||||||
&& imm_expr.X_op != O_constant)
|
&& imm_expr.X_op != O_constant)
|
||||||
insn_error = _("absolute expression required");
|
insn_error = _("absolute expression required");
|
||||||
|
normalize_constant_expr (&imm_expr);
|
||||||
s = expr_end;
|
s = expr_end;
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user