int nops = 0;
/* Mark instruction labels in mips16 mode. */
- if (mips_opts.mips16)
- mips16_mark_labels ();
+ mips16_mark_labels ();
prev_pinfo = prev_insn.insn_mo->pinfo;
pinfo = ip->insn_mo->pinfo;
MIPS_GR_REG))
{
- nops += 1;
+ ++nops;
}
else if (prev_pinfo & INSN_READ_LO)
else if (mips_opts.mips16
&& (mips_optimize == 0
|| (pinfo & MIPS16_INSN_BRANCH)))
- nops += 1;
+ ++nops;
}
else if (prev_insn.insn_mo->pinfo & INSN_READ_HI)
{
else if (mips_opts.mips16
&& (mips_optimize == 0
|| (pinfo & MIPS16_INSN_BRANCH)))
- nops += 1;
+ ++nops;
}
/* If the previous instruction was in a noreorder section, then
val = (valueT) frag_now_fix ();
/* mips16 text labels are stored as odd. */
if (mips_opts.mips16)
- val += 1;
+ ++val;
S_SET_VALUE (l->label, val);
}
if (pinfo & INSN_READ_GPR_S)
mips_gprmask |= 1 << ((ip->insn_opcode >> OP_SH_RS) & OP_MASK_RS);
if (pinfo & INSN_WRITE_GPR_31)
- mips_gprmask |= 1 << 31;
+ mips_gprmask |= 1 << RA;
if (pinfo & INSN_WRITE_FPR_D)
mips_cprmask[1] |= 1 << ((ip->insn_opcode >> OP_SH_FD) & OP_MASK_FD);
if ((pinfo & (INSN_WRITE_FPR_S | INSN_READ_FPR_S)) != 0)
|| ((pinfo & INSN_WRITE_GPR_31)
&& (((prev_insn.insn_opcode >> OP_SH_RT)
& OP_MASK_RT)
- == 31))))
+ == RA))))
|| (! mips_opts.mips16
&& (prev_pinfo & INSN_WRITE_GPR_D)
&& (((pinfo & INSN_WRITE_GPR_D)
|| ((pinfo & INSN_WRITE_GPR_31)
&& (((prev_insn.insn_opcode >> OP_SH_RD)
& OP_MASK_RD)
- == 31))))
+ == RA))))
|| (mips_opts.mips16
&& (pinfo & MIPS16_INSN_WRITE_31)
&& ((prev_pinfo & MIPS16_INSN_WRITE_31)
MIPS_GR_REG))
|| (! mips_opts.mips16
&& (pinfo & INSN_WRITE_GPR_31)
- && insn_uses_reg (&prev_insn, 31, MIPS_GR_REG))
+ && insn_uses_reg (&prev_insn, RA, MIPS_GR_REG))
|| (mips_opts.mips16
&& (pinfo & MIPS16_INSN_WRITE_31)
&& insn_uses_reg (&prev_insn, RA, MIPS_GR_REG))
val = (valueT) frag_now_fix ();
/* mips16 text labels are stored as odd. */
if (mips_opts.mips16)
- val += 1;
+ ++val;
S_SET_VALUE (l->label, val);
}
}
}
/* Mark instruction labels in mips16 mode. */
- if (mips_opts.mips16 && insns)
+ if (insns)
mips16_mark_labels ();
mips_no_prev_insn (insns);
as_warn (_("Macro instruction expanded into multiple instructions in a branch delay slot"));
if (place == NULL)
- *counter += 1; /* bump instruction counter */
+ ++*counter; /* bump instruction counter */
if (mips_opts.mips16)
{
as_warn (_("Macro instruction expanded into multiple instructions"));
if (place == NULL)
- *counter += 1; /* bump instruction counter */
+ ++*counter; /* bump instruction counter */
insn.insn_mo = (struct mips_opcode *) hash_find (op_hash, name);
assert (insn.insn_mo);
(shift >= 32) ? shift - 32 : shift);
return;
}
- shift++;
+ ++shift;
}
while (shift <= (64 - 16));
int dbl;
int *used_at;
{
- char *p;
+ char *p = NULL;
if (ep->X_op != O_constant
&& ep->X_op != O_symbol)
*/
if (dbl)
{
- p = NULL;
-
/* We don't do GP optimization for now because RELAX_ENCODE can't
hold the data for such large chunks. */
}
else
{
- p = NULL;
if ((valueT) ep->X_add_number <= MAX_GPREL_OFFSET
&& ! nopic_need_relax (ep->X_add_symbol, 1))
{
offsetT maxnum;
int off;
bfd_reloc_code_real_type r;
- char *p;
int hold_mips_optimize;
assert (! mips_opts.mips16);
}
if (imm_expr.X_op != O_constant)
as_bad (_("Unsupported large constant"));
- imm_expr.X_add_number++;
+ ++imm_expr.X_add_number;
/* FALLTHROUGH */
case M_BGE_I:
case M_BGEL_I:
goto do_false;
if (imm_expr.X_op != O_constant)
as_bad (_("Unsupported large constant"));
- imm_expr.X_add_number++;
+ ++imm_expr.X_add_number;
/* FALLTHROUGH */
case M_BGEU_I:
case M_BGEUL_I:
goto do_true;
if (imm_expr.X_op != O_constant)
as_bad (_("Unsupported large constant"));
- imm_expr.X_add_number++;
+ ++imm_expr.X_add_number;
/* FALLTHROUGH */
case M_BLT_I:
case M_BLTL_I:
goto do_true;
if (imm_expr.X_op != O_constant)
as_bad (_("Unsupported large constant"));
- imm_expr.X_add_number++;
+ ++imm_expr.X_add_number;
/* FALLTHROUGH */
case M_BLTU_I:
case M_BLTUL_I:
dsll $tempreg,16
daddiu $tempreg,<sym> (BFD_RELOC_LO16)
*/
- p = NULL;
+ char *p = NULL;
if (HAVE_64BIT_ADDRESSES)
{
/* We don't do GP optimization for now because RELAX_ENCODE can't
if (expr1.X_add_number == 0)
{
int off;
+ char *p;
if (breg == 0)
off = 0;
else if (mips_pic == SVR4_PIC)
{
int gpdel;
+ char *p;
int lui_reloc_type = (int) BFD_RELOC_MIPS_GOT_HI16;
int lw_reloc_type = (int) BFD_RELOC_MIPS_GOT_LO16;
macro_build ((char *) NULL, &icnt, &offset_expr, "jal", "a");
else if (mips_pic == SVR4_PIC)
{
+ char *p;
+
/* If this is a reference to an external symbol, and we are
using a small GOT, we want
lw $25,<sym>($gp) (BFD_RELOC_MIPS_CALL16)
nop
- jalr $25
+ jalr $ra,$25
nop
lw $gp,cprestore($sp)
The cprestore value is set using the .cprestore
addu $25,$25,$gp
lw $25,<sym>($25) (BFD_RELOC_MIPS_CALL_LO16)
nop
- jalr $25
+ jalr $ra,$25
nop
lw $gp,cprestore($sp)
If the symbol is not external, we want
lw $25,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
nop
addiu $25,$25,<sym> (BFD_RELOC_LO16)
- jalr $25
+ jalr $ra,$25
nop
lw $gp,cprestore($sp) */
frag_grow (40);
if (mips_pic == NO_PIC
|| offset_expr.X_op == O_constant)
{
+ char *p;
+
/* If this is a reference to a GP relative symbol, and there
is no base register, we want
<op> $treg,<sym>($gp) (BFD_RELOC_GPREL16)
}
else if (mips_pic == SVR4_PIC && ! mips_big_got)
{
+ char *p;
+
/* If this is a reference to an external symbol, we want
lw $tempreg,<sym>($gp) (BFD_RELOC_MIPS_GOT16)
nop
else if (mips_pic == SVR4_PIC)
{
int gpdel;
+ char *p;
/* If this is a reference to an external symbol, we want
lui $tempreg,<sym> (BFD_RELOC_MIPS_GOT_HI16)
{
macro_build ((char *) NULL, &icnt, &offset_expr, "lw", "t,o(b)",
treg, (int) BFD_RELOC_LO16, AT);
- if (treg != 31)
+ if (treg != RA)
{
/* FIXME: How in the world do we deal with the possible
overflow here? */
if (mips_pic == NO_PIC
|| offset_expr.X_op == O_constant)
{
+ char *p;
+
/* If this is a reference to a GP relative symbol, we want
<op> $treg,<sym>($gp) (BFD_RELOC_GPREL16)
<op> $treg+1,<sym>+4($gp) (BFD_RELOC_GPREL16)
else if (mips_pic == SVR4_PIC)
{
int gpdel, off;
+ char *p;
/* If this is a reference to an external symbol, we want
lui $at,<sym> (BFD_RELOC_MIPS_GOT_HI16)
macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "mflo", "d",
dreg);
macro_build ((char *) NULL, &icnt, (expressionS *) NULL,
- dbl ? "dsra32" : "sra", "d,w,<", dreg, dreg, 31);
+ dbl ? "dsra32" : "sra", "d,w,<", dreg, dreg, RA);
macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "mfhi", "d",
AT);
if (mips_trap)
++mips_opts.noreorder;
mips_any_noreorder = 1;
macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "cfc1", "t,G",
- treg, 31);
+ treg, RA);
macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "cfc1", "t,G",
- treg, 31);
+ treg, RA);
macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "nop", "");
expr1.X_add_number = 3;
macro_build ((char *) NULL, &icnt, &expr1, "ori", "t,r,i", AT, treg,
macro_build ((char *) NULL, &icnt, &expr1, "xori", "t,r,i", AT, AT,
(int) BFD_RELOC_LO16);
macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "ctc1", "t,G",
- AT, 31);
+ AT, RA);
macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "nop", "");
macro_build ((char *) NULL, &icnt, (expressionS *) NULL,
mask == M_TRUNCWD ? "cvt.w.d" : "cvt.w.s", "D,S", dreg, sreg);
macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "ctc1", "t,G",
- treg, 31);
+ treg, RA);
macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "nop", "");
--mips_opts.noreorder;
break;
as_bad (_("operand overflow"));
/* avoid load delay */
if (! target_big_endian)
- offset_expr.X_add_number += 1;
+ ++offset_expr.X_add_number;
macro_build ((char *) NULL, &icnt, &offset_expr, s, "t,o(b)", treg,
(int) BFD_RELOC_LO16, breg);
if (! target_big_endian)
- offset_expr.X_add_number -= 1;
+ --offset_expr.X_add_number;
else
- offset_expr.X_add_number += 1;
+ ++offset_expr.X_add_number;
macro_build ((char *) NULL, &icnt, &offset_expr, "lbu", "t,o(b)", AT,
(int) BFD_RELOC_LO16, breg);
macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "sll", "d,w,<",
if (offset_expr.X_add_number >= 0x7fff)
as_bad (_("operand overflow"));
if (target_big_endian)
- offset_expr.X_add_number += 1;
+ ++offset_expr.X_add_number;
macro_build ((char *) NULL, &icnt, &offset_expr, "sb", "t,o(b)", treg,
(int) BFD_RELOC_LO16, breg);
macro_build ((char *) NULL, &icnt, (expressionS *) NULL, "srl", "d,w,<",
AT, treg, 8);
if (target_big_endian)
- offset_expr.X_add_number -= 1;
+ --offset_expr.X_add_number;
else
- offset_expr.X_add_number += 1;
+ ++offset_expr.X_add_number;
macro_build ((char *) NULL, &icnt, &offset_expr, "sb", "t,o(b)", AT,
(int) BFD_RELOC_LO16, breg);
break;
as_warn (_("Used $at without \".set noat\""));
c = *args;
if (*s == ' ')
- s++;
+ ++s;
if (args[1] != *s)
{
if (c == 'r' || c == 'v' || c == 'w')
{
regno = lastregno;
s = s_reset;
- args++;
+ ++args;
}
}
/* 'z' only matches $0. */
c = *args;
if (*s == ' ')
- s++;
+ ++s;
if (args[1] != *s)
{
if (c == 'V' || c == 'W')
{
regno = lastregno;
s = s_reset;
- args++;
+ ++args;
}
}
switch (c)
{
regno = mips16_to_32_reg_map[lastregno];
s = s_reset;
- args++;
+ ++args;
}
}
mask |= (reg2 - 3) << 3;
else if (reg1 == 16 && reg2 >= 16 && reg2 <= 17)
mask |= (reg2 - 15) << 1;
- else if (reg1 == 31 && reg2 == 31)
+ else if (reg1 == RA && reg2 == RA)
mask |= 1;
else
{
for (s = *str + 1; *s && pcnt; s++, (*len)++)
{
if (*s == '(')
- pcnt++;
+ ++pcnt;
else if (*s == ')')
- pcnt--;
+ --pcnt;
}
}
}
return S_EX_NONE;
*len = strlen (percent_op[i].str);
- (*nestlevel)++;
+ ++(*nestlevel);
return type;
}
}
for (end = strchr (s, '(') + 1; *end && pcnt; end++)
{
if (*end == '(')
- pcnt++;
+ ++pcnt;
else if (*end == ')')
- pcnt--;
+ --pcnt;
}
memset (s, ' ', end - s);
}
if (*input_line_pointer == ',')
{
- input_line_pointer++;
+ ++input_line_pointer;
temp_fill = get_absolute_expression ();
}
else
char *name = input_line_pointer, ch;
while (!is_end_of_line[(unsigned char) *input_line_pointer])
- input_line_pointer++;
+ ++input_line_pointer;
ch = *input_line_pointer;
*input_line_pointer = '\0';
return;
}
else
- input_line_pointer++;
+ ++input_line_pointer;
SKIP_WHITESPACE ();
sym = input_line_pointer;
while (ISALNUM (*input_line_pointer))
- input_line_pointer++;
+ ++input_line_pointer;
*input_line_pointer = 0;
ex_sym.X_op = O_symbol;
s_insn (ignore)
int ignore ATTRIBUTE_UNUSED;
{
- if (mips_opts.mips16)
- mips16_mark_labels ();
+ mips16_mark_labels ();
demand_empty_rest_of_line ();
}
s_mips_stab (type)
int type;
{
- if (type == 'n' && mips_opts.mips16)
+ if (type == 'n')
mips16_mark_labels ();
s_stab (type);
if (bytes & 1)
{
*p++ = 0;
- fragp->fr_fix += 1;
+ fragp->fr_fix++;
}
memcpy (p, (target_big_endian ? be_nop : le_nop), 2);
subseg_set (saved_seg, saved_subseg);
}
-#endif
+#endif /* MIPS_STABS_ELF */
cur_proc_ptr = NULL;
}
symbolP = get_symbol ();
if (*input_line_pointer == ',')
- input_line_pointer++;
+ ++input_line_pointer;
SKIP_WHITESPACE ();
if (ISDIGIT (*input_line_pointer)
|| *input_line_pointer == '-')
symbol_get_bfdsym (symbolP)->flags |= BSF_FUNCTION;
- numprocs++;
+ ++numprocs;
}
demand_empty_rest_of_line ();