This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] better support for tic4x parallel insns


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



? 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
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]