From patchwork Sat Jul 20 17:19:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Segher Boessenkool X-Patchwork-Id: 1134413 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-505371-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="i+4njjui"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45rZPB0DzKz9s7T for ; Sun, 21 Jul 2019 03:19:41 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; q=dns; s=default; b=osZwesqdl1NDcdHe+Rr gUvuuHeE18AB2bKWVlvQ7MWdWqv1yffnW4Jg41fUQvPq4+t+mvxc3HCo+i2X2jt1 RPqmIgcY/2eWcR4jYYMezQlOOHcB90PzLzZEHhhPa7uBwz2Al+nupnPMJ95LOCzZ yiaePUqYpAzWb5AYjnGPyURA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; s=default; bh=t7DRvwIOX5RD9BSQ1uTlRVGhQ kw=; b=i+4njjui8UZoISw1/vDK/sU6syXs2uuHSGYsA6aqaSd4tGZoCW5BRFils TJQBYDbUOy9to9R13p6cw5Wei41764NCaMe8EsAB82ZXqTTnT2fh/lKg42K1wPjl 4MwtIc5gRlPK1lbdqgarvzm3Rgq5++kwKCx7Eak/sDPslv5gtA= Received: (qmail 3299 invoked by alias); 20 Jul 2019 17:19:33 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 3232 invoked by uid 89); 20 Jul 2019 17:19:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=xexp, XEXP, modernize X-HELO: gcc1-power7.osuosl.org Received: from gcc1-power7.osuosl.org (HELO gcc1-power7.osuosl.org) (140.211.15.137) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 20 Jul 2019 17:19:31 +0000 Received: by gcc1-power7.osuosl.org (Postfix, from userid 10019) id E66AE12407FD; Sat, 20 Jul 2019 17:19:29 +0000 (UTC) From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Cc: dje.gcc@gmail.com, Segher Boessenkool Subject: [PATCH 1/4] rs6000: New predicate any_memory_operand Date: Sat, 20 Jul 2019 17:19:14 +0000 Message-Id: <621412b11d6364b6b62b6525d14e8ba4a8b409a1.1563642475.git.segher@kernel.crashing.org> In-Reply-To: References: In-Reply-To: References: X-IsSubscribed: yes The new predicate accepts both memory_operand and volatile_mem_operand. 2019-07-20 Segher Boessenkool * config/rs6000/predicates.md (volatile_mem_operand): Modernize syntax. (any_memory_operand): New predicate. (reg_or_mem_operand): Use it. --- gcc/config/rs6000/predicates.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md index 5f687ea..13c7c02 100644 --- a/gcc/config/rs6000/predicates.md +++ b/gcc/config/rs6000/predicates.md @@ -703,12 +703,17 @@ (define_predicate "zero_fp_constant" ;; memory references. So this function allows us to recognize volatile ;; references where it's safe. (define_predicate "volatile_mem_operand" - (and (and (match_code "mem") - (match_test "MEM_VOLATILE_P (op)")) + (and (match_code "mem") + (match_test "MEM_VOLATILE_P (op)") (if_then_else (match_test "reload_completed") (match_operand 0 "memory_operand") (match_test "memory_address_p (mode, XEXP (op, 0))")))) +;; Return 1 if the operand is a volatile or non-volatile memory operand. +(define_predicate "any_memory_operand" + (ior (match_operand 0 "memory_operand") + (match_operand 0 "volatile_mem_operand"))) + ;; Return 1 if the operand is an offsettable memory operand. (define_predicate "offsettable_mem_operand" (and (match_operand 0 "memory_operand") @@ -891,11 +896,10 @@ (define_predicate "scc_eq_operand" ;; Return 1 if the operand is a general non-special register or memory operand. (define_predicate "reg_or_mem_operand" - (ior (match_operand 0 "memory_operand") + (ior (match_operand 0 "gpc_reg_operand") + (match_operand 0 "any_memory_operand") (and (match_code "mem") - (match_test "macho_lo_sum_memory_operand (op, mode)")) - (match_operand 0 "volatile_mem_operand") - (match_operand 0 "gpc_reg_operand"))) + (match_test "macho_lo_sum_memory_operand (op, mode)")))) ;; Return 1 if the operand is CONST_DOUBLE 0, register or memory operand. (define_predicate "zero_reg_mem_operand"