/* tc-i960.c - All the i80960-specific stuff
- Copyright (C) 1989-2016 Free Software Foundation, Inc.
+ Copyright (C) 1989-2017 Free Software Foundation, Inc.
This file is part of GAS.
of branches taken/not-taken for later input to a utility that will
set the branch prediction bits of the instructions in accordance with
the behavior observed. (Note that the KX series does not have
- brach-prediction.)
+ branch-prediction.)
The instrumentation consists of:
/* Name of the table of pointers to branches. A local (i.e.,
non-external) symbol. */
-static void ctrl_fmt (char *, long, int);
+static void ctrl_fmt (const char *, long, int);
\f
void
string is not consumed in the evaluation -- tolerate no dangling junk! */
static void
-parse_expr (char *textP, /* Text of expression to be parsed. */
+parse_expr (const char *textP, /* Text of expression to be parsed. */
expressionS *expP) /* Where to put the results of parsing. */
{
char *save_in; /* Save global here. */
else
{
save_in = input_line_pointer; /* Save global. */
- input_line_pointer = textP; /* Make parser work for us. */
+ input_line_pointer = (char *) textP; /* Make parser work for us. */
(void) expression (expP);
if ((size_t) (input_line_pointer - textP) != strlen (textP))
address displacement is greater than 13 bits. */
static void
-get_cdisp (char *dispP, /* Displacement as specified in source instruction. */
+get_cdisp (const char *dispP, /* Displacement as specified in source instruction. */
const char *ifmtP, /* "COBR" or "CTRL" (for use in error message). */
long instr, /* Instruction needing the displacement. */
int numbits, /* # bits of displacement (13 for COBR, 24 for CTRL). */
{
case O_illegal:
as_bad (_("expression syntax error"));
+ break;
case O_symbol:
if (S_GET_SEGMENT (e.X_add_symbol) == now_seg
regnum = *intP;
*p = '\0'; /* Discard register spec. */
if (regnum == IPREL)
- /* We have to specialcase ip-rel mode. */
+ /* We have to special-case ip-rel mode. */
iprel_flag = 1;
else
{
case I_BIT:
/* Treat missing displacement as displacement of 0. */
mode |= D_BIT;
- /* Fall into next case. */
+ /* Fall through. */
case D_BIT | A_BIT | I_BIT:
case D_BIT | I_BIT:
/* Set MEMB bit in mode, and OR in mode bits. */
{
default:
/* We're dependent on one or more symbols -- use "lda". */
- arg[0] = "lda";
+ arg[0] = (char *) "lda";
break;
case O_constant:
lda xxx,<reg>. */
n = offs (e);
if ((0 <= n) && (n <= 31))
- arg[0] = "mov";
+ arg[0] = (char *) "mov";
else if ((-31 <= n) && (n <= -1))
{
- arg[0] = "subo";
+ arg[0] = (char *) "subo";
arg[3] = arg[2];
sprintf (buf, "%d", -n);
arg[1] = buf;
- arg[2] = "0";
+ arg[2] = (char *) "0";
}
else if ((32 <= n) && (n <= 62))
{
- arg[0] = "addo";
+ arg[0] = (char *) "addo";
arg[3] = arg[2];
- arg[1] = "31";
+ arg[1] = (char *) "31";
sprintf (buf, "%d", n - 31);
arg[2] = buf;
}
else if ((shift = shift_ok (n)) != 0)
{
- arg[0] = "shlo";
+ arg[0] = (char *) "shlo";
arg[3] = arg[2];
sprintf (buf, "%d", shift);
arg[1] = buf;
arg[2] = buf2;
}
else
- arg[0] = "lda";
+ arg[0] = (char *) "lda";
break;
case O_illegal:
n = 1;
args[1] = p;
- /* Squeze blanks out by moving non-blanks toward start of string.
+ /* Squeeze blanks out by moving non-blanks toward start of string.
Isolate operands, whenever comma is found. */
to = p;
while (*p != '\0')
}
static void
-ctrl_fmt (char *targP, /* Pointer to text of lone operand (if any). */
+ctrl_fmt (const char *targP, /* Pointer to text of lone operand (if any). */
long opcode, /* Template of instruction. */
int num_ops) /* Number of operands. */
{
if (!oP || !targ_has_iclass (oP->iclass))
as_bad (_("invalid opcode, \"%s\"."), args[0]);
else if (n_ops != oP->num_ops)
- as_bad (_("improper number of operands. expecting %d, got %d"),
+ as_bad (_("improper number of operands. Expecting %d, got %d"),
oP->num_ops, n_ops);
else
{
mem_fmt (args, oP, 1);
break;
}
+ /* Fall through. */
case MEM2:
case MEM4:
case MEM8:
number_to_chars_littleendian (buf, value, n);
}
-char *
+const char *
md_atof (int type, char *litP, int *sizeP)
{
return ieee_md_atof (type, litP, sizeP, FALSE);
};
int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
{
switch (c)
{
case 'A':
{
const struct tabentry *tp;
- char *p = arg;
+ const char *p = arg;
for (tp = arch_tab; tp->flag != NULL; tp++)
if (!strcmp (p, tp->flag))
{
arelent * reloc;
- reloc = xmalloc (sizeof (arelent));
+ reloc = XNEW (arelent);
/* HACK: Is this right? */
fixP->fx_r_type = tc_bfd_fix2rtype (fixP);
gas_assert (!fixP->fx_pcrel == !reloc->howto->pc_relative);
- reloc->sym_ptr_ptr = xmalloc (sizeof (asymbol *));
+ reloc->sym_ptr_ptr = XNEW (asymbol *);
*reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
reloc->address = fixP->fx_frag->fr_address + fixP->fx_where;
reloc->addend = fixP->fx_addnumber;