From f28e8eb3fd8ab61a0c02b2d9a938a1400cf3bf25 Mon Sep 17 00:00:00 2001 From: Timothy Wall Date: Thu, 10 Feb 2000 21:00:10 +0000 Subject: [PATCH] New preprocessor options. --- gas/ChangeLog | 8 ++++++++ gas/app.c | 28 +++++++++++++++++++++++++--- gas/doc/internals.texi | 20 ++++++++++++++++++++ 3 files changed, 53 insertions(+), 3 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 171a277964..537f7025d9 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,11 @@ +2000-02-10 Timothy Wall + + * app.c (do_scrub_chars): Handle "||" for parallel instructions + when DOUBLEBAR_PARALLEL is defined. Avoid stripping whitespace + around colons when KEEP_WHITE_AROUND_COLON is defined. + * doc/internals.texi (CPU backend): Document DOUBLEBAR_PARALLEL + and KEEP_WHITE_AROUND_COLON. + 2000-02-08 Timothy Wall * read.c (s_rept): Call do_repeat, which abstracts the repeat diff --git a/gas/app.c b/gas/app.c index 73d579dfe5..68336d2e8c 100644 --- a/gas/app.c +++ b/gas/app.c @@ -68,6 +68,9 @@ static const char symbol_chars[] = #define LEX_IS_DOUBLEDASH_1ST 12 #endif #ifdef TC_M32R +#define DOUBLEBAR_PARALLEL +#endif +#ifdef DOUBLEBAR_PARALLEL #define LEX_IS_DOUBLEBAR_1ST 13 #endif #define IS_SYMBOL_COMPONENT(c) (lex[c] == LEX_IS_SYMBOL_COMPONENT) @@ -174,7 +177,7 @@ do_scrub_begin (m68k_mri) #ifdef TC_V850 lex['-'] = LEX_IS_DOUBLEDASH_1ST; #endif -#ifdef TC_M32R +#ifdef DOUBLEBAR_PARALLEL lex['|'] = LEX_IS_DOUBLEBAR_1ST; #endif #ifdef TC_D30V @@ -351,7 +354,7 @@ do_scrub_chars (get, tostart, tolen) #ifdef TC_V850 12: After seeing a dash, looking for a second dash as a start of comment. #endif -#ifdef TC_M32R +#ifdef DOUBLEBAR_PARALLEL 13: After seeing a vertical bar, looking for a second vertical bar as a parallel expression seperator. #endif */ @@ -761,6 +764,21 @@ do_scrub_chars (get, tostart, tolen) break; } +#ifdef KEEP_WHITE_AROUND_COLON + if (lex[ch] == LEX_IS_COLON) + { + /* only keep this white if there's no white *after* the colon */ + ch2 = GET (); + UNGET (ch2); + if (!IS_WHITESPACE (ch2)) + { + state = 9; + UNGET (ch); + PUT (' '); + break; + } + } +#endif if (IS_COMMENT (ch) || ch == '/' || IS_LINE_SEPARATOR (ch)) @@ -970,10 +988,14 @@ do_scrub_chars (get, tostart, tolen) #endif case LEX_IS_COLON: +#ifdef KEEP_WHITE_AROUND_COLON + state = 9; +#else if (state == 9 || state == 10) state = 3; else if (state != 3) state = 1; +#endif PUT (ch); break; @@ -1013,7 +1035,7 @@ do_scrub_chars (get, tostart, tolen) PUT ('\n'); break; #endif -#ifdef TC_M32R +#ifdef DOUBLEBAR_PARALLEL case LEX_IS_DOUBLEBAR_1ST: ch2 = GET(); if (ch2 != '|') diff --git a/gas/doc/internals.texi b/gas/doc/internals.texi index dfc2d3af72..0e2cbd3779 100644 --- a/gas/doc/internals.texi +++ b/gas/doc/internals.texi @@ -994,6 +994,11 @@ is a label, even if it does not have a colon. You may define this macro to control what GAS considers to be a label. The default definition is to accept any name followed by a colon character. +@item TC_START_LABEL_WITHOUT_COLON +@cindex TC_START_LABEL_WITHOUT_COLON +Same as TC_START_LABEL, but should be used instead of TC_START_LABEL when +LABELS_WITHOUT_COLONS is defined. + @item NO_PSEUDO_DOT @cindex NO_PSEUDO_DOT If you define this macro, GAS will not require pseudo-ops to start with a @@ -1224,6 +1229,21 @@ If you define this macro, GAS will call it each time a label is defined. GAS will call this function for each section at the end of the assembly, to permit the CPU backend to adjust the alignment of a section. +@item DOUBLEBAR_PARALLEL +@cindex DOUBLEBAR_PARALLEL +Affects the preprocessor so that lines containing '||' don't have their +whitespace stripped following the double bar. This is useful for targets that +implement parallel instructions. + +@item KEEP_WHITE_AROUND_COLON +@cindex KEEP_WHITE_AROUND_COLON +Normally, whitespace is compressed and removed when, in the presence of the +colon, the adjoining tokens can be distinguished. This option affects the +preprocessor so that whitespace around colons is preserved. This is useful +when colons might be removed from the input after preprocessing but before +assembling, so that adjoining tokens can still be distinguished if there is +whitespace, or concatentated if there is not. + @item tc_frob_section @cindex tc_frob_section If you define this macro, a @code{BFD_ASSEMBLER} GAS will call it for each -- 2.34.1