It used not to be possible with the original relaxation code,
but it could be done now. */
- if (*used_at == 0 && ! mips_opts.noat)
+ if (*used_at == 0 && !mips_opts.noat)
{
macro_build (ep, "lui", "t,u", reg, BFD_RELOC_MIPS_HIGHEST);
macro_build (ep, "lui", "t,u", AT, BFD_RELOC_HI16_S);
return;
}
- if (treg == breg)
+ if (!mips_opts.noat && (treg == breg))
{
tempreg = AT;
used_at = 1;
else
{
tempreg = treg;
- used_at = 0;
}
if (offset_expr.X_op != O_symbol
these macros. It used not to be possible with the
original relaxation code, but it could be done now. */
- if (used_at == 0 && ! mips_opts.noat)
+ if (used_at == 0 && !mips_opts.noat)
{
macro_build (&offset_expr, "lui", "t,u",
tempreg, BFD_RELOC_MIPS_HIGHEST);
macro_build (NULL, s, "d,v,t", treg, tempreg, breg);
}
- if (! used_at)
+ if (!used_at)
return;
break;
case M_LWU_AB:
s = "lwu";
ld:
- if (breg == treg || coproc || lr)
+ /* XXX Why don't we try to use AT for all expansions? */
+ if (!mips_opts.noat && (breg == treg || coproc || lr))
{
tempreg = AT;
used_at = 1;
}
+ else if (breg == treg
+ && (offset_expr.X_op != O_constant
+ || (offset_expr.X_add_number > 0x7fff
+ || offset_expr.X_add_number < -0x8000)))
+ {
+ as_bad(_("load expansion needs $at register"));
+ }
else
{
tempreg = treg;
case M_SDR_AB:
s = "sdr";
st:
- tempreg = AT;
- used_at = 1;
+ if (!mips_opts.noat)
+ {
+ tempreg = AT;
+ used_at = 1;
+ }
+ else if (breg == treg
+ && (offset_expr.X_op != O_constant
+ || (offset_expr.X_add_number > 0x7fff
+ || offset_expr.X_add_number < -0x8000)))
+ {
+ as_bad(_("store expansion needs $at register"));
+ }
+ else
+ {
+ tempreg = treg;
+ used_at = 0;
+ }
ld_st:
/* Itbl support may require additional care here. */
if (mask == M_LWC1_AB
these macros. It used not to be possible with the
original relaxation code, but it could be done now. */
- if (used_at == 0 && ! mips_opts.noat)
+ if (used_at == 0 && !mips_opts.noat)
{
macro_build (&offset_expr, "lui", "t,u", tempreg,
BFD_RELOC_MIPS_HIGHEST);
BFD_RELOC_LO16, tempreg);
}
+ if (used_at)
+ break;
+
return;
}
macro_build (&offset_expr, s, fmt, treg, BFD_RELOC_GPREL16,
mips_gp_register);
relax_switch ();
- used_at = 0;
}
macro_build_lui (&offset_expr, tempreg);
macro_build (&offset_expr, s, fmt, treg,
macro_build (&offset_expr, s, fmt, treg,
BFD_RELOC_MIPS_GOT_OFST, tempreg);
- if (! used_at)
+ if (!used_at)
return;
break;
else
abort ();
- if (! used_at)
+ if (!used_at)
return;
break;
if (breg == 0)
{
tempreg = mips_gp_register;
- used_at = 0;
}
else
{
else
abort ();
- if (! used_at)
+ if (!used_at)
return;
break;
else
{
tempreg = dreg;
- used_at = 0;
}
macro_build (NULL, "dnegu", "d,w", tempreg, treg);
macro_build (NULL, "drorv", "d,t,s", dreg, sreg, tempreg);
else
{
tempreg = dreg;
- used_at = 0;
}
macro_build (NULL, "negu", "d,w", tempreg, treg);
macro_build (NULL, "rorv", "d,t,s", dreg, sreg, tempreg);
&& imm_expr.X_add_number < 0x10000)
{
macro_build (&imm_expr, "xori", "t,r,i", dreg, sreg, BFD_RELOC_LO16);
- used_at = 0;
}
else if (imm_expr.X_op == O_constant
&& imm_expr.X_add_number > -0x8000
imm_expr.X_add_number = -imm_expr.X_add_number;
macro_build (&imm_expr, HAVE_32BIT_GPRS ? "addiu" : "daddiu",
"t,r,j", dreg, sreg, BFD_RELOC_LO16);
- used_at = 0;
}
else
{
{
macro_build (&imm_expr, mask == M_SGE_I ? "slti" : "sltiu", "t,r,j",
dreg, sreg, BFD_RELOC_LO16);
- used_at = 0;
}
else
{
&& imm_expr.X_add_number < 0x10000)
{
macro_build (&imm_expr, "xori", "t,r,i", dreg, sreg, BFD_RELOC_LO16);
- used_at = 0;
}
else if (imm_expr.X_op == O_constant
&& imm_expr.X_add_number > -0x8000
imm_expr.X_add_number = -imm_expr.X_add_number;
macro_build (&imm_expr, HAVE_32BIT_GPRS ? "addiu" : "daddiu",
"t,r,j", dreg, sreg, BFD_RELOC_LO16);
- used_at = 0;
}
else
{