public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* fix Xtensa assembler for prefixed rsr/xsr/wsr opcodes
@ 2006-03-13 21:52 Bob Wilson
  0 siblings, 0 replies; only message in thread
From: Bob Wilson @ 2006-03-13 21:52 UTC (permalink / raw)
  To: binutils

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

This patch fixes a stupid mistake in the Xtensa port of GAS.  If the RSR/XSR/WSR 
opcodes are used with an underscore prefix (to disable assembler 
transformation), the assembler may add an extra underscore, causing the opcodes 
not to be recognized.  Tested with an xtensa-elf target and committed on the 
mainline.

2006-03-13  Bob Wilson  <bob.wilson@acm.org>

	* config/tc-xtensa.c (xg_translate_sysreg_op): Remove has_underbar
	flag and avoid double underscore prefixes.


[-- Attachment #2: xlate-sysregs.diff --]
[-- Type: text/x-patch, Size: 1079 bytes --]

Index: config/tc-xtensa.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-xtensa.c,v
retrieving revision 1.58
diff -u -p -r1.58 tc-xtensa.c
--- config/tc-xtensa.c	6 Mar 2006 18:02:06 -0000	1.58
+++ config/tc-xtensa.c	13 Mar 2006 21:44:23 -0000
@@ -2180,14 +2180,10 @@ xg_translate_sysreg_op (char **popname, 
   char *opname, *new_opname;
   const char *sr_name;
   int is_user, is_write;
-  bfd_boolean has_underbar = FALSE;
 
   opname = *popname;
   if (*opname == '_')
-    {
-      has_underbar = TRUE;
-      opname += 1;
-    }
+    opname += 1;
   is_user = (opname[1] == 'u');
   is_write = (opname[0] == 'w');
 
@@ -2233,8 +2229,7 @@ xg_translate_sysreg_op (char **popname, 
   if (is_write && !is_user && !strcasecmp ("interrupt", sr_name))
     sr_name = "intset";
   new_opname = (char *) xmalloc (strlen (sr_name) + 6);
-  sprintf (new_opname, "%s%s.%s", (has_underbar ? "_" : ""),
-	   *popname, sr_name);
+  sprintf (new_opname, "%s.%s", *popname, sr_name);
   free (*popname);
   *popname = new_opname;
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-03-13 21:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-13 21:52 fix Xtensa assembler for prefixed rsr/xsr/wsr opcodes Bob Wilson

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).