From patchwork Mon Jul 22 23:05:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 260833 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 A7D652C0089 for ; Tue, 23 Jul 2013 09:05:34 +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=Jhl e6kAnkZrS57GkzwpsfjrCFNIzX20BFCEmN9sXE9f0ztVmeu9o6iql6zvmEd/JriT WMbfNYDHvyCbflCGKiEojiBWDaXnHvGdkCS/9pjhrM2nxsRuvPNGnl9z9ahEHo8I z+FytP7HUj6qRVZ5gpXh/t6sQuLLfRJ7/zPFSeIE= 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=Y2bPVYnNW ZyeQ3XzkJIHhnU50OM=; b=MYnfVcpi+mHKOuwVViSjUsIEpMRL6D8TldePhkCVj M/Gjawuy9kXyskgO/QVVvcyZHJ2ClDgHAjV8ERt/bvAzTCz4zyRM5ll8lJFhD0Zq 6JDQl5RISoJVjDMAXszGGyhN+ZXdQsvHQN+xedFrPJD0BEu4QtrM3Exkf1wu0r5+ fM= Received: (qmail 14722 invoked by alias); 22 Jul 2013 23:05:26 -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 14713 invoked by uid 89); 22 Jul 2013 23:05:25 -0000 X-Spam-SWARE-Status: No, score=-3.1 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 e28smtp05.in.ibm.com) (122.248.162.5) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 22 Jul 2013 23:05:25 +0000 Received: from /spool/local by e28smtp05.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 23 Jul 2013 04:29:29 +0530 Received: from d28dlp03.in.ibm.com (9.184.220.128) by e28smtp05.in.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 23 Jul 2013 04:29:27 +0530 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 08F421258051; Tue, 23 Jul 2013 04:34:34 +0530 (IST) Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6MN60hN45219842; Tue, 23 Jul 2013 04:36:00 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r6MN58W2022902; Mon, 22 Jul 2013 23:05:08 GMT Received: from [9.57.65.224] ([9.57.65.224]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r6MN56eK022825; Mon, 22 Jul 2013 23:05:07 GMT Message-ID: <1374534309.3633.96.camel@gnopaine> Subject: [PATCH, PowerPC] altivec_expand_vec_perm_const reverses pack pattern arguments in little endian mode From: Bill Schmidt To: gcc-patches@gcc.gnu.org Cc: dje@gcc.gnu.org Date: Mon, 22 Jul 2013 18:05:09 -0500 Mime-Version: 1.0 X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13072222-8256-0000-0000-0000087518A3 This patch is another fix for vector handling in little endian mode. The first two operands for a pack pattern are two vector registers that form a contiguous array of inputs. In LE mode the order of the operands must be reversed so that the array remains contiguous in the reverse order. This fixes a failure in the testsuite when run little-endian (gcc.dg/vect/no-scevccp-outer-18.c). Bootstrapped and tested big-endian on powerpc64-unknown-linux-gnu with no new regressions. Ok for trunk? Patch by Anton Blanchard. Thanks, Bill 2013-07-22 Bill Schmidt Anton Blanchard * config/rs6000/rs6000.c (altivec_expand_vec_perm_const): Reverse two operands for little-endian. Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 201131) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -28526,7 +28529,12 @@ altivec_expand_vec_perm_const (rtx operands[4]) x = target; else x = gen_reg_rtx (omode); - emit_insn (GEN_FCN (icode) (x, op0, op1)); + /* For little-endian, the two input operands must be swapped + to ensure proper right-to-left numbering from 0 to 2N-1. */ + if (BYTES_BIG_ENDIAN) + emit_insn (GEN_FCN (icode) (x, op0, op1)); + else + emit_insn (GEN_FCN (icode) (x, op1, op0)); if (omode != V16QImode) emit_move_insn (target, gen_lowpart (V16QImode, x)); return true;