public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* h8300 assembler rejects upper-case letters after slash
@ 2003-07-15 19:53 Alexandre Oliva
  2003-07-16  5:43 ` Alan Modra
  2003-07-21  4:23 ` Alexandre Oliva
  0 siblings, 2 replies; 8+ messages in thread
From: Alexandre Oliva @ 2003-07-15 19:53 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 398 bytes --]

Even though the assembler is supposed to be case-insensitive as far as
opcodes are concerned, the fact that `/' is not a character that can
be part of a symbol gets the generic code to stop lower-casing the
opcode at the slash.  This patch introduces machine-specific code to
lower-case whatever opcode characters appear after a slash, as well as
the size character after the dot.  Ok to install?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: h8sx-lower-after-slash.patch --]
[-- Type: text/x-patch, Size: 1321 bytes --]

Index: gas/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* config/tc-h8300.c (md_assemble): Make sure characters after
	slash and dot are lower-case.

Index: gas/config/tc-h8300.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-h8300.c,v
retrieving revision 1.34
diff -u -p -r1.34 tc-h8300.c
--- gas/config/tc-h8300.c 7 Jul 2003 09:33:01 -0000 1.34
+++ gas/config/tc-h8300.c 15 Jul 2003 19:45:27 -0000
@@ -1889,6 +1889,7 @@ md_assemble (str)
   const struct h8_instruction *prev_instruction;
 
   char *dot = 0;
+  char *slash = 0;
   char c;
   int size, i;
 
@@ -1908,6 +1909,8 @@ md_assemble (str)
 	  op_end += 2;
 	  break;
 	}
+      else if (*op_end == '/' && ! slash)
+	slash = op_end;
     }
 
   if (op_end == op_start)
@@ -1918,6 +1921,12 @@ md_assemble (str)
 
   *op_end = 0;
 
+  /* The assembler stops scanning the opcode at slashes, so it fails
+     to make characters following them lower case.  Fix them.  */
+  if (slash)
+    while (*++slash)
+      *slash = TOLOWER (*slash);
+
   instruction = (const struct h8_instruction *)
     hash_find (opcode_hash_control, op_start);
 
@@ -1950,7 +1959,7 @@ md_assemble (str)
   size = SN;
   if (dot)
     {
-      switch (*dot)
+      switch (TOLOWER (*dot))
 	{
 	case 'b':
 	  size = SB;

[-- Attachment #3: Type: text/plain, Size: 289 bytes --]


-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: h8300 assembler rejects upper-case letters after slash
  2003-07-15 19:53 h8300 assembler rejects upper-case letters after slash Alexandre Oliva
@ 2003-07-16  5:43 ` Alan Modra
  2003-07-16  5:53   ` Alexandre Oliva
  2003-07-21  4:23 ` Alexandre Oliva
  1 sibling, 1 reply; 8+ messages in thread
From: Alan Modra @ 2003-07-16  5:43 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: binutils

On Tue, Jul 15, 2003 at 04:53:05PM -0300, Alexandre Oliva wrote:
> Even though the assembler is supposed to be case-insensitive as far as
> opcodes are concerned, the fact that `/' is not a character that can
> be part of a symbol gets the generic code to stop lower-casing the
> opcode at the slash.  This patch introduces machine-specific code to
> lower-case whatever opcode characters appear after a slash, as well as
> the size character after the dot.  Ok to install?

Did you consider fixing lex_type for h8300?  Of course, if `/' can't
appear in symbol names then that wouldn't be such a good idea.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: h8300 assembler rejects upper-case letters after slash
  2003-07-16  5:43 ` Alan Modra
@ 2003-07-16  5:53   ` Alexandre Oliva
  2003-07-16  6:02     ` Alan Modra
  0 siblings, 1 reply; 8+ messages in thread
From: Alexandre Oliva @ 2003-07-16  5:53 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils

On Jul 16, 2003, Alan Modra <amodra@bigpond.net.au> wrote:

> Did you consider fixing lex_type for h8300?

Yup.

> Of course, if `/' can't appear in symbol names then that wouldn't be
> such a good idea.

It can't.  Since `/' is the division operator, it can (presumably)
appear in expressions.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: h8300 assembler rejects upper-case letters after slash
  2003-07-16  5:53   ` Alexandre Oliva
@ 2003-07-16  6:02     ` Alan Modra
  0 siblings, 0 replies; 8+ messages in thread
From: Alan Modra @ 2003-07-16  6:02 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: binutils

On Wed, Jul 16, 2003 at 02:53:15AM -0300, Alexandre Oliva wrote:
> On Jul 16, 2003, Alan Modra <amodra@bigpond.net.au> wrote:
> 
> > Did you consider fixing lex_type for h8300?
> 
> Yup.
> 
> > Of course, if `/' can't appear in symbol names then that wouldn't be
> > such a good idea.
> 
> It can't.  Since `/' is the division operator, it can (presumably)
> appear in expressions.

OK then..

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: h8300 assembler rejects upper-case letters after slash
  2003-07-15 19:53 h8300 assembler rejects upper-case letters after slash Alexandre Oliva
  2003-07-16  5:43 ` Alan Modra
@ 2003-07-21  4:23 ` Alexandre Oliva
  2003-07-21  9:03   ` Nick Clifton
  1 sibling, 1 reply; 8+ messages in thread
From: Alexandre Oliva @ 2003-07-21  4:23 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 300 bytes --]

On Jul 15, 2003, Alexandre Oliva <aoliva@redhat.com> wrote:

> Index: gas/ChangeLog
> from  Alexandre Oliva  <aoliva@redhat.com>

> 	* config/tc-h8300.c (md_assemble): Make sure characters after
> 	slash and dot are lower-case.

Ping?


Here's one more, that fixes bsr/bc and bsr/bs to labels.  Ok?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: h8sx-bsrbsbc.patch --]
[-- Type: text/x-patch, Size: 1001 bytes --]

Index: gas/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* config/tc-h8300.c (get_specific): No PCREL8 encoding for bsr/bc
	or bsr/bs.

Index: gas/config/tc-h8300.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-h8300.c,v
retrieving revision 1.34
diff -u -p -r1.34 tc-h8300.c
--- gas/config/tc-h8300.c 7 Jul 2003 09:33:01 -0000 1.34
+++ gas/config/tc-h8300.c 21 Jul 2003 04:20:10 -0000
@@ -1197,9 +1197,11 @@ get_specific (instruction, operands, siz
 		}
 	      else if (op_mode == PCREL && op_mode == x_mode)
 		{
-		  /* movsd only comes in PCREL16 flavour:
+		  /* movsd, bsr/bc and bsr/bs only come in PCREL16 flavour:
 		     If x_size is L_8, promote it.  */
-		  if (OP_KIND (this_try->opcode->how) == O_MOVSD)
+		  if (OP_KIND (this_try->opcode->how) == O_MOVSD
+		      || OP_KIND (this_try->opcode->how) == O_BSRBC
+		      || OP_KIND (this_try->opcode->how) == O_BSRBS)
 		    if (x_size == L_8)
 		      x_size = L_16;
 

[-- Attachment #3: Type: text/plain, Size: 289 bytes --]


-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: h8300 assembler rejects upper-case letters after slash
  2003-07-21  4:23 ` Alexandre Oliva
@ 2003-07-21  9:03   ` Nick Clifton
  2003-07-21 17:30     ` Alexandre Oliva
  0 siblings, 1 reply; 8+ messages in thread
From: Nick Clifton @ 2003-07-21  9:03 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: binutils

Hi Alex,

> Ping?

pong :-)

> from  Alexandre Oliva  <aoliva@redhat.com>
>
> 	* config/tc-h8300.c (get_specific): No PCREL8 encoding for bsr/bc
> 	or bsr/bs.

Approved - please apply.

Cheers
        Nick
        

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: h8300 assembler rejects upper-case letters after slash
  2003-07-21  9:03   ` Nick Clifton
@ 2003-07-21 17:30     ` Alexandre Oliva
  2003-07-21 17:36       ` Nick Clifton
  0 siblings, 1 reply; 8+ messages in thread
From: Alexandre Oliva @ 2003-07-21 17:30 UTC (permalink / raw)
  To: Nick Clifton; +Cc: binutils

On Jul 21, 2003, Nick Clifton <nickc@redhat.com> wrote:

> Hi Alex,
>> Ping?

> pong :-)

>> from  Alexandre Oliva  <aoliva@redhat.com>
>> 
>> * config/tc-h8300.c (get_specific): No PCREL8 encoding for bsr/bc
>> or bsr/bs.

> Approved - please apply.

How about the other (that was the topic of the ping), posted on Jul 15?

	* config/tc-h8300.c (md_assemble): Make sure characters after
	slash and dot are lower-case.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: h8300 assembler rejects upper-case letters after slash
  2003-07-21 17:30     ` Alexandre Oliva
@ 2003-07-21 17:36       ` Nick Clifton
  0 siblings, 0 replies; 8+ messages in thread
From: Nick Clifton @ 2003-07-21 17:36 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: binutils

Hi Alex,

> How about the other (that was the topic of the ping), posted on Jul 15?

Sorry - I meant to OK that one too...

> 	* config/tc-h8300.c (md_assemble): Make sure characters after
> 	slash and dot are lower-case.

Approved - please apply.

Cheers
        Nick
        

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-07-21 17:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-15 19:53 h8300 assembler rejects upper-case letters after slash Alexandre Oliva
2003-07-16  5:43 ` Alan Modra
2003-07-16  5:53   ` Alexandre Oliva
2003-07-16  6:02     ` Alan Modra
2003-07-21  4:23 ` Alexandre Oliva
2003-07-21  9:03   ` Nick Clifton
2003-07-21 17:30     ` Alexandre Oliva
2003-07-21 17:36       ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).