From patchwork Tue Jul 23 17:10:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 261161 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id A9DD42C00D6 for ; Wed, 24 Jul 2013 03:11:12 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:cc:date:content-type :content-transfer-encoding:mime-version; q=dns; s=default; b=KT1 n91qatwVfjjb7BM/RbfSTktzVReqmo09KuITCx3pcNNAsd+NzohyZRRCX7mpq+E6 bzV9EGPGBSk7shctxx1YkxZL9Z0ubAW4VH81imk2jpjMBnYRW91Pdm53g7X+tnpR jmqh1izKIT0MFpohJJO79n1ht827I4q08/oZdGyI= 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 :message-id:subject:from:to:cc:date:content-type :content-transfer-encoding:mime-version; s=default; bh=NGlsdLvab Ic9ImY6jc4fFqYOAII=; b=JKlukoHqcgZcAqWispqxnLHGmfZSOw4YNvsKiNhMJ +X+BhuX4lxhifbvf6HULgNngXTwbtqzY5tONgvePGtR1PaCK400kGRay/jXHtMit gjlpKAxfm1leEVJk6n3D068i3LxOARVsOlKQ2jQqLikWEMDq/Uld4ivgS2aTlejk lU= Received: (qmail 30734 invoked by alias); 23 Jul 2013 17:11:02 -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 30709 invoked by uid 89); 23 Jul 2013 17:11:02 -0000 X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_MED, RCVD_IN_HOSTKARMA_W, RDNS_NONE autolearn=unavailable version=3.3.1 Received: from Unknown (HELO e28smtp01.in.ibm.com) (122.248.162.1) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 23 Jul 2013 17:11:00 +0000 Received: from /spool/local by e28smtp01.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 23 Jul 2013 22:32:54 +0530 Received: from d28dlp01.in.ibm.com (9.184.220.126) by e28smtp01.in.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 23 Jul 2013 22:32:53 +0530 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id 63EAAE0054; Tue, 23 Jul 2013 22:40:47 +0530 (IST) Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6NHBckD20054184; Tue, 23 Jul 2013 22:41:38 +0530 Received: from d28av02.in.ibm.com (loopback [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r6NHAkng028459; Wed, 24 Jul 2013 03:10:46 +1000 Received: from [9.57.65.224] ([9.57.65.224]) by d28av02.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r6NHAioY028410; Wed, 24 Jul 2013 03:10:45 +1000 Message-ID: <1374599446.3633.113.camel@gnopaine> Subject: [PATCH, PowerPC] altivec_expand_vec_perm_const selects wrong field for splat in LE mode From: Bill Schmidt To: gcc-patches@gcc.gnu.org Cc: dje@gcc.gnu.org Date: Tue, 23 Jul 2013 12:10:46 -0500 Mime-Version: 1.0 X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13072317-4790-0000-0000-0000096CC758 This patch fixes another small little-endian problem with vectors on PowerPC. Element numbering is reversed when selecting a field for a vector splat operation. Fixing this removes a regression from the test suite when run in LE mode (gcc.dg/vect/slp-perm-3.c). Patch by Anton Blanchard. Bootstrapped and tested on powerpc64-unknown-linux-gnu with no new regressions. Ok for trunk? Thanks, Bill 2013-07-23 Bill Schmidt Anton Blanchard * config/rs6000/rs6000.c (altivec_expand_vec_perm_const): Correct selection of field for vector splat in little endian mode. Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 201149) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -28460,9 +28460,10 @@ altivec_expand_vec_perm_const (rtx operands[4]) break; if (i == 16) { + int field = BYTES_BIG_ENDIAN ? elt / 2 : 7 - elt / 2; x = gen_reg_rtx (V8HImode); emit_insn (gen_altivec_vsplth (x, gen_lowpart (V8HImode, op0), - GEN_INT (elt / 2))); + GEN_INT (field))); emit_move_insn (target, gen_lowpart (V16QImode, x)); return true; } @@ -28478,9 +28479,10 @@ altivec_expand_vec_perm_const (rtx operands[4]) break; if (i == 16) { + int field = BYTES_BIG_ENDIAN ? elt / 4 : 3 - elt / 4; x = gen_reg_rtx (V4SImode); emit_insn (gen_altivec_vspltw (x, gen_lowpart (V4SImode, op0), - GEN_INT (elt / 4))); + GEN_INT (field))); emit_move_insn (target, gen_lowpart (V16QImode, x)); return true; }