From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by sourceware.org (Postfix) with ESMTPS id EEC5F3948451 for ; Sat, 21 Mar 2020 02:42:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EEC5F3948451 Received: by mail-pg1-x533.google.com with SMTP id h8so4005171pgs.9 for ; Fri, 20 Mar 2020 19:42:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Hmu6OF12EXToyu+cSg4eXC3cxom9MhctZtOVnGniUxc=; b=NazsN7N0GYk+KYyVbdqMGdVAyWhPQT3HOq/huyySDmcDbcI7IiAzwSXJan/Sjrm4Ei CN6fChVIKwWsop0CQZtFI6E5S2xax5MKTcp3rzyWeDr8KYwXJqm/EXg+iP/+v3vQuNri YZUHPjHr/XOl7HrgNxUH5+jaLGdbcO0xePK8F9Dmb2SH4N71y/dJmu88MyHs1kOEXzCR mbMboSsTl0+SK0tcZyXtKRiCj2lyiyjq/o9IDaX1SYMgz4FvMtw/ikd9yrmz+tB5PXp+ SeX6hlty4vkDbAH+Qr+FT6E3eqPAgUHjhP4jBT8zWN4qKTQ83pvJ78ot9by4pdPaqwqd nGEQ== X-Gm-Message-State: ANhLgQ2r0FnWWA7mEBS8Z45PORFQqIN+p9HdekkIhkMsK17J5krni7mQ i5C1CEiRtICx0s1xtPS+V2aGv1xiYjA= X-Google-Smtp-Source: ADFU+vtp9DTGk5llbs8HUGnChCyu21Y/4Jf/m5/AVOpt2in0/houH9fL87Us/OU+YLdFZ1sSCVpvgQ== X-Received: by 2002:a63:4864:: with SMTP id x36mr10684356pgk.398.1584758558679; Fri, 20 Mar 2020 19:42:38 -0700 (PDT) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id c83sm6772831pfb.44.2020.03.20.19.42.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Mar 2020 19:42:38 -0700 (PDT) From: Richard Henderson To: gcc-patches@gcc.gnu.org Cc: richard.earnshaw@arm.com, richard.sandiford@arm.com, marcus.shawcroft@arm.com, kyrylo.tkachov@arm.com, Wilco.Dijkstra@arm.com Subject: [PATCH v2 4/9] aarch64: Add cmp_carryinC_m2 Date: Fri, 20 Mar 2020 19:42:26 -0700 Message-Id: <20200321024231.13778-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200321024231.13778-1-richard.henderson@linaro.org> References: <20200321024231.13778-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-26.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Mar 2020 02:42:41 -0000 Combine will fold immediate -1 differently than the other *cmp*_carryinC* patterns. In this case we can use adcs with an xzr input, and it occurs frequently when comparing 128-bit values to small negative constants. * config/aarch64/aarch64.md (cmp_carryinC_m2): New. --- gcc/config/aarch64/aarch64.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index 9b1c3f797f9..076158b0071 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -3452,6 +3452,7 @@ "" ) +;; Substituting zero into the first input operand. (define_insn "*usub3_carryinC_z1" [(set (reg:CC CC_REGNUM) (compare:CC @@ -3482,6 +3483,7 @@ [(set_attr "type" "adc_reg")] ) +;; Substituting zero into the second input operand. (define_insn "*usub3_carryinC_z2" [(set (reg:CC CC_REGNUM) (compare:CC @@ -3508,6 +3510,19 @@ [(set_attr "type" "adc_reg")] ) +;; Substituting -1 into the second input operand. +(define_insn "*cmp3_carryinC_m2" + [(set (reg:CC CC_REGNUM) + (compare:CC + (neg: + (match_operand: 1 "aarch64_carry_operation" "")) + (ANY_EXTEND: + (match_operand:GPI 0 "register_operand" "r"))))] + "" + "adcs\\tzr, %0, zr" + [(set_attr "type" "adc_reg")] +) + (define_insn "*usub3_carryinC" [(set (reg:CC CC_REGNUM) (compare:CC -- 2.20.1