From patchwork Tue Apr 14 21:41:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 47152 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 11D2920553 for ; Tue, 14 Apr 2015 21:41:47 +0000 (UTC) Received: by wiun10 with SMTP id n10sf7177927wiu.1 for ; Tue, 14 Apr 2015 14:41:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:sender :delivered-to:message-id:date:from:user-agent:mime-version:to:cc :subject:content-type:x-original-sender :x-original-authentication-results; bh=c4V0d25Ga1LrHiP4DiExf4QbTkzVNQ94O/G3Rws4tU4=; b=baSKv81h5WwdUZ9hjsR9/1UTZ066OBhOgdhILv3s10AXR41xadfKN91njSWhm7319F rPCD0X7ToJj/gg9l5H9SmyJVAHjADWn+Ired117PGwW05kkYkGbfR0IJRxGiDtaiYCr+ l3khpFpdXiRjWo7z48f8iUQGGlGljXvCv+m7Y5NzpbCG+JKhYR9knnBYjURbSBhd8S3i QLV359RtrD54nrXx5L2jENQgVqv3dkNsAWzawYpLvORGUDxqkxDD9I8FdGMw0WApl8l3 zqYXPm+ikPLvFPO4xqKAqKAi+R7wUXGJNZXxV3nJAyKVTGLpKkYlbnC3jYYG9aqh7JXG Vy5w== X-Gm-Message-State: ALoCoQlNxRtEDTJQGq9GXfDSwCL2cX5BXU6TvgTF2vsM4UW0t8ca/1R7UU9ekJWWK2HjwJLYEnm6 X-Received: by 10.112.46.172 with SMTP id w12mr3912430lbm.18.1429047706131; Tue, 14 Apr 2015 14:41:46 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.198.229 with SMTP id jf5ls110106lac.56.gmail; Tue, 14 Apr 2015 14:41:46 -0700 (PDT) X-Received: by 10.113.10.134 with SMTP id ea6mr20589958lbd.29.1429047705964; Tue, 14 Apr 2015 14:41:45 -0700 (PDT) Received: from mail-la0-x22f.google.com (mail-la0-x22f.google.com. [2a00:1450:4010:c03::22f]) by mx.google.com with ESMTPS id jj4si2150770lbb.174.2015.04.14.14.41.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Apr 2015 14:41:45 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::22f as permitted sender) client-ip=2a00:1450:4010:c03::22f; Received: by labbd9 with SMTP id bd9so18850356lab.2 for ; Tue, 14 Apr 2015 14:41:45 -0700 (PDT) X-Received: by 10.112.160.227 with SMTP id xn3mr20507432lbb.112.1429047705556; Tue, 14 Apr 2015 14:41:45 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp2138706lbt; Tue, 14 Apr 2015 14:41:44 -0700 (PDT) X-Received: by 10.66.222.41 with SMTP id qj9mr40604995pac.139.1429047703399; Tue, 14 Apr 2015 14:41:43 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id i4si3640242pbq.65.2015.04.14.14.41.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Apr 2015 14:41:43 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-395176-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 99671 invoked by alias); 14 Apr 2015 21:41:28 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 99657 invoked by uid 89); 14 Apr 2015 21:41:28 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f50.google.com Received: from mail-pa0-f50.google.com (HELO mail-pa0-f50.google.com) (209.85.220.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 14 Apr 2015 21:41:27 +0000 Received: by pacyx8 with SMTP id yx8so26011101pac.1 for ; Tue, 14 Apr 2015 14:41:25 -0700 (PDT) X-Received: by 10.66.164.98 with SMTP id yp2mr39692970pab.114.1429047684985; Tue, 14 Apr 2015 14:41:24 -0700 (PDT) Received: from [10.1.1.6] (58-6-183-210.dyn.iinet.net.au. [58.6.183.210]) by mx.google.com with ESMTPSA id mt11sm2036503pbc.20.2015.04.14.14.41.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Apr 2015 14:41:24 -0700 (PDT) Message-ID: <552D897C.2040207@linaro.org> Date: Wed, 15 Apr 2015 07:41:16 +1000 From: Kugan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: Marcus Shawcroft , james.greenhalgh@arm.com, Maxim Kuvyrkov , Richard Earnshaw Subject: [AArch64][PR65139] use clobber with match_scratch for aarch64_lshr_sisd_or_int_3 X-IsSubscribed: yes X-Original-Sender: kugan.vivekanandarajah@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::22f as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gcc.gnu.org X-Google-Group-Id: 836684582541 This patch uses clobber with match_scratch instead of earlyclobber for aarch64_lshr_sisd_or_int_3 so that RA can have more freedom in selecting suitable register, as discussed in http://thread.gmane.org/gmane.comp.gcc.patches/336162 and reported in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65139. This is based on Maxim's patch. I have bootstrapped and regression tested on aarch64-linux-gnu with no new regressions. Is this OK for trunk? Thanks, Kugan gcc/ChangeLog: 2015-04-15 Kugan Vivekanandarajah Maxim Kuvyrkov PR target/65139 * config/aarch64/aarch64.md (3): Expand lshr with gen_aarch64_lshr_sisd_or_int_3. (*aarch64_lshr_sisd_or_int_3): Rename to aarch64_lshr_sisd_or_int_3 and use clobber with match_scratch instead of early clobber. diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index 534a862..07fa035 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -3277,6 +3277,12 @@ DONE; } } + + if (strcmp ("", "lshr") == 0) + { + emit_insn (gen_aarch64_lshr_sisd_or_int_3 (operands[0], operands[1], operands[2])); + DONE; + } } ) @@ -3361,11 +3367,12 @@ ) ;; Logical right shift using SISD or Integer instruction -(define_insn "*aarch64_lshr_sisd_or_int_3" - [(set (match_operand:GPI 0 "register_operand" "=w,&w,r") +(define_insn "aarch64_lshr_sisd_or_int_3" + [(set (match_operand:GPI 0 "register_operand" "=w,w,r") (lshiftrt:GPI (match_operand:GPI 1 "register_operand" "w,w,r") - (match_operand:QI 2 "aarch64_reg_or_shift_imm_" "Us,w,rUs")))] + (match_operand:QI 2 "aarch64_reg_or_shift_imm_" "Us,w,rUs"))) + (clobber (match_scratch:QI 3 "=X,w,X"))] "" "@ ushr\t%0, %1, %2 @@ -3379,30 +3386,28 @@ [(set (match_operand:DI 0 "aarch64_simd_register") (lshiftrt:DI (match_operand:DI 1 "aarch64_simd_register") - (match_operand:QI 2 "aarch64_simd_register")))] + (match_operand:QI 2 "aarch64_simd_register"))) + (clobber (match_scratch:QI 3))] "TARGET_SIMD && reload_completed" [(set (match_dup 3) (unspec:QI [(match_dup 2)] UNSPEC_SISD_NEG)) (set (match_dup 0) (unspec:DI [(match_dup 1) (match_dup 3)] UNSPEC_SISD_USHL))] - { - operands[3] = gen_lowpart (QImode, operands[0]); - } + "" ) (define_split [(set (match_operand:SI 0 "aarch64_simd_register") (lshiftrt:SI (match_operand:SI 1 "aarch64_simd_register") - (match_operand:QI 2 "aarch64_simd_register")))] + (match_operand:QI 2 "aarch64_simd_register"))) + (clobber (match_scratch:QI 3))] "TARGET_SIMD && reload_completed" [(set (match_dup 3) (unspec:QI [(match_dup 2)] UNSPEC_SISD_NEG)) (set (match_dup 0) (unspec:SI [(match_dup 1) (match_dup 3)] UNSPEC_USHL_2S))] - { - operands[3] = gen_lowpart (QImode, operands[0]); - } + "" ) ;; Arithmetic right shift using SISD or Integer instruction