public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch, AArch64-4.7] Remove %r from asm_printf
@ 2013-01-09 10:13 Hurugalawadi, Naveen
  2013-01-09 12:16 ` Marcus Shawcroft
  0 siblings, 1 reply; 2+ messages in thread
From: Hurugalawadi, Naveen @ 2013-01-09 10:13 UTC (permalink / raw)
  To: Marcus Shawcroft; +Cc: gcc-patches

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

Hi,

>> It would be much appreciated if you would
>> handle the back port to ARM/aarch64-4.7-branch

Thanks for reviewing the patch and your comments.
Please find attached the backported patch to ARM/aarch64-4.7-branch.

Regressed for aarch64-elf on aarch64-4.7-branch. 

Thanks,
Naveen.H.S

2013-01-09   Naveen H.S  <Naveen.Hurugalawadi@caviumnetworks.com>

	* config/aarch64/aarch64.c (aarch64_print_operand): Replace %r
	in asm_fprintf with reg_names.
	(aarch64_print_operand_address): Likewise.
	(aarch64_return_addr): Likewise.
	* config/aarch64/aarch64.h (ASM_FPRINTF_EXTENSIONS): Remove.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: remove_fprintf_ext-4.7.patch --]
[-- Type: text/x-patch; name="remove_fprintf_ext-4.7.patch", Size: 5898 bytes --]

--- gcc/config/aarch64/aarch64.c	2013-01-09 10:10:03.044021335 +0530
+++ gcc/config/aarch64/aarch64.c	2013-01-09 15:07:47.076627180 +0530
@@ -3198,7 +3198,7 @@ aarch64_print_operand (FILE *f, rtx x, c
 	  return;
 	}
 
-      asm_fprintf (f, "%r", REGNO (x) + 1);
+      asm_fprintf (f, "%s", reg_names [REGNO (x) + 1]);
       break;
 
     case 'Q':
@@ -3208,7 +3208,7 @@ aarch64_print_operand (FILE *f, rtx x, c
 	  output_operand_lossage ("invalid operand for '%%%c'", code);
 	  return;
 	}
-      asm_fprintf (f, "%r", REGNO (x) + (WORDS_BIG_ENDIAN ? 1 : 0));
+      asm_fprintf (f, "%s", reg_names [REGNO (x) + (WORDS_BIG_ENDIAN ? 1 : 0)]);
       break;
 
     case 'R':
@@ -3218,7 +3218,7 @@ aarch64_print_operand (FILE *f, rtx x, c
 	  output_operand_lossage ("invalid operand for '%%%c'", code);
 	  return;
 	}
-      asm_fprintf (f, "%r", REGNO (x) + (WORDS_BIG_ENDIAN ? 0 : 1));
+      asm_fprintf (f, "%s", reg_names [REGNO (x) + (WORDS_BIG_ENDIAN ? 0 : 1)]);
       break;
 
     case 'm':
@@ -3323,7 +3323,7 @@ aarch64_print_operand (FILE *f, rtx x, c
       switch (GET_CODE (x))
 	{
 	case REG:
-	  asm_fprintf (f, "%r", REGNO (x));
+	  asm_fprintf (f, "%s", reg_names [REGNO (x)]);
 	  break;
 
 	case MEM:
@@ -3478,36 +3478,36 @@ aarch64_print_operand_address (FILE *f,
       {
       case ADDRESS_REG_IMM:
 	if (addr.offset == const0_rtx)
-	  asm_fprintf (f, "[%r]", REGNO (addr.base));
+	  asm_fprintf (f, "[%s]", reg_names [REGNO (addr.base)]);
 	else
-	  asm_fprintf (f, "[%r,%wd]", REGNO (addr.base),
+	  asm_fprintf (f, "[%s,%wd]", reg_names [REGNO (addr.base)],
 		       INTVAL (addr.offset));
 	return;
 
       case ADDRESS_REG_REG:
 	if (addr.shift == 0)
-	  asm_fprintf (f, "[%r,%r]", REGNO (addr.base),
-		       REGNO (addr.offset));
+	  asm_fprintf (f, "[%s,%s]", reg_names [REGNO (addr.base)],
+		       reg_names [REGNO (addr.offset)]);
 	else
-	  asm_fprintf (f, "[%r,%r,lsl %u]", REGNO (addr.base),
-		       REGNO (addr.offset), addr.shift);
+	  asm_fprintf (f, "[%s,%s,lsl %u]", reg_names [REGNO (addr.base)],
+		       reg_names [REGNO (addr.offset)], addr.shift);
 	return;
 
       case ADDRESS_REG_UXTW:
 	if (addr.shift == 0)
-	  asm_fprintf (f, "[%r,w%d,uxtw]", REGNO (addr.base),
+	  asm_fprintf (f, "[%s,w%d,uxtw]", reg_names [REGNO (addr.base)],
 		       REGNO (addr.offset) - R0_REGNUM);
 	else
-	  asm_fprintf (f, "[%r,w%d,uxtw %u]", REGNO (addr.base),
+	  asm_fprintf (f, "[%s,w%d,uxtw %u]", reg_names [REGNO (addr.base)],
 		       REGNO (addr.offset) - R0_REGNUM, addr.shift);
 	return;
 
       case ADDRESS_REG_SXTW:
 	if (addr.shift == 0)
-	  asm_fprintf (f, "[%r,w%d,sxtw]", REGNO (addr.base),
+	  asm_fprintf (f, "[%s,w%d,sxtw]", reg_names [REGNO (addr.base)],
 		       REGNO (addr.offset) - R0_REGNUM);
 	else
-	  asm_fprintf (f, "[%r,w%d,sxtw %u]", REGNO (addr.base),
+	  asm_fprintf (f, "[%s,w%d,sxtw %u]", reg_names [REGNO (addr.base)],
 		       REGNO (addr.offset) - R0_REGNUM, addr.shift);
 	return;
 
@@ -3515,27 +3515,27 @@ aarch64_print_operand_address (FILE *f,
 	switch (GET_CODE (x))
 	  {
 	  case PRE_INC:
-	    asm_fprintf (f, "[%r,%d]!", REGNO (addr.base),
+	    asm_fprintf (f, "[%s,%d]!", reg_names [REGNO (addr.base)], 
 			 GET_MODE_SIZE (aarch64_memory_reference_mode));
 	    return;
 	  case POST_INC:
-	    asm_fprintf (f, "[%r],%d", REGNO (addr.base),
+	    asm_fprintf (f, "[%s],%d", reg_names [REGNO (addr.base)],
 			 GET_MODE_SIZE (aarch64_memory_reference_mode));
 	    return;
 	  case PRE_DEC:
-	    asm_fprintf (f, "[%r,-%d]!", REGNO (addr.base),
+	    asm_fprintf (f, "[%s,-%d]!", reg_names [REGNO (addr.base)],
 			 GET_MODE_SIZE (aarch64_memory_reference_mode));
 	    return;
 	  case POST_DEC:
-	    asm_fprintf (f, "[%r],-%d", REGNO (addr.base),
+	    asm_fprintf (f, "[%s],-%d", reg_names [REGNO (addr.base)],
 			 GET_MODE_SIZE (aarch64_memory_reference_mode));
 	    return;
 	  case PRE_MODIFY:
-	    asm_fprintf (f, "[%r,%wd]!", REGNO (addr.base),
+	    asm_fprintf (f, "[%s,%wd]!", reg_names [REGNO (addr.base)],
 			 INTVAL (addr.offset));
 	    return;
 	  case POST_MODIFY:
-	    asm_fprintf (f, "[%r],%wd", REGNO (addr.base),
+	    asm_fprintf (f, "[%s],%wd", reg_names [REGNO (addr.base)],
 			 INTVAL (addr.offset));
 	    return;
 	  default:
@@ -3544,7 +3544,7 @@ aarch64_print_operand_address (FILE *f,
 	break;
 
       case ADDRESS_LO_SUM:
-	asm_fprintf (f, "[%r,#:lo12:", REGNO (addr.base));
+	asm_fprintf (f, "[%s,#:lo12:", reg_names [REGNO (addr.base)]);
 	output_addr_const (f, addr.offset);
 	asm_fprintf (f, "]");
 	return;
@@ -3856,9 +3856,9 @@ aarch64_return_addr (int count, rtx fram
 static void
 aarch64_asm_trampoline_template (FILE *f)
 {
-  asm_fprintf (f, "\tldr\t%r, .+16\n", IP1_REGNUM);
-  asm_fprintf (f, "\tldr\t%r, .+20\n", STATIC_CHAIN_REGNUM);
-  asm_fprintf (f, "\tbr\t%r\n", IP1_REGNUM);
+  asm_fprintf (f, "\tldr\t%s, .+16\n", reg_names [IP1_REGNUM]);
+  asm_fprintf (f, "\tldr\t%s, .+20\n", reg_names [STATIC_CHAIN_REGNUM]);
+  asm_fprintf (f, "\tbr\t%s\n", reg_names [IP1_REGNUM]);
   assemble_aligned_integer (4, const0_rtx);
   assemble_aligned_integer (UNITS_PER_WORD, const0_rtx);
   assemble_aligned_integer (UNITS_PER_WORD, const0_rtx);
--- gcc/config/aarch64/aarch64.h	2013-01-09 10:10:03.044021335 +0530
+++ gcc/config/aarch64/aarch64.h	2013-01-09 15:07:47.080627181 +0530
@@ -773,16 +773,6 @@ do {									     \
 #define ASM_APP_ON	"\t" ASM_COMMENT_START " Start of user assembly\n"
 #define ASM_APP_OFF	"\t" ASM_COMMENT_START " End of user assembly\n"
 
-#define ASM_FPRINTF_EXTENSIONS(FILE, ARGS, P)		\
-  case '@':						\
-    fputs (ASM_COMMENT_START, FILE);			\
-    break;						\
-							\
-  case 'r':						\
-    fputs (REGISTER_PREFIX, FILE);			\
-    fputs (reg_names[va_arg (ARGS, int)], FILE);	\
-    break;
-
 #define CONSTANT_POOL_BEFORE_FUNCTION 0
 
 /* This definition should be relocated to aarch64-elf-raw.h.  This macro

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

* Re: [Patch, AArch64-4.7] Remove %r from asm_printf
  2013-01-09 10:13 [Patch, AArch64-4.7] Remove %r from asm_printf Hurugalawadi, Naveen
@ 2013-01-09 12:16 ` Marcus Shawcroft
  0 siblings, 0 replies; 2+ messages in thread
From: Marcus Shawcroft @ 2013-01-09 12:16 UTC (permalink / raw)
  To: gcc-patches

On 09/01/13 10:12, Hurugalawadi, Naveen wrote:
> Hi,
>
>>> It would be much appreciated if you would
>>> handle the back port to ARM/aarch64-4.7-branch
>
> Thanks for reviewing the patch and your comments.
> Please find attached the backported patch to ARM/aarch64-4.7-branch.
>
> Regressed for aarch64-elf on aarch64-4.7-branch.
>
> Thanks,
> Naveen.H.S
>
> 2013-01-09   Naveen H.S  <Naveen.Hurugalawadi@caviumnetworks.com>
>
> 	* config/aarch64/aarch64.c (aarch64_print_operand): Replace %r
> 	in asm_fprintf with reg_names.
> 	(aarch64_print_operand_address): Likewise.
> 	(aarch64_return_addr): Likewise.
> 	* config/aarch64/aarch64.h (ASM_FPRINTF_EXTENSIONS): Remove.
>

OK please commit.

ChangeLog entry goes in ChangeLog.aarch64 for this branch.

Thanks
/Marcus

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

end of thread, other threads:[~2013-01-09 12:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-09 10:13 [Patch, AArch64-4.7] Remove %r from asm_printf Hurugalawadi, Naveen
2013-01-09 12:16 ` Marcus Shawcroft

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