public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Matthew Malcomson <matmal01@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/vendors/ARM/heads/morello)] Implement valid-pointer-mode for aarch64
Date: Thu,  5 May 2022 12:04:14 +0000 (GMT)	[thread overview]
Message-ID: <20220505120414.51296385624D@sourceware.org> (raw)

https://gcc.gnu.org/g:9336ef23d4c7324d7269417d21ba2f7fc0a60057

commit 9336ef23d4c7324d7269417d21ba2f7fc0a60057
Author: Matthew Malcomson <matthew.malcomson@arm.com>
Date:   Thu Mar 17 15:49:20 2022 +0000

    Implement valid-pointer-mode for aarch64
    
    This allows capability versions of Pmode and ptr_mode as well as the
    standard versions.

Diff:
---
 gcc/config/aarch64/aarch64.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 05b78dac74c..53b6956e78a 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -24777,6 +24777,24 @@ aarch64_capabilities_in_hardware (void)
     return false;
 }
 
+/* Implement TARGET_VALID_POINTER_MODE hook.  */
+bool
+aarch64_valid_pointer_mode (scalar_addr_mode mode)
+{
+  /* For Hybrid Morello we support two valid pointer modes:
+      - DImode == Pmode == ptr_mode for all normal integer pointers.
+      - CADImode forcapability  pointers.
+     In order to return "valid" on both of them, we check against the
+     offset mode.  */
+  if (TARGET_CAPABILITY_HYBRID)
+    {
+      scalar_addr_mode omode = offset_mode (mode);
+      return (omode == Pmode || omode == ptr_mode);
+    }
+  else
+    return (mode == Pmode || mode == ptr_mode);
+}
+
 /* Implement the TARGET_DWARF_FRAME_REG_MODE target hook. This only has an
    impact in Hybrid Capability Morello compilation, where the default
    raw_reg_mode returned would still be CADImode, but we want to use DImode
@@ -25418,6 +25436,9 @@ aarch64_libgcc_floating_mode_supported_p
 #undef TARGET_ASM_DECLARE_CONSTANT_NAME
 #define TARGET_ASM_DECLARE_CONSTANT_NAME aarch64_declare_constant_name
 
+#undef TARGET_VALID_POINTER_MODE
+#define TARGET_VALID_POINTER_MODE aarch64_valid_pointer_mode
+
 #undef TARGET_UNWIND_WORD_MODE
 #define TARGET_UNWIND_WORD_MODE		aarch64_unwind_word_mode


                 reply	other threads:[~2022-05-05 12:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220505120414.51296385624D@sourceware.org \
    --to=matmal01@gcc.gnu.org \
    --cc=gcc-cvs@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).