Fri Sep 24 12:37:59 1993 K. Richard Pixley (rich@sendai.cygnus.com)
+ * config/tc-m88k.c (get_o6): new function.
+ (get_bf, get_cmp, get_cnd, get_cr, get_fcr, get_imm16, get_reg,
+ get_vec9, getval, get_pcr, calcop, match_name): make static and
+ prototype.
+ (s_file): remove extraneous forward decl.
+ (md_begin): add const to retval decl.
+ (calcop): cope with instructions without arguments. Handle 'o'
+ type argument, the o6 field of the prot insn.
+ (md_estimate_size_before_relax): return a dummy value.
+
* config/m88k-opcode.h (m88k_opcodes): comment change; o6 field is
in bits 10 through 7. flt.[dxs]s requires an r register in the
second argument. New instruction lda.x. New instruction muls
#include "as.h"
#include "m88k-opcode.h"
-char *getval ();
-char *get_reg ();
-char *get_imm16 ();
-char *get_bf ();
-char *get_pcr ();
-char *get_cmp ();
-char *get_cnd ();
-char *get_cr ();
-char *get_fcr ();
-char *get_vec9 ();
-
struct field_val_assoc
{
char *name;
enum reloc_type reloc;
};
+static char *get_bf PARAMS ((char *param, unsigned *valp));
+static char *get_cmp PARAMS ((char *param, unsigned *valp));
+static char *get_cnd PARAMS ((char *param, unsigned *valp));
+static char *get_cr PARAMS ((char *param, unsigned *regnop));
+static char *get_fcr PARAMS ((char *param, unsigned *regnop));
+static char *get_imm16 PARAMS ((char *param, struct m88k_insn *insn));
+static char *get_o6 PARAMS ((char *param, unsigned *valp));
+static char *get_reg PARAMS ((char *param, unsigned *regnop, int reg_prefix));
+static char *get_vec9 PARAMS ((char *param, unsigned *valp));
+static char *getval PARAMS ((char *param, unsigned int *valp));
+
+static char *get_pcr PARAMS ((char *param, struct m88k_insn *insn,
+ enum reloc_type reloc));
+
+static int calcop PARAMS ((struct m88k_opcode *format,
+ char *param, struct m88k_insn *insn));
+
+
extern char *myname;
static struct hash_control *op_hash = NULL;
extern void float_cons (), cons (), s_globl (), s_space (),
s_set (), s_lcomm ();
-static void s_file ();
const pseudo_typeS md_pseudo_table[] =
{
void
md_begin ()
{
- char *retval = NULL;
+ const char *retval = NULL;
unsigned int i = 0;
/* initialize hash table */
}
}
-int
+static int
calcop (format, param, insn)
struct m88k_opcode *format;
char *param;
{
case 0:
insn->opcode |= opcode;
- return *param == 0;
+ return (*param == 0 || *param == '\n');
default:
if (f != *param++)
opcode |= val << 21;
break;
+ case 'o':
+ param = get_o6 (param, &val);
+ opcode |= ((val >> 2) << 7);
+ break;
+
case 'x':
reg_prefix = 'x';
break;
}
}
-char *
+static char *
match_name (param, assoc_tab, valp)
char *param;
struct field_val_assoc *assoc_tab;
}
}
-char *
+static char *
get_reg (param, regnop, reg_prefix)
char *param;
unsigned *regnop;
return 0;
}
-char *
+static char *
get_imm16 (param, insn)
char *param;
struct m88k_insn *insn;
return param;
}
-char *
+static char *
get_pcr (param, insn, reloc)
char *param;
struct m88k_insn *insn;
return saveparam;
}
-char *
+static char *
get_cmp (param, valp)
char *param;
unsigned *valp;
return param;
}
-char *
+static char *
get_cnd (param, valp)
char *param;
unsigned *valp;
return param;
}
-char *
+static char *
get_bf2 (param, bc)
char *param;
int bc;
}
}
-char *
+static char *
get_bf_offset_expression (param, offsetp)
char *param;
unsigned *offsetp;
return param;
}
-char *
+static char *
get_bf (param, valp)
char *param;
unsigned *valp;
return param;
}
-char *
+static char *
get_cr (param, regnop)
char *param;
unsigned *regnop;
{
unsigned regno;
unsigned c;
- int i;
- int name_len;
if (!strncmp (param, "cr", 2))
{
return param;
}
-char *
+static char *
get_fcr (param, regnop)
char *param;
unsigned *regnop;
{
unsigned regno;
unsigned c;
- int i;
- int name_len;
if (!strncmp (param, "fcr", 3))
{
return param;
}
-char *
+static char *
get_vec9 (param, valp)
char *param;
unsigned *valp;
return param;
}
+static char *
+get_o6 (param, valp)
+ char *param;
+ unsigned *valp;
+{
+ unsigned val;
+ char *save_ptr;
+
+ save_ptr = input_line_pointer;
+ input_line_pointer = param;
+ val = get_absolute_expression ();
+ param = input_line_pointer;
+ input_line_pointer = save_ptr;
+
+ if (val & 0x3)
+ as_warn ("Removed lower 2 bits of expression");
+
+ *valp = val;
+
+ return(param);
+}
+
#define hexval(z) \
(isdigit (z) ? (z) - '0' : \
islower (z) ? (z) - 'a' + 10 : \
isupper (z) ? (z) - 'A' + 10 : -1)
-char *
+static char *
getval (param, valp)
char *param;
unsigned int *valp;
segT segment_type;
{
as_fatal ("Relaxation should never occur");
+ return (-1);
}
const relax_typeS md_relax_table[] =