static int mips_tune = CPU_UNKNOWN;
/* The argument of the -mabi= flag. */
-static char * mips_abi_string = 0;
+static char * mips_abi_string = NULL;
/* Whether we should mark the file EABI64 or EABI32. */
static int mips_eabi64 = 0;
| ((warn) ? 1 : 0)))
#define RELAX_OLD(i) (((i) >> 23) & 0x7f)
#define RELAX_NEW(i) (((i) >> 16) & 0x7f)
-#define RELAX_RELOC1(i) ((bfd_vma) (((i) >> 9) & 0x7f) - 64)
-#define RELAX_RELOC2(i) ((bfd_vma) (((i) >> 2) & 0x7f) - 64)
+#define RELAX_RELOC1(i) ((valueT) (((i) >> 9) & 0x7f) - 64)
+#define RELAX_RELOC2(i) ((valueT) (((i) >> 2) & 0x7f) - 64)
#define RELAX_RELOC3(i) (((i) >> 1) & 1)
#define RELAX_WARN(i) ((i) & 1)
macro_build (p, counter, (expressionS *) NULL, "nop", "");
p += 4;
}
- macro_build (p, counter, ep,
- HAVE_32BIT_ADDRESSES ? "lw" : "ld",
+ macro_build (p, counter, ep, HAVE_32BIT_ADDRESSES ? "lw" : "ld",
"t,o(b)", reg, (int) BFD_RELOC_MIPS_GOT16, GP);
p += 4;
macro_build (p, counter, (expressionS *) NULL, "nop", "");
p += 4;
- macro_build (p, counter, ep,
- HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu",
+ macro_build (p, counter, ep, HAVE_32BIT_ADDRESSES ? "addiu" : "daddiu",
"t,r,j", reg, reg, (int) BFD_RELOC_LO16);
if (ex.X_add_number != 0)
{
else
macro_build ((char *) NULL, &icnt, NULL, "move", "d,s", dreg, sreg, 0);
macro_build ((char *) NULL, &icnt, NULL,
- dbl ? "dsub" : "sub",
- "d,v,t", dreg, 0, sreg);
+ dbl ? "dsub" : "sub", "d,v,t", dreg, 0, sreg);
--mips_opts.noreorder;
return;
}
macro_build ((char *) NULL, &icnt, NULL, "slt", "d,v,t", AT, sreg, treg);
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "beql" : "beq",
- "s,t,p", AT, 0);
+ likely ? "beql" : "beq", "s,t,p", AT, 0);
break;
case M_BGTL_I:
if (imm_expr.X_op == O_constant && imm_expr.X_add_number == 0)
{
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "bgezl" : "bgez",
- "s,p", sreg);
+ likely ? "bgezl" : "bgez", "s,p", sreg);
return;
}
if (imm_expr.X_op == O_constant && imm_expr.X_add_number == 1)
{
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "bgtzl" : "bgtz",
- "s,p", sreg);
+ likely ? "bgtzl" : "bgtz", "s,p", sreg);
return;
}
maxnum = 0x7fffffff;
}
set_at (&icnt, sreg, 0);
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "beql" : "beq",
- "s,t,p", AT, 0);
+ likely ? "beql" : "beq", "s,t,p", AT, 0);
break;
case M_BGEUL:
if (sreg == 0)
{
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "beql" : "beq",
- "s,t,p", 0, treg);
+ likely ? "beql" : "beq", "s,t,p", 0, treg);
return;
}
macro_build ((char *) NULL, &icnt, NULL, "sltu", "d,v,t", AT, sreg,
treg);
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "beql" : "beq",
- "s,t,p", AT, 0);
+ likely ? "beql" : "beq", "s,t,p", AT, 0);
break;
case M_BGTUL_I:
if (imm_expr.X_op == O_constant && imm_expr.X_add_number == 1)
{
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "bnel" : "bne",
- "s,t,p", sreg, 0);
+ likely ? "bnel" : "bne", "s,t,p", sreg, 0);
return;
}
set_at (&icnt, sreg, 1);
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "beql" : "beq",
- "s,t,p", AT, 0);
+ likely ? "beql" : "beq", "s,t,p", AT, 0);
break;
case M_BGTL:
if (treg == 0)
{
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "bgtzl" : "bgtz",
- "s,p", sreg);
+ likely ? "bgtzl" : "bgtz", "s,p", sreg);
return;
}
if (sreg == 0)
{
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "bltzl" : "bltz",
- "s,p", treg);
+ likely ? "bltzl" : "bltz", "s,p", treg);
return;
}
macro_build ((char *) NULL, &icnt, NULL, "slt", "d,v,t", AT, treg, sreg);
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "bnel" : "bne",
- "s,t,p", AT, 0);
+ likely ? "bnel" : "bne", "s,t,p", AT, 0);
break;
case M_BGTUL:
if (treg == 0)
{
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "bnel" : "bne",
- "s,t,p", sreg, 0);
+ likely ? "bnel" : "bne", "s,t,p", sreg, 0);
return;
}
if (sreg == 0)
macro_build ((char *) NULL, &icnt, NULL, "sltu", "d,v,t", AT, treg,
sreg);
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "bnel" : "bne",
- "s,t,p", AT, 0);
+ likely ? "bnel" : "bne", "s,t,p", AT, 0);
break;
case M_BLEL:
if (treg == 0)
{
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "blezl" : "blez",
- "s,p", sreg);
+ likely ? "blezl" : "blez", "s,p", sreg);
return;
}
if (sreg == 0)
{
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "bgezl" : "bgez",
- "s,p", treg);
+ likely ? "bgezl" : "bgez", "s,p", treg);
return;
}
macro_build ((char *) NULL, &icnt, NULL, "slt", "d,v,t", AT, treg, sreg);
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "beql" : "beq",
- "s,t,p", AT, 0);
+ likely ? "beql" : "beq", "s,t,p", AT, 0);
break;
case M_BLEL_I:
if (imm_expr.X_op == O_constant && imm_expr.X_add_number == 0)
{
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "bltzl" : "bltz",
- "s,p", sreg);
+ likely ? "bltzl" : "bltz", "s,p", sreg);
return;
}
if (imm_expr.X_op == O_constant && imm_expr.X_add_number == 1)
{
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "blezl" : "blez",
- "s,p", sreg);
+ likely ? "blezl" : "blez", "s,p", sreg);
return;
}
set_at (&icnt, sreg, 0);
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "bnel" : "bne",
- "s,t,p", AT, 0);
+ likely ? "bnel" : "bne", "s,t,p", AT, 0);
break;
case M_BLEUL:
if (treg == 0)
{
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "beql" : "beq",
- "s,t,p", sreg, 0);
+ likely ? "beql" : "beq", "s,t,p", sreg, 0);
return;
}
if (sreg == 0)
macro_build ((char *) NULL, &icnt, NULL, "sltu", "d,v,t", AT, treg,
sreg);
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "beql" : "beq",
- "s,t,p", AT, 0);
+ likely ? "beql" : "beq", "s,t,p", AT, 0);
break;
case M_BLEUL_I:
}
set_at (&icnt, sreg, 1);
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "bnel" : "bne",
- "s,t,p", AT, 0);
+ likely ? "bnel" : "bne", "s,t,p", AT, 0);
break;
case M_BLTL:
if (treg == 0)
{
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "bltzl" : "bltz",
- "s,p", sreg);
+ likely ? "bltzl" : "bltz", "s,p", sreg);
return;
}
if (sreg == 0)
{
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "bgtzl" : "bgtz",
- "s,p", treg);
+ likely ? "bgtzl" : "bgtz", "s,p", treg);
return;
}
macro_build ((char *) NULL, &icnt, NULL, "slt", "d,v,t", AT, sreg, treg);
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "bnel" : "bne",
- "s,t,p", AT, 0);
+ likely ? "bnel" : "bne", "s,t,p", AT, 0);
break;
case M_BLTUL:
if (sreg == 0)
{
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "bnel" : "bne",
- "s,t,p", 0, treg);
+ likely ? "bnel" : "bne", "s,t,p", 0, treg);
return;
}
macro_build ((char *) NULL, &icnt, NULL, "sltu", "d,v,t", AT, sreg,
treg);
macro_build ((char *) NULL, &icnt, &offset_expr,
- likely ? "bnel" : "bne",
- "s,t,p", AT, 0);
+ likely ? "bnel" : "bne", "s,t,p", AT, 0);
break;
case M_DDIV_3:
{
macro_build ((char *) NULL, &icnt, NULL, "teq", "s,t", treg, 0);
macro_build ((char *) NULL, &icnt, NULL,
- dbl ? "ddiv" : "div",
- "z,s,t", sreg, treg);
+ dbl ? "ddiv" : "div", "z,s,t", sreg, treg);
}
else
{
expr1.X_add_number = 8;
macro_build ((char *) NULL, &icnt, &expr1, "bne", "s,t,p", treg, 0);
macro_build ((char *) NULL, &icnt, NULL,
- dbl ? "ddiv" : "div",
- "z,s,t", sreg, treg);
+ dbl ? "ddiv" : "div", "z,s,t", sreg, treg);
macro_build ((char *) NULL, &icnt, NULL, "break", "c", 7);
}
expr1.X_add_number = -1;
{
if (strcmp (s2, "mflo") == 0)
{
- if (dbl)
- macro_build ((char *) NULL, &icnt, NULL, "dneg", "d,w", dreg,
- sreg);
- else
- macro_build ((char *) NULL, &icnt, NULL, "neg", "d,w", dreg,
- sreg);
+ macro_build ((char *) NULL, &icnt, NULL, dbl ? "dneg" : "neg",
+ "d,w", dreg, sreg);
}
else
macro_build ((char *) NULL, &icnt, NULL, "move", "d,s", dreg, 0);
R4000 uses interlocks to handle coproc delays.
Other chips (like the R3000) require nops to be inserted for delays.
- FIXME: Currently, we require that the user handle delays.
+ FIXME: Currently, we require that the user handles delays.
In order to fill delay slots for non-interlocked chips,
we must have a way to specify delays based on the coprocessor.
Eg. 4 cycles if load coproc reg from memory, 1 if in cache, etc.
anyway. */
load_register (&icnt, AT, &imm_expr, dbl);
macro_build ((char *) NULL, &icnt, NULL,
- dbl ? "dmult" : "mult",
- "s,t", sreg, AT);
+ dbl ? "dmult" : "mult", "s,t", sreg, AT);
macro_build ((char *) NULL, &icnt, NULL, "mflo", "d", dreg);
break;
if (imm)
load_register (&icnt, AT, &imm_expr, dbl);
macro_build ((char *) NULL, &icnt, NULL,
- dbl ? "dmult" : "mult",
- "s,t", sreg, imm ? AT : treg);
+ dbl ? "dmult" : "mult", "s,t", sreg, imm ? AT : treg);
macro_build ((char *) NULL, &icnt, NULL, "mflo", "d", dreg);
macro_build ((char *) NULL, &icnt, NULL,
- dbl ? "dsra32" : "sra",
- "d,w,<", dreg, dreg, 31);
+ dbl ? "dsra32" : "sra", "d,w,<", dreg, dreg, 31);
macro_build ((char *) NULL, &icnt, NULL, "mfhi", "d", AT);
if (mips_trap)
macro_build ((char *) NULL, &icnt, NULL, "tne", "s,t", dreg, AT);
}
load_register (&icnt, AT, &imm_expr, dbl);
macro_build ((char *) NULL, &icnt, NULL,
- dbl ? "dsub" : "sub",
- "d,v,t", dreg, sreg, AT);
+ dbl ? "dsub" : "sub", "d,v,t", dreg, sreg, AT);
break;
case M_DSUBU_I:
}
load_register (&icnt, AT, &imm_expr, dbl);
macro_build ((char *) NULL, &icnt, NULL,
- dbl ? "dsubu" : "subu",
- "d,v,t", dreg, sreg, AT);
+ dbl ? "dsubu" : "subu", "d,v,t", dreg, sreg, AT);
break;
case M_TEQ_I:
dbl = 1;
case M_MUL:
macro_build ((char *) NULL, &icnt, NULL,
- dbl ? "dmultu" : "multu",
- "x,y", xreg, yreg);
+ dbl ? "dmultu" : "multu", "x,y", xreg, yreg);
macro_build ((char *) NULL, &icnt, NULL, "mflo", "x", zreg);
return;
as_bad (_("Unsupported large constant"));
imm_expr.X_add_number = -imm_expr.X_add_number;
macro_build ((char *) NULL, &icnt, &imm_expr,
- dbl ? "daddiu" : "addiu",
- "y,x,4", yreg, xreg);
+ dbl ? "daddiu" : "addiu", "y,x,4", yreg, xreg);
break;
case M_SUBU_I_2:
-membedded-pic generate embedded position independent code\n\
-EB generate big endian output\n\
-EL generate little endian output\n\
--g, -g2 do not remove uneeded NOPs or swap branches\n\
+-g, -g2 do not remove unneeded NOPs or swap branches\n\
-G NUM allow referencing objects up to NUM bytes\n\
implicitly with the gp register [default 8]\n"));
fprintf (stream, _("\
case 1: mips_opts.isa = ISA_MIPS1; break;
case 2: mips_opts.isa = ISA_MIPS2; break;
case 3: mips_opts.isa = ISA_MIPS3; break;
- case 5: mips_opts.isa = ISA_MIPS5; break;
case 4: mips_opts.isa = ISA_MIPS4; break;
+ case 5: mips_opts.isa = ISA_MIPS5; break;
case 32: mips_opts.isa = ISA_MIPS32; break;
case 64: mips_opts.isa = ISA_MIPS64; break;
default: as_bad (_("unknown ISA level")); break;
+ RELAX_RELOC1 (fragp->fr_subtype));
/* FIXME: This really needs as_warn_where. */
if (RELAX_WARN (fragp->fr_subtype))
- as_warn (_("AT used after \".set noat\" or macro used after \".set nomacro\""));
+ as_warn (_("AT used after \".set noat\" or macro used after "
+ "\".set nomacro\""));
+
+ return RELAX_NEW (fragp->fr_subtype) - RELAX_OLD (fragp->fr_subtype);
}
- if (! change)
- return 0;
- else
- return RELAX_NEW (fragp->fr_subtype) - RELAX_OLD (fragp->fr_subtype);
+ return 0;
}
/* This is called to see whether a reloc against a defined symbol
elf_elfheader (stdoutput)->e_flags |= EF_MIPS_PIC;
/* Set the MIPS ELF ABI flags. */
- if (mips_abi_string == 0)
+ if (mips_abi_string == NULL)
;
else if (strcmp (mips_abi_string, "32") == 0)
elf_elfheader (stdoutput)->e_flags |= E_MIPS_ABI_O32;
{
/* check for premature end, nesting errors, etc */
if (cur_proc_ptr)
- as_warn (_("missing `.end' at end of assembly"));
+ as_warn (_("missing .end at end of assembly"));
}
static long
as_warn (_(".ent or .aent not in text section."));
if (!aent && cur_proc_ptr)
- as_warn (_("missing `.end'"));
+ as_warn (_("missing .end"));
if (!aent)
{