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: 110187 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 1A1B8B6F7C for ; Wed, 17 Aug 2011 00:21:12 +1000 (EST) Received: (qmail 20468 invoked by alias); 16 Aug 2011 14:21:09 -0000 Received: (qmail 20457 invoked by uid 22791); 16 Aug 2011 14:21:08 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-iy0-f175.google.com (HELO mail-iy0-f175.google.com) (209.85.210.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 16 Aug 2011 14:20:49 +0000 Received: by iyn15 with SMTP id 15so10347439iyn.34 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 X-IsSubscribed: yes 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 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")] )