From patchwork Fri Oct 18 19:48:59 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: 176959 Delivered-To: patch@linaro.org Received: by 2002:ac9:3c86:0:0:0:0:0 with SMTP id w6csp1294585ocf; Fri, 18 Oct 2019 12:57:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqynGWiek0jPKMMBMh27Mc1kZvUy4maTBQ5kL9xuNhS1eoeZg5UOWFfz7hmVWtyica9Rv1gm X-Received: by 2002:a50:af45:: with SMTP id g63mr11435434edd.21.1571428679740; Fri, 18 Oct 2019 12:57:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571428679; cv=none; d=google.com; s=arc-20160816; b=qIM8tKB/0InUFqmQa4iYQ6MxgH7J17bGvwrLakS0FnJfaQ6ccydbDuzbr/uod89TI8 tPuqhx+gvJi/KRO74HlXjH/yKPYz4oZvBgGNIjIruoArsdRIf8+gjhgTvg3DQhOwuJxp ylYn/SZI9gnjoLHgAXJ5bCadLzPChG0DX49y6UIXudE/rFLgXULf+JQtloS2mqmpftIZ zqy1g/orD6b1iGa+A1a+n4LeWg5pCSIXRSDCkHaY2IyPmXGBsYDxp55jWKx0PuQDc86u nhBlw4ZebqJptVXxxgnZUba/C19MCTW2KEwh1fd/zgmsR4RloiocqTv6lKHISAOt7KIC wcoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature; bh=M4tpF14fi32LBzxsBd2Dbh8pQAse88ETy72AwLqC6aw=; b=ddKY5wFwXL7cbwQ61Fal8SBd3EGwnMJCQBelQCLYPWgCLAs26PdDF/JyANAy1ev9CQ jU9XG4pHxf1UklsuAxcqswqQ/O+C+fiqD0LohWi4omE1OYpxtnfBUNxqyvwFEh5FulZ0 lKQOvjW2FfCI6mrfSVmxb/n7VFNKVsEVG2/L6t+wtetacZQqrVVRtbwbMDIFmkgj149r SDwKajsJQ6Fmr6m/u496PkTg/Dzxp7i5OHdz3fmuwgqpEdjVdvGDOLeHY+0BF0ACPqxc QrOdw3xFM1ZByWGkFYFjnOf5JEOeuwM6c82ODn1NOBFiPm2elxtjnwaG2fuifUuYNUn8 svaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=KKFDl7bQ; spf=pass (google.com: domain of gcc-patches-return-511325-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-511325-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 g50si4787577edb.47.2019.10.18.12.57.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Oct 2019 12:57:59 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-511325-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=KKFDl7bQ; spf=pass (google.com: domain of gcc-patches-return-511325-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-511325-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:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; q=dns; s=default; b=p6qSg8ea66MvZyZ8 HMttCFKgSgeflSRHOHDiUeKVXnCrqnfdQ8l5LuLdsOrBsFq9QjrqHqImShrr/eBK UmeEHT9qSIHM7seU/8VlsbdWdB8BfbQWqwZE2GAnjMndlaHsu4CVfnO5ChRgUV70 sxCEwSupSJ3RBT8EhiMdQbtqp44= 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 :mime-version:content-type; s=default; bh=TqRx/PjuwJ+ESzeZDu71JU 9buGk=; b=KKFDl7bQYSP0IXMTd3Mck0MY56QPWcxgbQQuQT3B1nEJmhlu+4cv43 5Q3jjUWlwAHeWlfHL2GSkR6BAUSImJ+nXAtZenpmvEAWeS4P/QBJTihjsZtadTpu Hf/TfF1NPb9+3h6kQ4kAo+zlb3R9MVOTnqY+BDPa6RkunHkJ/JIS4= Received: (qmail 114954 invoked by alias); 18 Oct 2019 19:55:45 -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 110614 invoked by uid 89); 18 Oct 2019 19:55:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_FAIL autolearn=ham version=3.3.1 spammy= X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 18 Oct 2019 19:55:31 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLYLR-000542-9R for gcc-patches@gcc.gnu.org; Fri, 18 Oct 2019 15:55:30 -0400 Received: from [217.140.110.172] (port=42740 helo=foss.arm.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iLYLR-00053X-4Q for gcc-patches@gcc.gnu.org; Fri, 18 Oct 2019 15:55:29 -0400 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 AD8F21766; Fri, 18 Oct 2019 12:49:31 -0700 (PDT) Received: from eagle.buzzard.freeserve.co.uk (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3AF5B3F6C4; Fri, 18 Oct 2019 12:49:31 -0700 (PDT) From: Richard Earnshaw To: gcc-patches@gcc.gnu.org Cc: Richard Earnshaw Subject: [PATCH 28/29] [arm] Improvements to negvsi4 and negvdi4. Date: Fri, 18 Oct 2019 20:48:59 +0100 Message-Id: <20191018194900.34795-29-Richard.Earnshaw@arm.com> In-Reply-To: <20191018194900.34795-1-Richard.Earnshaw@arm.com> References: <20191018194900.34795-1-Richard.Earnshaw@arm.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.140.110.172 The generic expansion code for negv does not try the subv patterns, but instead emits a sub and a compare separately. Fortunately, the patterns can make use of the new subv operations, so just call those. We can also rewrite this using an iterator to simplify things further. Finally, we can now make negvdi4 work on Thumb2 as well as Arm. * config/arm/arm.md (negv3): New expansion rule. (negvsi3, negvdi3): Delete. (negdi2_compare): Delete. --- gcc/config/arm/arm.md | 41 +++++------------------------------------ 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 5a8175ff8b0..7ef0c16580d 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -4581,48 +4581,17 @@ (define_insn "udivsi3" ;; Unary arithmetic insns -(define_expand "negvsi3" - [(match_operand:SI 0 "register_operand") - (match_operand:SI 1 "register_operand") +(define_expand "negv3" + [(match_operand:SIDI 0 "s_register_operand") + (match_operand:SIDI 1 "s_register_operand") (match_operand 2 "")] "TARGET_32BIT" { - emit_insn (gen_subsi3_compare (operands[0], const0_rtx, operands[1])); - arm_gen_unlikely_cbranch (NE, CC_Vmode, operands[2]); - - DONE; -}) - -(define_expand "negvdi3" - [(match_operand:DI 0 "s_register_operand") - (match_operand:DI 1 "s_register_operand") - (match_operand 2 "")] - "TARGET_ARM" -{ - emit_insn (gen_negdi2_compare (operands[0], operands[1])); - arm_gen_unlikely_cbranch (NE, CC_Vmode, operands[2]); - + emit_insn (gen_subv4 (operands[0], const0_rtx, operands[1], + operands[2])); DONE; }) - -(define_insn "negdi2_compare" - [(set (reg:CC CC_REGNUM) - (compare:CC - (const_int 0) - (match_operand:DI 1 "register_operand" "r,r"))) - (set (match_operand:DI 0 "register_operand" "=&r,&r") - (minus:DI (const_int 0) (match_dup 1)))] - "TARGET_ARM" - "@ - rsbs\\t%Q0, %Q1, #0;rscs\\t%R0, %R1, #0 - rsbs\\t%Q0, %Q1, #0;sbcs\\t%R0, %R1, %R1, lsl #1" - [(set_attr "conds" "set") - (set_attr "arch" "a,t2") - (set_attr "length" "8") - (set_attr "type" "multiple")] -) - (define_expand "negsi2" [(set (match_operand:SI 0 "s_register_operand") (neg:SI (match_operand:SI 1 "s_register_operand")))]