From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13223 invoked by alias); 18 May 2003 23:03:14 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 13104 invoked from network); 18 May 2003 23:03:12 -0000 Received: from unknown (HELO stardust.solidas.com) (217.13.28.68) by sources.redhat.com with SMTP; 18 May 2003 23:03:12 -0000 Received: from solidas.com (217-13-28-83.dd.nextgentel.com [217.13.28.83]) (authenticated) by stardust.solidas.com (8.11.6/8.11.6) with ESMTP id h4IN3Bl29214 for ; Mon, 19 May 2003 01:03:11 +0200 Message-ID: <3EC8113D.2010309@solidas.com> Date: Sun, 18 May 2003 23:03:00 -0000 From: "Svein E. Seldal" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3.1) Gecko/20030425 X-Accept-Language: en-us, en MIME-Version: 1.0 To: binutils@sources.redhat.com Subject: [patch] better support for tic4x parallel insns Content-Type: multipart/mixed; boundary="------------070706050307050006050608" X-SW-Source: 2003-05/txt/msg00524.txt.bz2 This is a multi-part message in MIME format. --------------070706050307050006050608 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 424 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 * config/tc-tic4x.c (md_assemble): Added support for one-line parallel insns. * config/tc-tic4x.h: Added DOUBLEBAR_PARALLEL definition --------------070706050307050006050608 Content-Type: text/plain; name="tic4x-parallel-fix.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="tic4x-parallel-fix.diff" Content-length: 4263 ? 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 + + * 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 * 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 --------------070706050307050006050608--