From: "Hurugalawadi, Naveen" <Naveen.Hurugalawadi@caviumnetworks.com>
To: Marcus Shawcroft <marcus.shawcroft@gmail.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: [Patch, AArch64-4.7] Remove %r from asm_printf
Date: Wed, 09 Jan 2013 10:13:00 -0000 [thread overview]
Message-ID: <F3068DEED1A463459E0887A091B15493380AC9@BY2PRD0710MB364.namprd07.prod.outlook.com> (raw)
[-- 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
next reply other threads:[~2013-01-09 10:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-09 10:13 Hurugalawadi, Naveen [this message]
2013-01-09 12:16 ` Marcus Shawcroft
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=F3068DEED1A463459E0887A091B15493380AC9@BY2PRD0710MB364.namprd07.prod.outlook.com \
--to=naveen.hurugalawadi@caviumnetworks.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=marcus.shawcroft@gmail.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).