aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>1998-05-06 18:56:08 +0000
committerRichard Henderson <rth@redhat.com>1998-05-06 18:56:08 +0000
commitdaaef8f8dfd76d2642bcf67975f749f882b05671 (patch)
tree2aa0e5f11982c5ff81718199c77306b837cbce2d /gas/config
parent6711d1ef2358c9e6b2708b61f4df1ba2bddd4f35 (diff)
downloadgdb-daaef8f8dfd76d2642bcf67975f749f882b05671.zip
gdb-daaef8f8dfd76d2642bcf67975f749f882b05671.tar.gz
gdb-daaef8f8dfd76d2642bcf67975f749f882b05671.tar.bz2
* config/tc-d30v.c (do_assemble): Accept a new parameter requesting
a short format insn. (md_assemble): Set it for explicitly packed insns. PR 14601
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-d30v.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/gas/config/tc-d30v.c b/gas/config/tc-d30v.c
index 848144d..6d5496f 100644
--- a/gas/config/tc-d30v.c
+++ b/gas/config/tc-d30v.c
@@ -102,7 +102,8 @@ static void write_long PARAMS ((struct d30v_insn *opcode, long long insn, Fixups
static void write_1_short PARAMS ((struct d30v_insn *opcode, long long insn, Fixups *fx));
static int write_2_short PARAMS ((struct d30v_insn *opcode1, long long insn1,
struct d30v_insn *opcode2, long long insn2, exec_type_enum exec_type, Fixups *fx));
-static long long do_assemble PARAMS ((char *str, struct d30v_insn *opcode));
+static long long do_assemble PARAMS ((char *str, struct d30v_insn *opcode,
+ int shortp));
static int parallel_ok PARAMS ((struct d30v_insn *opcode1, unsigned long insn1,
struct d30v_insn *opcode2, unsigned long insn2,
exec_type_enum exec_type));
@@ -224,10 +225,10 @@ void
md_show_usage (stream)
FILE *stream;
{
- fprintf(stream, (_"\nD30V options:\n\
+ fprintf(stream, (_("\nD30V options:\n\
-O Make adjacent short instructions parallel if possible.\n\
-n Warn about all NOPs inserted by the assembler.\n\
--N Warn about NOPs inserted after word multiplies.\n"));
+-N Warn about NOPs inserted after word multiplies.\n")));
}
int
@@ -1089,7 +1090,7 @@ md_assemble (str)
d30v_cleanup();
/* assemble first instruction and save it */
- prev_insn = do_assemble (str, &prev_opcode);
+ prev_insn = do_assemble (str, &prev_opcode, 1);
if (prev_insn == -1)
as_fatal (_("cannot assemble instruction "));
if (prev_opcode.form->form >= LONG)
@@ -1099,10 +1100,11 @@ md_assemble (str)
}
}
- insn = do_assemble (str, &opcode);
+ insn = do_assemble (str, &opcode,
+ (extype != EXEC_UNKNOWN || etype != EXEC_UNKNOWN));
if (insn == -1)
{
- if (extype)
+ if (extype != EXEC_UNKNOWN)
{
etype = extype;
return;
@@ -1110,10 +1112,10 @@ md_assemble (str)
as_fatal (_("cannot assemble instruction "));
}
- if (etype)
+ if (etype != EXEC_UNKNOWN)
{
extype = etype;
- etype = 0;
+ etype = EXEC_UNKNOWN;
}
/* Word multiply instructions must not be followed by either a load or a
@@ -1191,14 +1193,15 @@ md_assemble (str)
/* it returns -1 (an invalid opcode) on error */
static long long
-do_assemble (str, opcode)
+do_assemble (str, opcode, shortp)
char *str;
struct d30v_insn *opcode;
+ int shortp;
{
unsigned char *op_start, *save;
unsigned char *op_end;
char name[20];
- int cmp_hack, nlen = 0, fsize = 0;
+ int cmp_hack, nlen = 0, fsize = (shortp ? FORCE_SHORT : 0);
expressionS myops[6];
long long insn;