+1999-10-18 Michael Meissner <meissner@cygnus.com>
+
+ * expr.h (operatorT): Add machine dependent operators md1..md8.
+ (expressionS): Make X_op 8 bits instead of 7. Add a X_md field
+ for the machine dependent operators to use.
+
+ * expr.c (op_rank): Add machine dependent operators.
+
+ * config/tc-alpha.c (O_pregister): Define as a machine dependent
+ operator.
+ (O_cpregister): Ditto.
+ (md_begin): Change X_op test that field is wide enough to use
+ O_max instead of O_alpha_max.
+ (cpu_types): Fill in missing initializer.
+ (alpha_num_macros): Make unsigned.
+ (md_assemble): Make opnamelen be size_t.
+ (md_apply_fix): Cast alpha_num_operands to int before testing.
+ (alpha_force_relocation): Ditto.
+ (alpha_fix_adjustable): Ditto.
+ (alpha_fix_adjustable): Mark unused arguments ATTRIBUTE_UNUSED.
+ (tc_gen_reloc): Ditto.
+ (tc_get_register): Ditto.
+ (emit_ldgp): Ditto.
+ (emit_lda): Ditto.
+ (emit_ldah): Ditto.
+ (emit_ldil): Ditto.
+ (s_alpha_ent): Ditto.
+ (s_alpha_end): Ditto.
+ (s_alpha_frame): Ditto.
+ (s_alpha_prologue): Ditto.
+ (s_alpha_file): Ditto.
+ (s_alpha_gprel32): Ditto.
+ (s_alpha_proc): Ditto.
+ (s_alpha_set): Ditto.
+ (s_alpha_base): Ditto.
+ (s_alpha_align): Ditto.
+ (s_alpha_arch): Ditto.
+ (alpha_align): Ditto.
+ (assemble_insn): Suppress unused variable warning.
+ (emit_insn): Ditto.
+ (assemble_insn): Don't assume X_op and X_unsigned are in a given
+ order in the structure.
+ (s_alpha_coff_wrapper): Avoid int/unsigned comparison.
+
Sun Oct 17 17:15:58 1999 Jeffrey A Law (law@cygnus.com)
* config/tc-hppa.c (md_apply_fix): Make "fmt" an int.
enum alpha_macro_arg argsets[16];
};
-/* Two extra symbols we want to see in our input. This is a blatent
- misuse of the expressionS.X_op field. */
+/* Extra expression types. */
-#define O_pregister ((operatorT) (O_max+1)) /* O_register, in parentheses */
-#define O_cpregister ((operatorT) (O_pregister+1)) /* + a leading comma */
-#define O_alpha_max ((operatorT) (O_cpregister+1))
+#define O_pregister O_md1 /* O_register, in parentheses */
+#define O_cpregister O_md2 /* + a leading comma */
/* Macros for extracting the type and number of encoded register tokens */
{ "ev6", AXP_OPCODE_BASE|AXP_OPCODE_BWX|AXP_OPCODE_MAX|AXP_OPCODE_CIX },
{ "all", AXP_OPCODE_BASE },
- { 0 }
+ { 0, 0 }
};
/* The macro table */
MACRO_EOA } },
};
-static const int alpha_num_macros
+static const unsigned int alpha_num_macros
= sizeof(alpha_macros) / sizeof(*alpha_macros);
\f
/* Public interface functions */
/* Verify that X_op field is wide enough. */
{
expressionS e;
- e.X_op = O_alpha_max;
- assert (e.X_op == O_alpha_max);
+ e.X_op = O_max;
+ assert (e.X_op == O_max);
}
/* Create the opcode hash table */
{
char opname[32]; /* current maximum is 13 */
expressionS tok[MAX_INSN_ARGS];
- int ntok, opnamelen, trunclen;
+ int ntok, trunclen;
+ size_t opnamelen;
/* split off the opcode */
opnamelen = strspn (str, "abcdefghijklmnopqrstuvwxyz_/468");
as_fatal (_("unhandled relocation type %s"),
bfd_get_reloc_code_name (fixP->fx_r_type));
- assert (-(int)fixP->fx_r_type < alpha_num_operands);
+ assert (-(int)fixP->fx_r_type < (int)alpha_num_operands);
operand = &alpha_operands[-(int)fixP->fx_r_type];
/* The rest of these fixups only exist internally during symbol
return 0;
default:
- assert((int)f->fx_r_type < 0 && -(int)f->fx_r_type < alpha_num_operands);
+ assert((int)f->fx_r_type < 0 && -(int)f->fx_r_type < (int)alpha_num_operands);
return 0;
}
}
default:
assert ((int)f->fx_r_type < 0
- && - (int)f->fx_r_type < alpha_num_operands);
+ && - (int)f->fx_r_type < (int)alpha_num_operands);
return 1;
}
/*NOTREACHED*/
arelent *
tc_gen_reloc (sec, fixp)
- asection *sec;
+ asection *sec ATTRIBUTE_UNUSED;
fixS *fixp;
{
arelent *reloc;
int
tc_get_register (frame)
- int frame;
+ int frame ATTRIBUTE_UNUSED;
{
int framereg = AXP_REG_SP;
for (argidx = opcode->operands; *argidx; ++argidx)
{
const struct alpha_operand *operand = &alpha_operands[*argidx];
- const expressionS *t;
+ const expressionS *t = (const expressionS *)0;
if (operand->flags & AXP_OPERAND_FAKE)
{
break;
case AXP_OPERAND_DEFAULT_ZERO:
{
- static const expressionS zero_exp = { 0, 0, 0, O_constant, 1 };
+ static expressionS zero_exp;
t = &zero_exp;
+ zero_exp.X_op = O_constant;
+ zero_exp.X_unsigned = 1;
}
break;
default:
/* Apply the fixups in order */
for (i = 0; i < insn->nfixups; ++i)
{
- const struct alpha_operand *operand;
+ const struct alpha_operand *operand = (const struct alpha_operand *)0;
struct alpha_fixup *fixup = &insn->fixups[i];
int size, pcrel;
fixS *fixP;
static void
emit_ldgp (tok, ntok, unused)
const expressionS *tok;
- int ntok;
- const PTR unused;
+ int ntok ATTRIBUTE_UNUSED;
+ const PTR unused ATTRIBUTE_UNUSED;
{
#ifdef OBJ_AOUT
FIXME
emit_lda (tok, ntok, unused)
const expressionS *tok;
int ntok;
- const PTR unused;
+ const PTR unused ATTRIBUTE_UNUSED;
{
int basereg;
static void
emit_ldah (tok, ntok, unused)
const expressionS *tok;
- int ntok;
- const PTR unused;
+ int ntok ATTRIBUTE_UNUSED;
+ const PTR unused ATTRIBUTE_UNUSED;
{
expressionS newtok[3];
emit_ldil (tok, ntok, unused)
const expressionS *tok;
int ntok;
- const PTR unused;
+ const PTR unused ATTRIBUTE_UNUSED;
{
expressionS newtok[2];
static void
s_alpha_ent (dummy)
- int dummy;
+ int dummy ATTRIBUTE_UNUSED;
{
if (ECOFF_DEBUGGING)
ecoff_directive_ent (0);
static void
s_alpha_end (dummy)
- int dummy;
+ int dummy ATTRIBUTE_UNUSED;
{
if (ECOFF_DEBUGGING)
ecoff_directive_end (0);
static void
s_alpha_frame (dummy)
- int dummy;
+ int dummy ATTRIBUTE_UNUSED;
{
if (ECOFF_DEBUGGING)
ecoff_directive_frame (0);
static void
s_alpha_prologue (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
symbolS *sym;
int arg;
ecoff_directive_loc,
};
- assert (which >= 0 && which < sizeof(fns)/sizeof(*fns));
+ assert (which >= 0 && which < (int)(sizeof(fns)/sizeof(*fns)));
if (ECOFF_DEBUGGING)
(*fns[which])(0);
static void
s_alpha_gprel32 (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
expressionS e;
char *p;
static void
s_alpha_proc (is_static)
- int is_static;
+ int is_static ATTRIBUTE_UNUSED;
{
char *name;
char c;
static void
s_alpha_set (x)
- int x;
+ int x ATTRIBUTE_UNUSED;
{
char *name, ch, *s;
int yesno = 1;
static void
s_alpha_base (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
#if 0
if (first_32bit_quadrant)
static void
s_alpha_align (ignore)
- int ignore;
+ int ignore ATTRIBUTE_UNUSED;
{
int align;
char fill, *pfill;
static void
s_alpha_arch (ignored)
- int ignored;
+ int ignored ATTRIBUTE_UNUSED;
{
char *name, ch;
const struct cpu_type *p;
int n;
char *pfill;
symbolS *label;
- int force;
+ int force ATTRIBUTE_UNUSED;
{
if (alpha_current_align >= n)
return;
3, /* O_logical_and */
2, /* O_logical_or */
1, /* O_index */
+ 0, /* O_md1 */
+ 0, /* O_md2 */
+ 0, /* O_md3 */
+ 0, /* O_md4 */
+ 0, /* O_md5 */
+ 0, /* O_md6 */
+ 0, /* O_md7 */
+ 0, /* O_md8 */
};
/* Unfortunately, in MRI mode for the m68k, multiplication and
O_logical_or,
/* X_op_symbol [ X_add_symbol ] */
O_index,
+ /* machine dependent #1 */
+ O_md1,
+ /* machine dependent #2 */
+ O_md2,
+ /* machine dependent #3 */
+ O_md3,
+ /* machine dependent #4 */
+ O_md4,
+ /* machine dependent #5 */
+ O_md5,
+ /* machine dependent #6 */
+ O_md6,
+ /* machine dependent #7 */
+ O_md7,
+ /* machine dependent #8 */
+ O_md8,
/* this must be the largest value */
O_max
} operatorT;
symbolS *X_op_symbol;
/* A number to add. */
offsetT X_add_number;
+
/* The type of the expression. We can't assume that an arbitrary
compiler can handle a bitfield of enum type. FIXME: We could
check this using autoconf. */
#ifdef __GNUC__
- operatorT X_op : 7;
+ operatorT X_op : 8;
#else
- unsigned X_op : 7;
+ unsigned char X_op;
#endif
+
/* Non-zero if X_add_number should be regarded as unsigned. This is
only valid for O_constant expressions. It is only used when an
O_constant must be extended into a bignum (i.e., it is not used
when performing arithmetic on these values).
FIXME: This field is not set very reliably. */
unsigned int X_unsigned : 1;
+
+ /* 7 additional bits can be defined if needed. */
+
+ /* Machine dependent field */
+ unsigned short X_md;
} expressionS;
/* "result" should be type (expressionS *). */
+1999-10-18 Michael Meissner <meissner@cygnus.com>
+
+ * alpha.h (alpha_num_opcodes): Convert to unsigned.
+ (alpha_num_operands): Ditto.
+
Sun Oct 10 01:46:56 1999 Jerry Quinn <jerry.quinn.adv91@alum.dartmouth.org>
* hppa.h (pa_opcodes): Add load and store cache control to
in the order in which the disassembler should consider
instructions. */
extern const struct alpha_opcode alpha_opcodes[];
-extern const int alpha_num_opcodes;
+extern const unsigned alpha_num_opcodes;
/* Values defined for the flags field of a struct alpha_opcode. */
the operands field of the alpha_opcodes table. */
extern const struct alpha_operand alpha_operands[];
-extern const int alpha_num_operands;
+extern const unsigned alpha_num_operands;
/* Values defined for the flags field of a struct alpha_operand. */
+1999-10-18 Michael Meissner <meissner@cygnus.com>
+
+ * alpha-opc.c (alpha_operands): Fill in missing initializer.
+ (alpha_num_operands): Convert to unsigned.
+ (alpha_num_opcodes): Ditto.
+ (insert_rba): Declare unused arguments ATTRIBUTE_UNUSED.
+ (insert_rca): Ditto.
+ (insert_za): Ditto.
+ (insert_zb): Ditto.
+ (insert_zc): Ditto.
+ (extract_bdisp): Ditto.
+ (extract_jhint): Ditto.
+ (extract_ev6hwjhint): Ditto.
+
Sun Oct 10 01:48:01 1999 Jerry Quinn <jerry.quinn.adv91@alum.dartmouth.org>
* hppa-dis.c (print_insn_hppa): Add new codes 'cc', 'cd', 'cC',
/* The fields are bits, shift, insert, extract, flags */
/* The zero index is used to indicate end-of-list */
#define UNUSED 0
- { 0, 0, 0, 0, 0 },
+ { 0, 0, 0, 0, 0, 0 },
/* The plain integer register fields */
#define RA (UNUSED + 1)
insert_ev6hwjhint, extract_ev6hwjhint }
};
-const int alpha_num_operands = sizeof(alpha_operands)/sizeof(*alpha_operands);
+const unsigned alpha_num_operands = sizeof(alpha_operands)/sizeof(*alpha_operands);
/* The RB field when it is the same as the RA field in the same insn.
This operand is marked fake. The insertion function just copies
static unsigned
insert_rba(insn, value, errmsg)
unsigned insn;
- int value;
- const char **errmsg;
+ int value ATTRIBUTE_UNUSED;
+ const char **errmsg ATTRIBUTE_UNUSED;
{
return insn | (((insn >> 21) & 0x1f) << 16);
}
static unsigned
insert_rca(insn, value, errmsg)
unsigned insn;
- int value;
- const char **errmsg;
+ int value ATTRIBUTE_UNUSED;
+ const char **errmsg ATTRIBUTE_UNUSED;
{
return insn | ((insn >> 21) & 0x1f);
}
static unsigned
insert_za(insn, value, errmsg)
unsigned insn;
- int value;
- const char **errmsg;
+ int value ATTRIBUTE_UNUSED;
+ const char **errmsg ATTRIBUTE_UNUSED;
{
return insn | (31 << 21);
}
static unsigned
insert_zb(insn, value, errmsg)
unsigned insn;
- int value;
- const char **errmsg;
+ int value ATTRIBUTE_UNUSED;
+ const char **errmsg ATTRIBUTE_UNUSED;
{
return insn | (31 << 16);
}
static unsigned
insert_zc(insn, value, errmsg)
unsigned insn;
- int value;
- const char **errmsg;
+ int value ATTRIBUTE_UNUSED;
+ const char **errmsg ATTRIBUTE_UNUSED;
{
return insn | 31;
}
static int
extract_bdisp(insn, invalid)
unsigned insn;
- int *invalid;
+ int *invalid ATTRIBUTE_UNUSED;
{
return 4 * (((insn & 0x1FFFFF) ^ 0x100000) - 0x100000);
}
static int
extract_jhint(insn, invalid)
unsigned insn;
- int *invalid;
+ int *invalid ATTRIBUTE_UNUSED;
{
return 4 * (((insn & 0x3FFF) ^ 0x2000) - 0x2000);
}
static int
extract_ev6hwjhint(insn, invalid)
unsigned insn;
- int *invalid;
+ int *invalid ATTRIBUTE_UNUSED;
{
return 4 * (((insn & 0x1FFF) ^ 0x1000) - 0x1000);
}
{ "bgt", BRA(0x3F), BASE, ARG_BRA },
};
-const int alpha_num_opcodes = sizeof(alpha_opcodes)/sizeof(*alpha_opcodes);
+const unsigned alpha_num_opcodes = sizeof(alpha_opcodes)/sizeof(*alpha_opcodes);