public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Felix Yang <fei.yang0953@gmail.com>
To: Sterling Augustine <augustine.sterling@gmail.com>,
	gcc-patches@gcc.gnu.org
Subject: [Patch, xtensa] Add LOCAL_REGNO to the xtensa backend.
Date: Tue, 14 Jan 2014 15:14:00 -0000	[thread overview]
Message-ID: <CAFc0fxwi9s8arDo152SKDRPpbQ6n8h8Bx5Mc649Gy+KgN+Fr4g@mail.gmail.com> (raw)

Hi Sterling,

    The xtensa backend uses register windows, and we need to define
LOCAL_REGNO for it.
    The dataflow may not be accurate with this macro. This patch
passed the cases in testsuite/gcc.c-torture/execute dir.
    Please apply it if OK for trunk. Thanks.

Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog    (revision 206599)
+++ gcc/ChangeLog    (working copy)
@@ -1,3 +1,7 @@
+2014-01-14  Felix Yang  <fei.yang0953@gmail.com>
+
+    * config/xtensa/xtensa.h (LOCAL_REGNO): New.
+
 2014-01-14  Richard Biener  <rguenther@suse.de>

     PR tree-optimization/58921
Index: gcc/config/xtensa/xtensa.h
===================================================================
--- gcc/config/xtensa/xtensa.h    (revision 206599)
+++ gcc/config/xtensa/xtensa.h    (working copy)
@@ -369,7 +369,14 @@ extern char xtensa_hard_regno_mode_ok[][FIRST_PSEU
     ((unsigned) ((IN) - GP_REG_FIRST) < WINDOW_SIZE)) ?            \
    (IN) + WINDOW_SIZE : (IN))

+/* Define this macro if the target machine has register windows.  This
+   C expression returns true if the register is call-saved but is in the
+   register window.  */

+#define LOCAL_REGNO(REGNO)                        \
+  (GP_REG_P (REGNO) && ((unsigned) (REGNO - GP_REG_FIRST) < WINDOW_SIZE))
+
+
 /* Define the classes of registers for register constraints in the
    machine description.  */
 enum reg_class



Cheers,
Felix

             reply	other threads:[~2014-01-14 15:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-14 15:14 Felix Yang [this message]
2014-01-14 16:45 ` Sterling Augustine

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=CAFc0fxwi9s8arDo152SKDRPpbQ6n8h8Bx5Mc649Gy+KgN+Fr4g@mail.gmail.com \
    --to=fei.yang0953@gmail.com \
    --cc=augustine.sterling@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).