From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2049) id 51296385624D; Thu, 5 May 2022 12:04:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 51296385624D Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Matthew Malcomson To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/ARM/heads/morello)] Implement valid-pointer-mode for aarch64 X-Act-Checkin: gcc X-Git-Author: Matthew Malcomson X-Git-Refname: refs/vendors/ARM/heads/morello X-Git-Oldrev: f67875053959be76f8437b453f4674faecd0409c X-Git-Newrev: 9336ef23d4c7324d7269417d21ba2f7fc0a60057 Message-Id: <20220505120414.51296385624D@sourceware.org> Date: Thu, 5 May 2022 12:04:14 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2022 12:04:14 -0000 https://gcc.gnu.org/g:9336ef23d4c7324d7269417d21ba2f7fc0a60057 commit 9336ef23d4c7324d7269417d21ba2f7fc0a60057 Author: Matthew Malcomson 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