Skip to content

Commit

Permalink
2003-05-23 Jason Eckhardt <jle@rice.edu>
Browse files Browse the repository at this point in the history
gas:
        * config/tc-i860.c (target_xp): Declare variable.
        (OPTION_XP): Declare macro.
        (md_longopts): Add option -mxp.
        (md_parse_option): Set target_xp.
        (md_show_usage): Add -mxp usage.
        (i860_process_insn): Recognize XP registers bear, ccr, p0-p3.
        (md_assemble): Don't try expansions if XP_ONLY is set.
        * doc/c-i860.texi: Document -mxp option.

gas/testsuite:
        * gas/i860/xp.s: New file.
        * gas/i860/xp.d: New file.

include/opcode:
        * i860.h (expand_type): Add XP_ONLY.
        (scyc.b): New XP instruction.
        (ldio.l): Likewise.
        (ldio.s): Likewise.
        (ldio.b): Likewise.
        (ldint.l): Likewise.
        (ldint.s): Likewise.
        (ldint.b): Likewise.
        (stio.l): Likewise.
        (stio.s): Likewise.
        (stio.b): Likewise.
        (pfld.q): Likewise.

opcodes:
        * i860-dis.c (crnames): Add bear, ccr, p0, p1, p2, p3.
        (print_insn_i860): Grab 4 bits of the control register field
        instead of 3.
  • Loading branch information
Jason Eckhardt committed May 24, 2003
1 parent 794d39c commit 9631f18
Show file tree
Hide file tree
Showing 10 changed files with 627 additions and 12 deletions.
11 changes: 11 additions & 0 deletions gas/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
2003-05-23 Jason Eckhardt <jle@rice.edu>

* config/tc-i860.c (target_xp): Declare variable.
(OPTION_XP): Declare macro.
(md_longopts): Add option -mxp.
(md_parse_option): Set target_xp.
(md_show_usage): Add -mxp usage.
(i860_process_insn): Recognize XP registers bear, ccr, p0-p3.
(md_assemble): Don't try expansions if XP_ONLY is set.
* doc/c-i860.texi: Document -mxp option and i860XP support.

2003-05-23 Eric Christopher <echristo@redhat.com>

* config/tc-mips.c (macro_build_jalr): Warning patrol.
Expand Down
57 changes: 54 additions & 3 deletions gas/config/tc-i860.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* tc-i860.c -- Assembler for the Intel i860 architecture.
Copyright 1989, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002
Copyright 1989, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
Brought back from the dead and completely reworked
Expand Down Expand Up @@ -88,6 +88,9 @@ static char last_expand;
/* If true, then warn if any pseudo operations were expanded. */
static int target_warn_expand = 0;

/* If true, then XP support is enabled. */
static int target_xp = 0;

/* Prototypes. */
static void i860_process_insn PARAMS ((char *));
static void s_dual PARAMS ((int));
Expand Down Expand Up @@ -229,7 +232,7 @@ md_assemble (str)

/* Check for expandable flag to produce pseudo-instructions. This
is an undesirable feature that should be avoided. */
if (the_insn.expand != 0
if (the_insn.expand != 0 && the_insn.expand != XP_ONLY
&& ! (the_insn.fi[0].fup & (OP_SEL_HA | OP_SEL_H | OP_SEL_L | OP_SEL_GOT
| OP_SEL_GOTOFF | OP_SEL_PLT)))
{
Expand Down Expand Up @@ -687,6 +690,43 @@ i860_process_insn (str)
s += 4;
continue;
}
/* The remaining control registers are XP only. */
if (target_xp && strncmp (s, "bear", 4) == 0)
{
opcode |= 0x6 << 21;
s += 4;
continue;
}
if (target_xp && strncmp (s, "ccr", 3) == 0)
{
opcode |= 0x7 << 21;
s += 3;
continue;
}
if (target_xp && strncmp (s, "p0", 2) == 0)
{
opcode |= 0x8 << 21;
s += 2;
continue;
}
if (target_xp && strncmp (s, "p1", 2) == 0)
{
opcode |= 0x9 << 21;
s += 2;
continue;
}
if (target_xp && strncmp (s, "p2", 2) == 0)
{
opcode |= 0xa << 21;
s += 2;
continue;
}
if (target_xp && strncmp (s, "p3", 2) == 0)
{
opcode |= 0xb << 21;
s += 2;
continue;
}
break;

/* 5-bit immediate in src1. */
Expand Down Expand Up @@ -884,6 +924,10 @@ i860_process_insn (str)
}

the_insn.opcode = opcode;

/* Only recognize XP instructions when the user has requested it. */
if (insn->expand == XP_ONLY && ! target_xp)
as_bad (_("Unknown opcode: `%s'"), insn->name);
}

static int
Expand Down Expand Up @@ -1030,11 +1074,13 @@ const char *md_shortopts = "";
#define OPTION_EB (OPTION_MD_BASE + 0)
#define OPTION_EL (OPTION_MD_BASE + 1)
#define OPTION_WARN_EXPAND (OPTION_MD_BASE + 2)
#define OPTION_XP (OPTION_MD_BASE + 3)

struct option md_longopts[] = {
{ "EB", no_argument, NULL, OPTION_EB },
{ "EL", no_argument, NULL, OPTION_EL },
{ "mwarn-expand", no_argument, NULL, OPTION_WARN_EXPAND },
{ "mxp", no_argument, NULL, OPTION_XP },
{ NULL, no_argument, NULL, 0 }
};
size_t md_longopts_size = sizeof (md_longopts);
Expand All @@ -1058,6 +1104,10 @@ md_parse_option (c, arg)
target_warn_expand = 1;
break;

case OPTION_XP:
target_xp = 1;
break;

#ifdef OBJ_ELF
/* SVR4 argument compatibility (-V): print version ID. */
case 'V':
Expand All @@ -1084,7 +1134,8 @@ md_show_usage (stream)
fprintf (stream, _("\
-EL generate code for little endian mode (default)\n\
-EB generate code for big endian mode\n\
-mwarn-expand warn if pseudo operations are expanded\n"));
-mwarn-expand warn if pseudo operations are expanded\n\
-mxp enable i860XP support (disabled by default)\n"));
#ifdef OBJ_ELF
/* SVR4 compatibility flags. */
fprintf (stream, _("\
Expand Down
8 changes: 6 additions & 2 deletions gas/doc/c-i860.texi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@c Copyright 2000 Free Software Foundation, Inc.
@c Copyright 2000, 2003 Free Software Foundation, Inc.
@c This is part of the GAS manual.
@c For copying conditions, see the file as.texinfo.
@ifset GENERIC
Expand Down Expand Up @@ -62,6 +62,10 @@ will be expanded into two instructions. This is a very undesirable feature to
rely on, so this flag can help detect any code where it happens. One
use of it, for instance, has been to find and eliminate any place
where @code{gcc} may emit these pseudo-instructions.
@item -mxp
Enable support for the i860XP instructions and control registers. By default,
this option is disabled so that only the base instruction set (i.e., i860XR)
is supported.
@end table

@node Directives-i860
Expand Down Expand Up @@ -98,7 +102,7 @@ default register is @code{r31}.

@cindex opcodes, i860
@cindex i860 opcodes
All of the Intel i860 machine instructions are supported. Please see
All of the Intel i860XR and i860XP machine instructions are supported. Please see
either @emph{i860 Microprocessor Programmer's Reference Manual} or @emph{i860 Microprocessor Architecture} for more information.
@subsection Other instruction support (pseudo-instructions)
For compatibility with some other i860 assemblers, a number of
Expand Down
5 changes: 5 additions & 0 deletions gas/testsuite/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2003-05-23 Jason Eckhardt <jle@rice.edu>

* gas/i860/xp.s: New file.
* gas/i860/xp.d: New file.

2003-05-23 Richard Earnshaw <rearnsha@arm.com>

* gas/i860/i860.exp: Don't call exit if the target isn't an i860.
Expand Down
Loading

0 comments on commit 9631f18

Please sign in to comment.