From patchwork Tue Aug 16 14:20:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramana Radhakrishnan X-Patchwork-Id: 3472 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id DD87723F6B for ; Tue, 16 Aug 2011 14:20:51 +0000 (UTC) Received: from mail-ey0-f170.google.com (mail-ey0-f170.google.com [209.85.215.170]) by fiordland.canonical.com (Postfix) with ESMTP id D47F3A181C6 for ; Tue, 16 Aug 2011 14:20:51 +0000 (UTC) Received: by eyd10 with SMTP id 10so4682036eyd.29 for ; Tue, 16 Aug 2011 07:20:51 -0700 (PDT) Received: by 10.213.29.147 with SMTP id q19mr838807ebc.132.1313504451033; Tue, 16 Aug 2011 07:20:51 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.213.102.5 with SMTP id e5cs155576ebo; Tue, 16 Aug 2011 07:20:50 -0700 (PDT) Received: from mr.google.com ([10.150.239.16]) by 10.150.239.16 with SMTP id m16mr8068292ybh.281.1313504450704 (num_hops = 1); Tue, 16 Aug 2011 07:20:50 -0700 (PDT) Received: by 10.150.239.16 with SMTP id m16mr6055792ybh.281.1313504450058; Tue, 16 Aug 2011 07:20:50 -0700 (PDT) Received: from mail-gx0-f178.google.com (mail-gx0-f178.google.com [209.85.161.178]) by mx.google.com with ESMTPS id g20si288952ybf.74.2011.08.16.07.20.49 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 16 Aug 2011 07:20:50 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.161.178 is neither permitted nor denied by best guess record for domain of ramana.radhakrishnan@linaro.org) client-ip=209.85.161.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.161.178 is neither permitted nor denied by best guess record for domain of ramana.radhakrishnan@linaro.org) smtp.mail=ramana.radhakrishnan@linaro.org Received: by gxk8 with SMTP id 8so4135132gxk.37 for ; Tue, 16 Aug 2011 07:20:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.42.162.69 with SMTP id w5mr5994059icx.243.1313504447590; Tue, 16 Aug 2011 07:20:47 -0700 (PDT) Received: by 10.231.38.10 with HTTP; Tue, 16 Aug 2011 07:20:47 -0700 (PDT) Date: Tue, 16 Aug 2011 15:20:47 +0100 Message-ID: Subject: [Patch ARM] Fix vec_pack_trunc pattern for vectorize_with_neon_quad. From: Ramana Radhakrishnan To: gcc-patches Cc: Patch Tracking , Ira Rosen Hi, While looking at a failure with regrename and mvectorize-with-neon-quad I noticed that the early-clobber in this vec_pack_trunc pattern is superfluous given that we can use reg_overlap_mentioned_p to decide in which order we want to emit these 2 instructions. While it works around the problem in regrename.c I still think that the behaviour in regrename is a bit suspicious and needs some more investigation. Refer to my post on gcc@ for more on that particular case. http://gcc.gnu.org/ml/gcc/2011-08/msg00284.html I am currently running tests with Ira's patch of this morning http://gcc.gnu.org/ml/gcc-patches/2011-08/msg01304.html that turns on mvectorize-with-neon-quad by default to make sure there are no regressions. Will commit if no regressions. cheers Ramana 2011-08-16 Ramana Radhakrishnan * config/arm/neon.md (vec_pack_trunc_ VN): Remove early-clobber. Adjust output template for overlap checks. diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md index 24dd941..06c699a 100644 --- a/gcc/config/arm/neon.md +++ b/gcc/config/arm/neon.md @@ -5631,14 +5631,19 @@ ; the semantics of the instructions require. (define_insn "vec_pack_trunc_" - [(set (match_operand: 0 "register_operand" "=&w") + [(set (match_operand: 0 "register_operand" "=w") (vec_concat: (truncate: (match_operand:VN 1 "register_operand" "w")) (truncate: (match_operand:VN 2 "register_operand" "w"))))] "TARGET_NEON && !BYTES_BIG_ENDIAN" - "vmovn.i\t%e0, %q1\;vmovn.i\t%f0, %q2" + { + if (reg_overlap_mentioned_p (operands[0], operands[1])) + return "vmovn.i\t%e0, %q1\;vmovn.i\t%f0, %q2"; + else + return "vmovn.i\t%f0, %q2\;vmovn.i\t%e0, %q1"; + } [(set_attr "neon_type" "neon_shift_1") (set_attr "length" "8")] )