From patchwork Fri Sep 6 09:59:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Richard Earnshaw \(lists\)" X-Patchwork-Id: 173207 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp490329ilq; Fri, 6 Sep 2019 03:00:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGZPEE6m6+3i43z1+YTmmjVsL5kEp8OREb8jekWVBysmEmf2HZflsH70O2bTe3sgj4S791 X-Received: by 2002:a63:bf01:: with SMTP id v1mr7056424pgf.278.1567764002735; Fri, 06 Sep 2019 03:00:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567764002; cv=none; d=google.com; s=arc-20160816; b=uXN7dvv4sNItW+rWarALBcI5YvZNpxH0dEPJVn8zxh++xODganFjjD9YfxmCX6kjWx xAZVlYz2cdbfLt+Npn0eIZyjXPZhJ3SV87RIUNxn/jiojEWPrLDWMl9L+5GVxZMtnVs1 pikxc3iABB8DKoz1lVe8Yh1ILhpEaxx0H6WdayyE68lUxs2vHZpFS5GxlHqWPRgecUya +h/O32XrIvWBDa4cp8+xzkDBGgkGFWIrjhEBHpnZKm9wRADBmx0deBpCtyRXLeJAW/yJ AfVrOObJIFUDooiGISo+Rjtg6dGnjGMVZ16AVeyVBufWz8EKdSprrnnBBCImG3F5ok64 VHRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:date:message-id:subject:from:to :delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=uMPgxBLFCkK/6JCCLSTNgHHEZcb9zSt+pA0wvVlxZfI=; b=edhSKwWWMOV14yi13h/MoZYD1gN1eCFNcCA/nUBSRtv8avWllqDIcGvQ7TIPSDlcjc 6TShjboZtyMTRhCfNE4nbbkgSiARiZYJabVdOIUqR35Te7wj+X3uU6RvKw6BukVJhDQl snA+/6Z4F05E57p6DHZHfuZgeF68UoXk6J4vGYpzJxuiVTb067by8vLLMvzY/nPe98jJ mLmq0FZK35qioJ6QaruIoVKnXiLHEaZmqC97VyvhUjljD579yy0ZHoGH7nAt+LEA8fyw gyMg3eLwIJc8iTkMEKAn8CEYedfz4ub/e039DuOoph30JEybUcZH99pv4qfdDp+fdsny Y35w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=FlB1YwNu; spf=pass (google.com: domain of gcc-patches-return-508454-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508454-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id m22si4038771pgh.190.2019.09.06.03.00.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Sep 2019 03:00:02 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508454-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=FlB1YwNu; spf=pass (google.com: domain of gcc-patches-return-508454-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508454-patch=linaro.org@gcc.gnu.org" 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=Ll3ioZ0Kkt2DQUv6s4nhjGl911i1RCxxOzpzf+5HJDv2Nik8hH 5fAu8J0CjiHTlaBxBF9pB5wwjV1RHCB0+Z2i/sHFv+hAZooFBuQV2VJ5cb29L3yD 6VcRYvkBZKE/BpxoCSTqFcCrr+LKFTCxTMPXydF40phVEhKJpwxsof7aQ= 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=a58DQuNWDJGOB4xhuHfJ/aNrC0M=; b=FlB1YwNuzvJ1kCcMgOdj rG4hsgm+qLKnkp5q+ArmfXMc4mYkjaPMBx5kOqFJmm2S5rjt7r/4TLu2NgkOdK9x sPPOkxAglq4ziRZN6VAUtsEMwQeFbckLac26pEi0Jk+gqlIR68fjFUym0ewMkesL LhwYIjFg5inddd/qecTnQfI= Received: (qmail 56359 invoked by alias); 6 Sep 2019 09:59:51 -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 56351 invoked by uid 89); 6 Sep 2019 09:59:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:3734 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; Fri, 06 Sep 2019 09:59:49 +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 3730B1570; Fri, 6 Sep 2019 02:59:48 -0700 (PDT) Received: from e120077-lin.cambridge.arm.com (e120077-lin.cambridge.arm.com [10.2.206.91]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BBADE3F59C; Fri, 6 Sep 2019 02:59:47 -0700 (PDT) To: "gcc-patches@gcc.gnu.org" From: "Richard Earnshaw (lists)" Subject: [arm] Add missing predicated-short-it variants to cmp_and and cmp_ior patterns Message-ID: <31d4d879-d4e5-16b8-0fbf-3de33ca082f9@arm.com> Date: Fri, 6 Sep 2019 10:59:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 The cmp_and and cmp_ior patterns were missing a couple of short-it variants for thumb2, where the comparisons are all using registers some of which were HI_REGS. * config/arm/arm.md (cmp_and): Add short-it variant for thumb2 with high regs. (cmp_ior): Likewise. Committed to trunk. diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index ed49c4beda1..3bcfdfd51e5 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -9107,15 +9107,15 @@ (define_insn "*cmp_and" (compare (and:SI (match_operator 4 "arm_comparison_operator" - [(match_operand:SI 0 "s_register_operand" - "l,l,l,r,r,r,r,r,r") - (match_operand:SI 1 "arm_add_operand" - "lPy,lPy,lPy,rI,L,rI,L,rI,L")]) + [(match_operand:SI 0 "s_register_operand" + "l,l,l,r,r,r,r,r,r,r") + (match_operand:SI 1 "arm_add_operand" + "lPy,lPy,lPy,rI,L,r,rI,L,rI,L")]) (match_operator:SI 5 "arm_comparison_operator" - [(match_operand:SI 2 "s_register_operand" - "l,r,r,l,l,r,r,r,r") - (match_operand:SI 3 "arm_add_operand" - "lPy,rI,L,lPy,lPy,rI,rI,L,L")])) + [(match_operand:SI 2 "s_register_operand" + "l,r,r,l,l,r,r,r,r,r") + (match_operand:SI 3 "arm_add_operand" + "lPy,rI,L,lPy,lPy,r,rI,rI,L,L")])) (const_int 0)))] "TARGET_32BIT" "* @@ -9147,9 +9147,10 @@ (define_insn "*cmp_and" \"it\\t%d5\", \"it\\t%d4\" }; - static const int cmp_idx[9] = {CMP_CMP, CMP_CMP, CMP_CMN, - CMP_CMP, CMN_CMP, CMP_CMP, - CMN_CMP, CMP_CMN, CMN_CMN}; + static const int cmp_idx[] = {CMP_CMP, CMP_CMP, CMP_CMN, + CMP_CMP, CMN_CMP, CMP_CMP, + CMP_CMP, CMN_CMP, CMP_CMN, + CMN_CMN}; int swap = comparison_dominates_p (GET_CODE (operands[5]), GET_CODE (operands[4])); @@ -9162,14 +9163,15 @@ (define_insn "*cmp_and" }" [(set_attr "conds" "set") (set_attr "predicable" "no") - (set_attr "arch" "t2,t2,t2,t2,t2,any,any,any,any") - (set_attr "enabled_for_short_it" "yes,no,no,no,no,no,no,no,no") + (set_attr "arch" "t2,t2,t2,t2,t2,t2,any,any,any,any") + (set_attr "enabled_for_short_it" "yes,no,no,no,no,yes,no,no,no,no") (set_attr_alternative "length" [(const_int 6) (const_int 8) (const_int 8) (const_int 8) (const_int 8) + (const_int 6) (if_then_else (eq_attr "is_thumb" "no") (const_int 8) (const_int 10)) @@ -9191,14 +9193,14 @@ (define_insn "*cmp_ior" (ior:SI (match_operator 4 "arm_comparison_operator" [(match_operand:SI 0 "s_register_operand" - "l,l,l,r,r,r,r,r,r") + "l,l,l,r,r,r,r,r,r,r") (match_operand:SI 1 "arm_add_operand" - "lPy,lPy,lPy,rI,L,rI,L,rI,L")]) + "lPy,lPy,lPy,rI,L,r,rI,L,rI,L")]) (match_operator:SI 5 "arm_comparison_operator" [(match_operand:SI 2 "s_register_operand" - "l,r,r,l,l,r,r,r,r") + "l,r,r,l,l,r,r,r,r,r") (match_operand:SI 3 "arm_add_operand" - "lPy,rI,L,lPy,lPy,rI,rI,L,L")])) + "lPy,rI,L,lPy,lPy,r,rI,rI,L,L")])) (const_int 0)))] "TARGET_32BIT" "* @@ -9230,9 +9232,10 @@ (define_insn "*cmp_ior" \"it\\t%D4\", \"it\\t%D5\" }; - static const int cmp_idx[9] = {CMP_CMP, CMP_CMP, CMP_CMN, - CMP_CMP, CMN_CMP, CMP_CMP, - CMN_CMP, CMP_CMN, CMN_CMN}; + static const int cmp_idx[] = {CMP_CMP, CMP_CMP, CMP_CMN, + CMP_CMP, CMN_CMP, CMP_CMP, + CMP_CMP, CMN_CMP, CMP_CMN, + CMN_CMN}; int swap = comparison_dominates_p (GET_CODE (operands[5]), GET_CODE (operands[4])); @@ -9245,14 +9248,15 @@ (define_insn "*cmp_ior" } " [(set_attr "conds" "set") - (set_attr "arch" "t2,t2,t2,t2,t2,any,any,any,any") - (set_attr "enabled_for_short_it" "yes,no,no,no,no,no,no,no,no") + (set_attr "arch" "t2,t2,t2,t2,t2,t2,any,any,any,any") + (set_attr "enabled_for_short_it" "yes,no,no,no,no,yes,no,no,no,no") (set_attr_alternative "length" [(const_int 6) (const_int 8) (const_int 8) (const_int 8) (const_int 8) + (const_int 6) (if_then_else (eq_attr "is_thumb" "no") (const_int 8) (const_int 10))