mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-23 03:29:47 +08:00
* config/tc-mips.c (macro) <M_DEXT, M_DINS>: Correct types used
for pos and size.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2010-12-09 Maciej W. Rozycki <macro@codesourcery.com>
|
||||||
|
|
||||||
|
* config/tc-mips.c (macro) <M_DEXT, M_DINS>: Correct types used
|
||||||
|
for pos and size.
|
||||||
|
|
||||||
2010-12-09 Maciej W. Rozycki <macro@codesourcery.com>
|
2010-12-09 Maciej W. Rozycki <macro@codesourcery.com>
|
||||||
|
|
||||||
* config/tc-mips.c (macro) <ld_st>: Don't load a zero into an
|
* config/tc-mips.c (macro) <ld_st>: Don't load a zero into an
|
||||||
|
@ -5262,8 +5262,9 @@ macro (struct mips_cl_insn *ip)
|
|||||||
|
|
||||||
case M_DEXT:
|
case M_DEXT:
|
||||||
{
|
{
|
||||||
unsigned long pos;
|
/* Use unsigned arithmetic. */
|
||||||
unsigned long size;
|
addressT pos;
|
||||||
|
addressT size;
|
||||||
|
|
||||||
if (imm_expr.X_op != O_constant || imm2_expr.X_op != O_constant)
|
if (imm_expr.X_op != O_constant || imm2_expr.X_op != O_constant)
|
||||||
{
|
{
|
||||||
@ -5272,19 +5273,19 @@ macro (struct mips_cl_insn *ip)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pos = (unsigned long) imm_expr.X_add_number;
|
pos = imm_expr.X_add_number;
|
||||||
size = (unsigned long) imm2_expr.X_add_number;
|
size = imm2_expr.X_add_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pos > 63)
|
if (pos > 63)
|
||||||
{
|
{
|
||||||
as_bad (_("Improper position (%lu)"), pos);
|
as_bad (_("Improper position (%lu)"), (unsigned long) pos);
|
||||||
pos = 1;
|
pos = 1;
|
||||||
}
|
}
|
||||||
if (size == 0 || size > 64 || (pos + size - 1) > 63)
|
if (size == 0 || size > 64 || (pos + size - 1) > 63)
|
||||||
{
|
{
|
||||||
as_bad (_("Improper extract size (%lu, position %lu)"),
|
as_bad (_("Improper extract size (%lu, position %lu)"),
|
||||||
size, pos);
|
(unsigned long) size, (unsigned long) pos);
|
||||||
size = 1;
|
size = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5303,14 +5304,16 @@ macro (struct mips_cl_insn *ip)
|
|||||||
s = "dextm";
|
s = "dextm";
|
||||||
fmt = "t,r,+A,+G";
|
fmt = "t,r,+A,+G";
|
||||||
}
|
}
|
||||||
macro_build ((expressionS *) NULL, s, fmt, treg, sreg, pos, size - 1);
|
macro_build ((expressionS *) NULL, s, fmt, treg, sreg, (int) pos,
|
||||||
|
(int) (size - 1));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case M_DINS:
|
case M_DINS:
|
||||||
{
|
{
|
||||||
unsigned long pos;
|
/* Use unsigned arithmetic. */
|
||||||
unsigned long size;
|
addressT pos;
|
||||||
|
addressT size;
|
||||||
|
|
||||||
if (imm_expr.X_op != O_constant || imm2_expr.X_op != O_constant)
|
if (imm_expr.X_op != O_constant || imm2_expr.X_op != O_constant)
|
||||||
{
|
{
|
||||||
@ -5319,19 +5322,19 @@ macro (struct mips_cl_insn *ip)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pos = (unsigned long) imm_expr.X_add_number;
|
pos = imm_expr.X_add_number;
|
||||||
size = (unsigned long) imm2_expr.X_add_number;
|
size = imm2_expr.X_add_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pos > 63)
|
if (pos > 63)
|
||||||
{
|
{
|
||||||
as_bad (_("Improper position (%lu)"), pos);
|
as_bad (_("Improper position (%lu)"), (unsigned long) pos);
|
||||||
pos = 1;
|
pos = 1;
|
||||||
}
|
}
|
||||||
if (size == 0 || size > 64 || (pos + size - 1) > 63)
|
if (size == 0 || size > 64 || (pos + size - 1) > 63)
|
||||||
{
|
{
|
||||||
as_bad (_("Improper insert size (%lu, position %lu)"),
|
as_bad (_("Improper insert size (%lu, position %lu)"),
|
||||||
size, pos);
|
(unsigned long) size, (unsigned long) pos);
|
||||||
size = 1;
|
size = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user