* [patch] better support for tic4x parallel insns
@ 2003-05-18 23:03 Svein E. Seldal
0 siblings, 0 replies; only message in thread
From: Svein E. Seldal @ 2003-05-18 23:03 UTC (permalink / raw)
To: binutils
[-- Attachment #1: Type: text/plain, Size: 424 bytes --]
Hi,
I've committed the following diff to HEAD and 2.14 branch. It fixes a
parallel insn problem on HEAD, and adds the option to use parallel insns
on one line of code. All for the tic4x port.
Regards,
Svein
gas/ChangeLog:
2003-05-19 Svein E. Seldal <Svein.Seldal@solidas.com>
* config/tc-tic4x.c (md_assemble): Added support for one-line parallel
insns.
* config/tc-tic4x.h: Added DOUBLEBAR_PARALLEL definition
[-- Attachment #2: tic4x-parallel-fix.diff --]
[-- Type: text/plain, Size: 4263 bytes --]
? build.tic4x
? build.tic54x
Index: gas/ChangeLog
===================================================================
RCS file: /cvs/src/src/gas/ChangeLog,v
retrieving revision 1.1746
diff -c -3 -p -r1.1746 ChangeLog
*** gas/ChangeLog 18 May 2003 21:24:32 -0000 1.1746
--- gas/ChangeLog 18 May 2003 22:21:34 -0000
***************
*** 1,3 ****
--- 1,8 ----
+ 2003-05-19 Svein E. Seldal <Svein.Seldal@solidas.com>
+
+ * config/tc-tic4x.c (md_assemble): Added support for one-line parallel insns.
+ * config/tc-tic4x.h: Added DOUBLEBAR_PARALLEL definition
+
2003-05-18 Jason Eckhardt <jle@rice.edu>
* config/tc-i860.c (i860_process_insn): Initialize fc after
Index: gas/config/tc-tic4x.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-tic4x.c,v
retrieving revision 1.7
diff -c -3 -p -r1.7 tc-tic4x.c
*** gas/config/tc-tic4x.c 4 Apr 2003 08:15:14 -0000 1.7
--- gas/config/tc-tic4x.c 18 May 2003 22:21:35 -0000
*************** md_assemble (str)
*** 2567,2593 ****
tic4x_inst_t *inst; /* Instruction template. */
tic4x_inst_t *first_inst;
if (str && insn->parallel)
{
- int star;
-
/* Find mnemonic (second part of parallel instruction). */
s = str;
/* Skip past instruction mnemonic. */
! while (*s && *s != ' ' && *s != '*')
s++;
- star = *s == '*';
if (*s) /* Null terminate for hash_find. */
*s++ = '\0'; /* and skip past null. */
strcat (insn->name, "_");
strncat (insn->name, str, TIC4X_NAME_MAX - strlen (insn->name));
- /* Kludge to overcome problems with scrubber removing
- space between mnemonic and indirect operand (starting with *)
- on second line of parallel instruction. */
- if (star)
- *--s = '*';
-
insn->operands[insn->num_operands++].mode = M_PARALLEL;
if ((i = tic4x_operands_parse
--- 2567,2610 ----
tic4x_inst_t *inst; /* Instruction template. */
tic4x_inst_t *first_inst;
+ /* Scan for parallel operators */
+ if (str)
+ {
+ s = str;
+ while (*s && *s != '|')
+ s++;
+
+ if (*s && s[1]=='|')
+ {
+ if(insn->parallel)
+ {
+ as_bad ("Parallel opcode cannot contain more than two instructions");
+ insn->parallel = 0;
+ insn->in_use = 0;
+ return;
+ }
+
+ /* Lets take care of the first part of the parallel insn */
+ *s++ = 0;
+ md_assemble(str);
+ insn->parallel = 1;
+ str = ++s;
+ /* .. and let the second run though here */
+ }
+ }
+
if (str && insn->parallel)
{
/* Find mnemonic (second part of parallel instruction). */
s = str;
/* Skip past instruction mnemonic. */
! while (*s && *s != ' ')
s++;
if (*s) /* Null terminate for hash_find. */
*s++ = '\0'; /* and skip past null. */
strcat (insn->name, "_");
strncat (insn->name, str, TIC4X_NAME_MAX - strlen (insn->name));
insn->operands[insn->num_operands++].mode = M_PARALLEL;
if ((i = tic4x_operands_parse
*************** tic4x_start_line ()
*** 3141,3147 ****
if (insn->in_use)
{
insn->parallel = 1;
! input_line_pointer += 2;
/* So line counters get bumped. */
input_line_pointer[-1] = '\n';
}
--- 3158,3165 ----
if (insn->in_use)
{
insn->parallel = 1;
! input_line_pointer ++;
! *input_line_pointer = ' ';
/* So line counters get bumped. */
input_line_pointer[-1] = '\n';
}
Index: gas/config/tc-tic4x.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-tic4x.h,v
retrieving revision 1.3
diff -c -3 -p -r1.3 tc-tic4x.h
*** gas/config/tc-tic4x.h 4 Apr 2003 08:15:14 -0000 1.3
--- gas/config/tc-tic4x.h 18 May 2003 22:21:35 -0000
***************
*** 71,76 ****
--- 71,79 ----
#define NO_RELOC 0
+ /* '||' denotes parallel instruction */
+ #define DOUBLEBAR_PARALLEL 1
+
/* Labels are not required to have a colon for a suffix. */
#define LABELS_WITHOUT_COLONS 1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-05-18 23:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-18 23:03 [patch] better support for tic4x parallel insns Svein E. Seldal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).