aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>2013-10-17 16:49:49 +0000
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>2013-10-17 16:49:49 +0000
commitf541a48127a1940dce8dc8f48d88ccb04aa2a31e (patch)
tree9282b64ec45581031c7b86c53e3b7a5df88a7cde /gcc
parent51bb310d15b97ad1a2c1eedf8a6792663c493947 (diff)
downloadgcc-f541a48127a1940dce8dc8f48d88ccb04aa2a31e.zip
gcc-f541a48127a1940dce8dc8f48d88ccb04aa2a31e.tar.gz
gcc-f541a48127a1940dce8dc8f48d88ccb04aa2a31e.tar.bz2
aarch64.c (aarch64_print_operand): Handle 'c'.
[gcc/] 2013-10-17 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * config/aarch64/aarch64.c (aarch64_print_operand): Handle 'c'. [gcc/testsuite/] 2013-10-17 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * gcc.target/aarch64/c-output-template.c: New testcase. * gcc.target/aarch64/c-output-template-2.c: Likewise. * gcc.target/aarch64/c-output-template-3.c: Likewise. From-SVN: r203779
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/config/aarch64/aarch64.c26
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.target/aarch64/c-output-template-2.c15
-rw-r--r--gcc/testsuite/gcc.target/aarch64/c-output-template-3.c15
-rw-r--r--gcc/testsuite/gcc.target/aarch64/c-output-template.c9
6 files changed, 75 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 5630a19..3888c9a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2013-10-17 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * config/aarch64/aarch64.c (aarch64_print_operand): Handle 'c'.
+
2013-10-17 Marcus Shawcroft <marcus.shawcroft@arm.com>
* config/aarch64/aarch64.c (aarch64_preferred_reload_class): Adjust
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 7fce7a0..d553af8 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -3440,6 +3440,32 @@ aarch64_print_operand (FILE *f, rtx x, char code)
{
switch (code)
{
+ /* An integer or symbol address without a preceding # sign. */
+ case 'c':
+ switch (GET_CODE (x))
+ {
+ case CONST_INT:
+ fprintf (f, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
+ break;
+
+ case SYMBOL_REF:
+ output_addr_const (f, x);
+ break;
+
+ case CONST:
+ if (GET_CODE (XEXP (x, 0)) == PLUS
+ && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF)
+ {
+ output_addr_const (f, x);
+ break;
+ }
+ /* Fall through. */
+
+ default:
+ output_operand_lossage ("Unsupported operand for code '%c'", code);
+ }
+ break;
+
case 'e':
/* Print the sign/zero-extend size as a character 8->b, 16->h, 32->w. */
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a3646d4..a3bd224 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2013-10-17 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * gcc.target/aarch64/c-output-template.c: New testcase.
+ * gcc.target/aarch64/c-output-template-2.c: Likewise.
+ * gcc.target/aarch64/c-output-template-3.c: Likewise.
+
2013-10-17 Michael Hudson-Doyle <michael.hudson@linaro.org>
* gcc/testsuite/lib/target-supports.exp
diff --git a/gcc/testsuite/gcc.target/aarch64/c-output-template-2.c b/gcc/testsuite/gcc.target/aarch64/c-output-template-2.c
new file mode 100644
index 0000000..16ff58d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/c-output-template-2.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+struct tracepoint {
+ int dummy;
+ int state;
+};
+static struct tracepoint tp;
+
+void
+test (void)
+{
+ __asm__ ("@ %c0" : : "i" (&tp));
+}
+
+/* { dg-final { scan-assembler "@ tp" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/c-output-template-3.c b/gcc/testsuite/gcc.target/aarch64/c-output-template-3.c
new file mode 100644
index 0000000..e332fe1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/c-output-template-3.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+
+struct tracepoint {
+ int dummy;
+ int state;
+};
+static struct tracepoint tp;
+
+void
+test (void)
+{
+ __asm__ ("@ %c0" : : "i" (&tp.state));
+}
+
+/* { dg-final { scan-assembler "@ tp\\+4" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/c-output-template.c b/gcc/testsuite/gcc.target/aarch64/c-output-template.c
new file mode 100644
index 0000000..1b67c91
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/c-output-template.c
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+
+void
+test (void)
+{
+ __asm__ ("@ %c0" : : "i" (42));
+}
+
+/* { dg-final { scan-assembler "@ 42" } } */