/* Assemble V850 instructions.
- Copyright (C) 1996 Free Software Foundation, Inc.
+ Copyright 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/* two-word opcodes */
#define two(x,y) ((unsigned int) (x) | ((unsigned int) (y) << 16))
+static long unsigned insert_d9 PARAMS ((long unsigned, long, const char **));
+static long unsigned extract_d9 PARAMS ((long unsigned, int *));
+static long unsigned insert_d22 PARAMS ((long unsigned, long, const char **));
+static long unsigned extract_d22 PARAMS ((long unsigned, int *));
+static long unsigned insert_d16_15 PARAMS ((long unsigned, long, const char **));
+static long unsigned extract_d16_15 PARAMS ((long unsigned, int *));
+static long unsigned insert_d8_7 PARAMS ((long unsigned, long, const char **));
+static long unsigned extract_d8_7 PARAMS ((long unsigned, int *));
+static long unsigned insert_d8_6 PARAMS ((long unsigned, long, const char **));
+static long unsigned extract_d8_6 PARAMS ((long unsigned, int *));
+static long unsigned insert_d5_4 PARAMS ((long unsigned, long, const char **));
+static long unsigned extract_d5_4 PARAMS ((long unsigned, int *));
+static long unsigned insert_d16_16 PARAMS ((long unsigned, long, const char **));
+static long unsigned extract_d16_16 PARAMS ((long unsigned, int *));
+static long unsigned insert_i9 PARAMS ((long unsigned, long, const char **));
+static long unsigned extract_i9 PARAMS ((long unsigned, int *));
+static long unsigned insert_u9 PARAMS ((long unsigned, long, const char **));
+static long unsigned extract_u9 PARAMS ((long unsigned, int *));
+static long unsigned insert_spe PARAMS ((long unsigned, long, const char **));
+static long unsigned extract_spe PARAMS ((long unsigned, int *));
+static long unsigned insert_i5div PARAMS ((long unsigned, long, const char **));
+static long unsigned extract_i5div PARAMS ((long unsigned, int *));
\f
/* The functions used to insert and extract complicated operands. */
static unsigned long
extract_d9 (insn, invalid)
unsigned long insn;
- int * invalid;
+ int * invalid ATTRIBUTE_UNUSED;
{
unsigned long ret = ((insn & 0xf800) >> 7) | ((insn & 0x0070) >> 3);
static unsigned long
extract_d22 (insn, invalid)
unsigned long insn;
- int * invalid;
+ int * invalid ATTRIBUTE_UNUSED;
{
signed long ret = ((insn & 0xfffe0000) >> 16) | ((insn & 0x3f) << 16);
static unsigned long
extract_d16_15 (insn, invalid)
unsigned long insn;
- int * invalid;
+ int * invalid ATTRIBUTE_UNUSED;
{
signed long ret = (insn & 0xfffe0000);
static unsigned long
extract_d8_7 (insn, invalid)
unsigned long insn;
- int * invalid;
+ int * invalid ATTRIBUTE_UNUSED;
{
unsigned long ret = (insn & 0x7f);
static unsigned long
extract_d8_6 (insn, invalid)
unsigned long insn;
- int * invalid;
+ int * invalid ATTRIBUTE_UNUSED;
{
unsigned long ret = (insn & 0x7e);
static unsigned long
extract_d5_4 (insn, invalid)
unsigned long insn;
- int * invalid;
+ int * invalid ATTRIBUTE_UNUSED;
{
unsigned long ret = (insn & 0x0f);
static unsigned long
extract_d16_16 (insn, invalid)
unsigned long insn;
- int * invalid;
+ int * invalid ATTRIBUTE_UNUSED;
{
signed long ret = insn & 0xfffe0000;
static unsigned long
extract_i9 (insn, invalid)
unsigned long insn;
- int * invalid;
+ int * invalid ATTRIBUTE_UNUSED;
{
signed long ret = insn & 0x003c0000;
}
static unsigned long
-insert_u9 (insn, value, errmsg)
+insert_u9 (insn, v, errmsg)
unsigned long insn;
- unsigned long value;
+ long v;
const char ** errmsg;
{
+ unsigned long value = (unsigned long) v;
if (value > 0x1ff)
* errmsg = _(immediate_out_of_range);
static unsigned long
extract_u9 (insn, invalid)
unsigned long insn;
- int * invalid;
+ int * invalid ATTRIBUTE_UNUSED;
{
unsigned long ret = insn & 0x003c0000;
}
static unsigned long
-insert_spe (insn, value, errmsg)
+insert_spe (insn, v, errmsg)
unsigned long insn;
- unsigned long value;
+ long v;
const char ** errmsg;
{
+ unsigned long value = (unsigned long) v;
+
if (value != 3)
* errmsg = _("invalid register for stack adjustment");
static unsigned long
extract_spe (insn, invalid)
- unsigned long insn;
- int * invalid;
+ unsigned long insn ATTRIBUTE_UNUSED;
+ int * invalid ATTRIBUTE_UNUSED;
{
return 3;
}
static unsigned long
-insert_i5div (insn, value, errmsg)
+insert_i5div (insn, v, errmsg)
unsigned long insn;
- unsigned long value;
+ long v;
const char ** errmsg;
{
+ unsigned long value = (unsigned long) v;
+
if (value > 0x1ff)
{
if (value & 1)
static unsigned long
extract_i5div (insn, invalid)
unsigned long insn;
- int * invalid;
+ int * invalid ATTRIBUTE_UNUSED;
{
unsigned long ret = insn & 0x3c0000;
\f
/* Warning: code in gas/config/tc-v850.c examines the contents of this array.
If you change any of the values here, be sure to look for side effects in
- that code. */
+ that code. */
const struct v850_operand v850_operands[] =
{
#define UNUSED 0
{ "jmp", one (0x0060), one (0xffe0), {R1}, 1, PROCESSOR_ALL },
/* load/store instructions */
-{ "sld.bu", one (0x0300), one (0x0780), {D7, EP, R2_NOTR0}, 1, PROCESSOR_V850EA },
{ "sld.bu", one (0x0060), one (0x07f0), {D4, EP, R2_NOTR0}, 1, PROCESSOR_V850E },
-{ "sld.hu", one (0x0400), one (0x0780), {D8_7, EP, R2_NOTR0}, 1, PROCESSOR_V850EA },
{ "sld.hu", one (0x0070), one (0x07f0), {D5_4, EP, R2_NOTR0}, 1, PROCESSOR_V850E },
-{ "sld.b", one (0x0060), one (0x07f0), {D4, EP, R2}, 1, PROCESSOR_V850EA },
{ "sld.b", one (0x0300), one (0x0780), {D7, EP, R2}, 1, PROCESSOR_V850E },
{ "sld.b", one (0x0300), one (0x0780), {D7, EP, R2}, 1, PROCESSOR_V850 },
-{ "sld.h", one (0x0070), one (0x07f0), {D5_4, EP, R2}, 1, PROCESSOR_V850EA },
{ "sld.h", one (0x0400), one (0x0780), {D8_7, EP, R2}, 1, PROCESSOR_V850E },
{ "sld.h", one (0x0400), one (0x0780), {D8_7, EP, R2}, 1, PROCESSOR_V850 },
{ "sld.w", one (0x0500), one (0x0781), {D8_6, EP, R2}, 1, PROCESSOR_ALL },
{ "sst.h", one (0x0480), one (0x0780), {R2, D8_7, EP}, 2, PROCESSOR_ALL },
{ "sst.w", one (0x0501), one (0x0781), {R2, D8_6, EP}, 2, PROCESSOR_ALL },
-{ "pushml", two (0x07e0, 0x0001), two (0xfff0, 0x0007), {LIST18_L}, 0, PROCESSOR_V850EA },
-{ "pushmh", two (0x07e0, 0x0003), two (0xfff0, 0x0007), {LIST18_H}, 0, PROCESSOR_V850EA },
-{ "popml", two (0x07f0, 0x0001), two (0xfff0, 0x0007), {LIST18_L}, 0, PROCESSOR_V850EA },
-{ "popmh", two (0x07f0, 0x0003), two (0xfff0, 0x0007), {LIST18_H}, 0, PROCESSOR_V850EA },
{ "prepare", two (0x0780, 0x0003), two (0xffc0, 0x001f), {LIST12, IMM5, SP}, 0, PROCESSOR_NOT_V850 },
{ "prepare", two (0x0780, 0x000b), two (0xffc0, 0x001f), {LIST12, IMM5, IMM16}, 0, PROCESSOR_NOT_V850 },
{ "prepare", two (0x0780, 0x0013), two (0xffc0, 0x001f), {LIST12, IMM5, IMM16}, 0, PROCESSOR_NOT_V850 },
{ "divh", two (0x07e0, 0x0280), two (0x07e0, 0x07ff), {R1, R2, R3}, 0, PROCESSOR_NOT_V850 },
{ "divh", OP (0x02), OP_MASK, {R1, R2_NOTR0}, 0, PROCESSOR_ALL },
-{ "divhn", two (0x07e0, 0x0280), two (0x07e0, 0x07c3), {I5DIV, R1, R2, R3}, 0, PROCESSOR_V850EA },
-{ "divhun", two (0x07e0, 0x0282), two (0x07e0, 0x07c3), {I5DIV, R1, R2, R3}, 0, PROCESSOR_V850EA },
-{ "divn", two (0x07e0, 0x02c0), two (0x07e0, 0x07c3), {I5DIV, R1, R2, R3}, 0, PROCESSOR_V850EA },
-{ "divun", two (0x07e0, 0x02c2), two (0x07e0, 0x07c3), {I5DIV, R1, R2, R3}, 0, PROCESSOR_V850EA },
-{ "sdivhn", two (0x07e0, 0x0180), two (0x07e0, 0x07c3), {I5DIV, R1, R2, R3}, 0, PROCESSOR_V850EA },
-{ "sdivhun", two (0x07e0, 0x0182), two (0x07e0, 0x07c3), {I5DIV, R1, R2, R3}, 0, PROCESSOR_V850EA },
-{ "sdivn", two (0x07e0, 0x01c0), two (0x07e0, 0x07c3), {I5DIV, R1, R2, R3}, 0, PROCESSOR_V850EA },
-{ "sdivun", two (0x07e0, 0x01c2), two (0x07e0, 0x07c3), {I5DIV, R1, R2, R3}, 0, PROCESSOR_V850EA },
-
{ "nop", one (0x00), one (0xffff), {0}, 0, PROCESSOR_ALL },
{ "mov", OP (0x10), OP_MASK, {I5, R2_NOTR0}, 0, PROCESSOR_ALL },
{ "mov", one (0x0620), one (0xffe0), {IMM32, R1_NOTR0}, 0, PROCESSOR_NOT_V850 },