From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2049) id CA780383469F; Fri, 6 May 2022 14:44:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA780383469F 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)] Fix aarch64_simd_{general, nonimmediate}_operand X-Act-Checkin: gcc X-Git-Author: Richard Sandiford X-Git-Refname: refs/vendors/ARM/heads/morello X-Git-Oldrev: 9a6713bdc72a9db401f2742b9bc8a40b813df297 X-Git-Newrev: db879a491ac8c11382702fdec943f99f45395197 Message-Id: <20220506144435.CA780383469F@sourceware.org> Date: Fri, 6 May 2022 14:44:35 +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: Fri, 06 May 2022 14:44:35 -0000 https://gcc.gnu.org/g:db879a491ac8c11382702fdec943f99f45395197 commit db879a491ac8c11382702fdec943f99f45395197 Author: Richard Sandiford Date: Tue Apr 26 21:09:50 2022 +0100 Fix aarch64_simd_{general,nonimmediate}_operand Like aarch64_simd_struct_operand, the uses of aarch64_simd_general_operand and aarch64_simd_nonimmediate_operand require a normal-base address. Diff: --- gcc/config/aarch64/predicates.md | 8 ++------ gcc/testsuite/gcc.target/aarch64/morello/simd-2.c | 12 ++++++++++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/gcc/config/aarch64/predicates.md b/gcc/config/aarch64/predicates.md index ce4e6ee16cb..3e79fbcc572 100644 --- a/gcc/config/aarch64/predicates.md +++ b/gcc/config/aarch64/predicates.md @@ -529,16 +529,12 @@ ;; Like general_operand but allow only valid SIMD addressing modes. (define_predicate "aarch64_simd_general_operand" (and (match_operand 0 "general_operand") - (match_test "!MEM_P (op) - || GET_CODE (XEXP (op, 0)) == POST_INC - || GET_CODE (XEXP (op, 0)) == REG"))) + (match_test "!MEM_P (op) || aarch64_simd_mem_operand_p (op)"))) ;; Like nonimmediate_operand but allow only valid SIMD addressing modes. (define_predicate "aarch64_simd_nonimmediate_operand" (and (match_operand 0 "nonimmediate_operand") - (match_test "!MEM_P (op) - || GET_CODE (XEXP (op, 0)) == POST_INC - || GET_CODE (XEXP (op, 0)) == REG"))) + (match_test "!MEM_P (op) || aarch64_simd_mem_operand_p (op)"))) ;; Predicates used by the various SIMD shift operations. These ;; fall in to 3 categories. diff --git a/gcc/testsuite/gcc.target/aarch64/morello/simd-2.c b/gcc/testsuite/gcc.target/aarch64/morello/simd-2.c new file mode 100644 index 00000000000..e037a35447d --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/morello/simd-2.c @@ -0,0 +1,12 @@ +#include +#include + +int32x4_t f(int32x4_t x, int32_t *__capability ptr) { + x[1] = *ptr; + return x; +} + +void g(int32_t *__capability ptr, int32x4_t x) { + ptr[0] = x[0]; + ptr[100] = x[1]; +}