From patchwork Mon Jul 2 06:59:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 168501 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 DF71A2C007E for ; Mon, 2 Jul 2012 17:00:22 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1341817223; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Subject:Message-ID:Reply-To: MIME-Version:Content-Type:Content-Disposition:User-Agent: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=AvXoP7AsZIEAVtiM8Nlf A1VlEHU=; b=beyt/5xB4AItamP9mWpVgd75bLb45q5bnPT1IDjKUQaLrM7bQntf S1iurRUFYpAHBEVUvb0hOcXAGlyYzN+VkYPkNOo+Xw+85qjKrR1UENfQEhhipSog 8vFYrNAxwnYTMqyk01cQp7BFOl0aL5vVqERbHCPYcFgM/CBg/TEOl24= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Date:From:To:Subject:Message-ID:Reply-To:MIME-Version:Content-Type:Content-Disposition:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=YvkAbZOsL5oFTgLXeMJHa10OLmi3vuqxgFCOWQjtnnRBW+Ua+VS1y+1gfYy/C0 RxB0zG6EVpAhBQG18kcw9ij3J4bpmvOppHkjSClXazdyKPLlReHWYtJdYFzGoLH2 nilMQ8stRzOnBfqydJ6cvYGBp8D3U6Jq5wBPw7IgjoL1c=; Received: (qmail 13611 invoked by alias); 2 Jul 2012 07:00:11 -0000 Received: (qmail 13575 invoked by uid 22791); 2 Jul 2012 07:00:07 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 02 Jul 2012 06:59:52 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q626xqRp015434 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 2 Jul 2012 02:59:52 -0400 Received: from zalov.redhat.com (vpn1-4-181.ams2.redhat.com [10.36.4.181]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q626xZBv018335 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 2 Jul 2012 02:59:43 -0400 Received: from zalov.cz (localhost [127.0.0.1]) by zalov.redhat.com (8.14.5/8.14.5) with ESMTP id q626xKvO017276 for ; Mon, 2 Jul 2012 08:59:22 +0200 Received: (from jakub@localhost) by zalov.cz (8.14.5/8.14.5/Submit) id q626xJA7017180 for gcc-patches@gcc.gnu.org; Mon, 2 Jul 2012 08:59:19 +0200 Date: Mon, 2 Jul 2012 08:59:17 +0200 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] Fix up can_vec_perm_p call in vector division lowering (PR tree-optimization/53645) Message-ID: <20120702065917.GF20264@tucnak.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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! As reported by Uros, the new testcase now fails with -mno-sse4. The problem is that can_vec_perm_p tests different permutation from what is actually expanded in the even/odd case (hi/lo is correct). The permutation is always done after VCE to the narrower type. Fixed thusly, committed as obvious. 2012-07-02 Jakub Jelinek PR tree-optimization/53645 * tree-vect-generic.c (expand_vector_divmod): Use TYPE_MODE (type) instead of TYPE_MODE (wider_type) as can_vec_perm_p argument. Jakub --- gcc/tree-vect-generic.c.jj 2012-06-29 21:39:32.000000000 +0200 +++ gcc/tree-vect-generic.c 2012-07-02 08:39:08.318530872 +0200 @@ -768,7 +768,7 @@ expand_vector_divmod (gimple_stmt_iterat { for (i = 0; i < nunits; i++) sel[i] = !BYTES_BIG_ENDIAN + (i & ~1) + ((i & 1) ? nunits : 0); - if (!can_vec_perm_p (TYPE_MODE (wider_type), false, sel)) + if (!can_vec_perm_p (TYPE_MODE (type), false, sel)) decl_e = decl_o = NULL_TREE; } else