public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Michal Ludvig <mludvig@suse.cz>
To: Hans-Peter Nilsson <hp@bitrange.com>
Cc: binutils@sources.redhat.com
Subject: Re: [RFA] CFI improvements
Date: Wed, 21 May 2003 13:18:00 -0000	[thread overview]
Message-ID: <3ECB7C88.3060601@suse.cz> (raw)
In-Reply-To: <Pine.BSF.4.44.0305201951490.77355-100000@dair.pair.com>

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

Hans-Peter Nilsson told me that:
> On Tue, 20 May 2003, Michal Ludvig wrote:
> 
>>the attached patch adds some new features to the CFI engine:
>>- register names can start with '%' as requested by GCC guys.
> 
> This should be handled by the target's tc_regname_to_dw2regnum,
> not in target-independent code.  (No creeping ix86-isms, please.)

No problem. Something like this? Should I commit it?

Michal Ludvig
-- 
* SuSE CR, s.r.o     * mludvig@suse.cz
* (+420) 296.545.373 * http://www.suse.cz

[-- Attachment #2: gas-cfi-enh1-1.diff --]
[-- Type: text/plain, Size: 2734 bytes --]

2003-05-21  Michal Ludvig  <mludvig@suse.cz>

	* dw2gencfi.c (cfi_parse_arg): Allow registers in more
	generic way. Remove special case for '%'-starting regnames.
	* config/tc-i386.c (tc_x86_regname_to_dw2regnum): Allow
	'%'-starting regnames.
	* testsuite/gas/cfi/cfi-x86_64.s: Test register names 
	starting with '%'.

Index: dw2gencfi.c
===================================================================
RCS file: /cvs/src/src/gas/dw2gencfi.c,v
retrieving revision 1.4
diff -u -p -r1.4 dw2gencfi.c
--- dw2gencfi.c	21 May 2003 11:31:07 -0000	1.4
+++ dw2gencfi.c	21 May 2003 13:13:53 -0000
@@ -151,20 +151,24 @@ cfi_parse_arg (long *param, int resolver
       retval = 1;
     }
 #ifdef tc_regname_to_dw2regnum
-  else if (resolvereg && ((is_name_beginner (*input_line_pointer))
-			   || (*input_line_pointer == '%'
-			       && is_name_beginner (*(++input_line_pointer)))))
+  else if (resolvereg)
     {
       char *name, c, *p;
 
       name = input_line_pointer;
-      c = get_symbol_end ();
-      p = input_line_pointer;
+      p = name;
+      /* Recognize end of argument.  */
+      while (*p != ',' && *p != ';' && *p != ' '
+	     && *p != '\t' && *p != '\n' && *p != '\r')
+	p++;
+      c = *p;
+      *p = 0;
 
       if ((value = tc_regname_to_dw2regnum (name)) >= 0)
 	retval = 1;
 
       *p = c;
+      input_line_pointer = p;
     }
 #endif
   else
Index: config/tc-i386.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-i386.c,v
retrieving revision 1.139
diff -u -p -r1.139 tc-i386.c
--- config/tc-i386.c	20 May 2003 07:58:06 -0000	1.139
+++ config/tc-i386.c	21 May 2003 13:13:54 -0000
@@ -6360,6 +6360,9 @@ tc_x86_regname_to_dw2regnum (const char 
       regnames_count = sizeof (regnames_32);
     }
 
+  if (*regname == '%')
+    regname ++;
+
   for (regnum = 0; regnum < regnames_count; regnum++)
     if (strcmp (regname, regnames[regnum]) == 0)
       return regnum;
Index: testsuite/gas/cfi/cfi-x86_64.s
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/cfi/cfi-x86_64.s,v
retrieving revision 1.1
diff -u -p -r1.1 cfi-x86_64.s
--- testsuite/gas/cfi/cfi-x86_64.s	20 May 2003 08:01:19 -0000	1.1
+++ testsuite/gas/cfi/cfi-x86_64.s	21 May 2003 13:13:54 -0000
@@ -35,9 +35,9 @@ func_prologue:
 	#; each instruction.
 	pushq	%rbp
 	.cfi_def_cfa_offset	16
-	.cfi_offset		rbp,-16
+	.cfi_offset		%rbp, -16
 	movq	%rsp, %rbp
-	.cfi_def_cfa_register	rbp
+	.cfi_def_cfa_register	%rbp
 
 	#; function body
 	call	func_locvars
@@ -46,7 +46,7 @@ func_prologue:
 	#; epilogue with valid CFI
 	#; (we're better than gcc :-)
 	leaveq
-	.cfi_def_cfa		rsp,8
+	.cfi_def_cfa		%rsp, 8
 	ret
 	.cfi_endproc
 

  reply	other threads:[~2003-05-21 13:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-20 12:21 Michal Ludvig
2003-05-20 12:55 ` Andreas Jaeger
2003-05-20 12:57 ` Alan Modra
2003-05-20 13:10   ` Michal Ludvig
2003-05-20 13:55   ` Michal Ludvig
2003-05-20 14:18     ` Alan Modra
2003-05-20 14:36       ` Michal Ludvig
2003-05-20 23:54 ` Hans-Peter Nilsson
2003-05-21 13:18   ` Michal Ludvig [this message]
2003-05-21 14:35     ` Hans-Peter Nilsson
2003-05-21 15:06     ` Hans-Peter Nilsson
2003-05-21 16:44       ` Michal Ludvig
2003-05-21 16:52         ` Hans-Peter Nilsson
2003-05-27 12:34         ` amodra
2003-05-27 12:42           ` Michal Ludvig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3ECB7C88.3060601@suse.cz \
    --to=mludvig@suse.cz \
    --cc=binutils@sources.redhat.com \
    --cc=hp@bitrange.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).