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]

[patch][rfa]: gas/app.c -- Add parallel insn separator capability


Hi,

Some new ISA's have parallel insn execution with the insns specified on 
the same assembler line separated by a special character. e.g.

   insn1    r1,r2;    insn2 (r3)0,r4

where, in this case, a semicolon is used to separate the insns. The 
scrubber pass needs to know about this so that it does not remove the 
whitespace after the second insn mnemonic. This patch adds this 
capability when tc_parallel_separator_chars is defined in the 
gas/config/tc-<target>.h to reference an array containing the characters 
to be used as the separator. It is handled the same as the current 
line_separator_chars except that the scrubber moves to state 1 (after 
the label has been seen) instead of state 0 (begining of the line).

OK to commit?

Dave
2001-07-24  Dave Brolley  <brolley@redhat.com>

	* app.c (LEX_IS_PARALLEL_SEPARATOR): New macro.
	(IS_PARALLEL_SEPARATOR): New macro.
	(do_scrub_begin): Set up characters in tc_parallel_separator_chars
	as LEX_IS_PARALLEL_SEPARATOR, if it is defined.
	(do_scrub_chars): Handle LEX_PARALLEL_SEPARATOR chars like
	LEX_LINE_SEPARATOR except that we go to state 1 (as if the label has
	been seen).

Index: gas/app.c
===================================================================
RCS file: /cvs/src/src/gas/app.c,v
retrieving revision 1.14
diff -c -p -r1.14 app.c
*** gas/app.c	2001/03/08 23:24:21	1.14
--- gas/app.c	2001/07/24 22:33:26
*************** static const char symbol_chars[] =
*** 78,86 ****
--- 78,88 ----
  #ifdef DOUBLEBAR_PARALLEL
  #define LEX_IS_DOUBLEBAR_1ST		13
  #endif
+ #define LEX_IS_PARALLEL_SEPARATOR	14
  #define IS_SYMBOL_COMPONENT(c)		(lex[c] == LEX_IS_SYMBOL_COMPONENT)
  #define IS_WHITESPACE(c)		(lex[c] == LEX_IS_WHITESPACE)
  #define IS_LINE_SEPARATOR(c)		(lex[c] == LEX_IS_LINE_SEPARATOR)
+ #define IS_PARALLEL_SEPARATOR(c)	(lex[c] == LEX_IS_PARALLEL_SEPARATOR)
  #define IS_COMMENT(c)			(lex[c] == LEX_IS_COMMENT_START)
  #define IS_LINE_COMMENT(c)		(lex[c] == LEX_IS_LINE_COMMENT_START)
  #define	IS_NEWLINE(c)			(lex[c] == LEX_IS_NEWLINE)
*************** do_scrub_begin (m68k_mri)
*** 164,169 ****
--- 166,180 ----
        lex[(unsigned char) *p] = LEX_IS_LINE_SEPARATOR;
      }				/* declare line separators */
  
+ #ifdef tc_parallel_separator_chars
+   /* This macro permits the processor to specify all characters which
+      separate parallel insns on the same line.  */
+   for (p = tc_parallel_separator_chars; *p; p++)
+     {
+       lex[(unsigned char) *p] = LEX_IS_PARALLEL_SEPARATOR;
+     }				/* declare parallel separators */
+ #endif
+ 
    /* Only allow slash-star comments if slash is not in use.
       FIXME: This isn't right.  We should always permit them.  */
    if (lex['/'] == 0)
*************** do_scrub_chars (get, tostart, tolen)
*** 796,802 ****
  #endif
  	  if (IS_COMMENT (ch)
  	      || ch == '/'
! 	      || IS_LINE_SEPARATOR (ch))
  	    {
  	      if (scrub_m68k_mri)
  		{
--- 807,814 ----
  #endif
  	  if (IS_COMMENT (ch)
  	      || ch == '/'
! 	      || IS_LINE_SEPARATOR (ch)
! 	      || IS_PARALLEL_SEPARATOR (ch))
  	    {
  	      if (scrub_m68k_mri)
  		{
*************** do_scrub_chars (get, tostart, tolen)
*** 1036,1041 ****
--- 1048,1058 ----
  
  	case LEX_IS_LINE_SEPARATOR:
  	  state = 0;
+ 	  PUT (ch);
+ 	  break;
+ 
+ 	case LEX_IS_PARALLEL_SEPARATOR:
+ 	  state = 1;
  	  PUT (ch);
  	  break;
  

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