From patchwork Thu Jul 25 11:00:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kyrill Tkachov X-Patchwork-Id: 1136835 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-505662-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=foss.arm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="jkPoXxhn"; 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 45vTlt1bXQz9s00 for ; Thu, 25 Jul 2019 21:00:55 +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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=euu6DeAyYgJZtcHUCEgpqk2vpjPyz3E5CB9z7mKuuteA7Yvre9 cYnNU1Kt/kmkntZIAjNHnPUnUugsRf102WQ2mZjgIsWluDfJEa4F2ZF4cNBN+wmN Q0un4egOXDjPrpEw8wG0wT/Ns6d3z+mnQbPWuzmHu69tuu+ttSv1VMiAQ= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=euHTfILxocxeZ2q3+j61mrR+TBw=; b=jkPoXxhnkkjIFEfwElIF KUIrJrV5yoNETjCLqgrCI2m0y9/7/3RVRRXgS4NCzpWzUJzO8Y8G3iWOzXsC2KJX 70t9N6u4bjDm1Z+d+ztM/hsWLwkgDCU0gmc6AcqwbYoNqnESPlh9xczwMFmQ+1lk RVDYkzLJFNjwF6adEaOTJDM= Received: (qmail 77510 invoked by alias); 25 Jul 2019 11:00:48 -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 77501 invoked by uid 89); 25 Jul 2019 11:00:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.7 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=sat, vice, H*M:6aa9, H*MI:6aa9 X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.110.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 25 Jul 2019 11:00:46 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id F1FAA28 for ; Thu, 25 Jul 2019 04:00:44 -0700 (PDT) Received: from [10.2.206.47] (e120808-lin.cambridge.arm.com [10.2.206.47]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AE8D23F71A for ; Thu, 25 Jul 2019 04:00:44 -0700 (PDT) To: "gcc-patches@gcc.gnu.org" From: Kyrill Tkachov Subject: [PATCH][arm][committed] Clean up code iterator usage in satsi* patterns Message-ID: Date: Thu, 25 Jul 2019 12:00:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 MIME-Version: 1.0 Hi all, GCC 10 now supports having RTL codes being code attributes (thanks Richard) allowing us to map smax to smin and vice versa. This means we can clean up their use in the saturation patterns that do the cross product of [smin, smax] and use the pattern predicate to cancel out the nonsense ones. Bootstrapped and tested on arm-none-linux-gnueabihf. Committing to trunk. Thanks, Kyrill 2019-07-25  Kyrylo Tkachov      * config/arm/arm.md (SATrev): Change to code attribute.     (*satsi_): Adjust for the above.     (*satsi__shift): Likewise. diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 7b90065adba2a19536aeaccfd8f5cf8a501eb266..f11745ba855957da4acec197f2df9c931708062a 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -3981,16 +3981,16 @@ ) (define_code_iterator SAT [smin smax]) -(define_code_iterator SATrev [smin smax]) +(define_code_attr SATrev [(smin "smax") (smax "smin")]) (define_code_attr SATlo [(smin "1") (smax "2")]) (define_code_attr SAThi [(smin "2") (smax "1")]) (define_insn "*satsi_" [(set (match_operand:SI 0 "s_register_operand" "=r") - (SAT:SI (SATrev:SI (match_operand:SI 3 "s_register_operand" "r") + (SAT:SI (:SI (match_operand:SI 3 "s_register_operand" "r") (match_operand:SI 1 "const_int_operand" "i")) (match_operand:SI 2 "const_int_operand" "i")))] - "TARGET_32BIT && arm_arch6 && != + "TARGET_32BIT && arm_arch6 && arm_sat_operator_match (operands[], operands[], NULL, NULL)" { int mask; @@ -4011,12 +4011,12 @@ (define_insn "*satsi__shift" [(set (match_operand:SI 0 "s_register_operand" "=r") - (SAT:SI (SATrev:SI (match_operator:SI 3 "sat_shift_operator" + (SAT:SI (:SI (match_operator:SI 3 "sat_shift_operator" [(match_operand:SI 4 "s_register_operand" "r") (match_operand:SI 5 "const_int_operand" "i")]) (match_operand:SI 1 "const_int_operand" "i")) (match_operand:SI 2 "const_int_operand" "i")))] - "TARGET_32BIT && arm_arch6 && != + "TARGET_32BIT && arm_arch6 && arm_sat_operator_match (operands[], operands[], NULL, NULL)" { int mask;