diff options
author | Svein Seldal <svein@dev.seldal.com> | 2003-05-18 22:23:15 +0000 |
---|---|---|
committer | Svein Seldal <svein@dev.seldal.com> | 2003-05-18 22:23:15 +0000 |
commit | a1f3c24c250bd8c4396b0d9cd34a3b78ca911e2d (patch) | |
tree | ee7933a7fe75ab8b1f0bf0591ea287406681ba94 | |
parent | b645cb172661834dbd2f7baa71d610bc52f02e47 (diff) | |
download | gdb-a1f3c24c250bd8c4396b0d9cd34a3b78ca911e2d.zip gdb-a1f3c24c250bd8c4396b0d9cd34a3b78ca911e2d.tar.gz gdb-a1f3c24c250bd8c4396b0d9cd34a3b78ca911e2d.tar.bz2 |
* config/tc-tic4x.c (md_assemble): Added support for one-line parallel insns.
(tic4x_start_line): Fixed scrub bug and added error for three-element
parallel insns.
-rw-r--r-- | gas/ChangeLog | 6 | ||||
-rw-r--r-- | gas/config/tc-tic4x.c | 45 | ||||
-rw-r--r-- | gas/config/tc-tic4x.h | 3 |
3 files changed, 43 insertions, 11 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index cf40ace..c31a747 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2003-05-19 Svein E. Seldal <Svein.Seldal@solidas.com> + + * config/tc-tic4x.c (md_assemble): Added support for one-line parallel insns. + (tic4x_start_line): Fixed scrub bug and added error for three-element + parallel insns. + 2003-05-18 Jason Eckhardt <jle@rice.edu> * config/tc-i860.c (i860_process_insn): Initialize fc after diff --git a/gas/config/tc-tic4x.c b/gas/config/tc-tic4x.c index 203fb42..09a90de 100644 --- a/gas/config/tc-tic4x.c +++ b/gas/config/tc-tic4x.c @@ -2567,27 +2567,44 @@ md_assemble (str) 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) { - int star; - /* Find mnemonic (second part of parallel instruction). */ s = str; /* Skip past instruction mnemonic. */ - while (*s && *s != ' ' && *s != '*') + while (*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 @@ -3141,13 +3158,19 @@ tic4x_start_line () if (insn->in_use) { insn->parallel = 1; - input_line_pointer += 2; + input_line_pointer ++; + *input_line_pointer = ' '; /* So line counters get bumped. */ input_line_pointer[-1] = '\n'; } + else + { + as_bad ("Parallel opcode cannot contain more than two instructions"); + } } else { + /* Write out the previous insn here */ if (insn->in_use) md_assemble (NULL); input_line_pointer = s; diff --git a/gas/config/tc-tic4x.h b/gas/config/tc-tic4x.h index 14b0683..0d6c72c 100644 --- a/gas/config/tc-tic4x.h +++ b/gas/config/tc-tic4x.h @@ -71,6 +71,9 @@ #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 |