From patchwork Fri Nov 22 00:27:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 293280 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A6F1A2C00C6 for ; Fri, 22 Nov 2013 11:27:55 +1100 (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=c2I hXdULnX0z2hw8mQidlHYwoJZg62dRSlFZTu5yvg19KwPGtjbOv0ll3gZCR5/3Rai ajdZmmKXB8IAviTgp/2YmvvwIgH/z46/riVXWXoNi+FXcw4OnH0/G75cPWtb2JQi EAJocHAiZnNlEg8pL9J/PO3gM6+1he3Fsotd2uqE= 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=7Q7hQ4Q5B QS7x5yyaJoBR5YF1BY=; b=QX4dtAPkrVcwpxAVv2LAbi8Cdz/Lulw99MbogKHI4 zwAcxiUJIBPWBlKMY30naGjoGhxUJeL4x0mgJ5QdPkyq55JDJsyfUxd8LhcgE5r7 jCKQrhNsVHfhoKpyzCwlZQmvPHkSzVsuFrxJG0Pbe/6sDRaR07iyz2YbVjDOD/vz 48= Received: (qmail 13123 invoked by alias); 22 Nov 2013 00:27:45 -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 13113 invoked by uid 89); 22 Nov 2013 00:27:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_50, RDNS_NONE, URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: e28smtp03.in.ibm.com Received: from Unknown (HELO e28smtp03.in.ibm.com) (122.248.162.3) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 22 Nov 2013 00:27:43 +0000 Received: from /spool/local by e28smtp03.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 22 Nov 2013 05:57:30 +0530 Received: from d28dlp03.in.ibm.com (9.184.220.128) by e28smtp03.in.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 22 Nov 2013 05:57:29 +0530 Received: from d28relay02.in.ibm.com (d28relay02.in.ibm.com [9.184.220.59]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id E0F021258051 for ; Fri, 22 Nov 2013 05:58:23 +0530 (IST) Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rAM0RLxu50528384 for ; Fri, 22 Nov 2013 05:57:22 +0530 Received: from d28av05.in.ibm.com (localhost [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rAM0RRvS015353 for ; Fri, 22 Nov 2013 05:57:27 +0530 Received: from [9.49.137.174] (sig-9-49-137-174.mts.ibm.com [9.49.137.174]) by d28av05.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id rAM0RPOY015327; Fri, 22 Nov 2013 05:57:26 +0530 Message-ID: <1385080047.30314.13.camel@gnopaine> Subject: [PATCH, rs6000] More vector LE cleanups From: Bill Schmidt To: gcc-patches@gcc.gnu.org Cc: dje.gcc@gmail.com Date: Thu, 21 Nov 2013 18:27:27 -0600 Mime-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13112200-3864-0000-0000-00000B2FFE55 X-IsSubscribed: yes Hi, This patch fixes two issues to allow correct compilation of gcc.dg/torture/vec-cvt-1.c in little endian mode. The first reverts a change in three patterns in vector.md. This is from an early patch that preceded the general fix for vector permutes. As a consequence we ended up swapping the input arguments twice. So we can simplify the code here and have it operate the same for big and little endian. The other issue corrects a scenario where I managed to check for endianness twice, with the effect that the code acts the same for both big and little endian when it shouldn't. Bootstrapped and tested on powerpc64{,le}-unknown-linux-gnu with no regressions. Is this ok for trunk? Thanks, Bill 2013-11-21 Bill Schmidt * config/rs6000/vector.md (vec_pack_trunc_v2df): Revert previous little endian change. (vec_pack_sfix_trunc_v2df): Likewise. (vec_pack_ufix_trunc_v2df): Likewise. * config/rs6000/rs6000.c (rs6000_expand_interleave): Correct double checking of endianness. Index: gcc/config/rs6000/vector.md =================================================================== --- gcc/config/rs6000/vector.md (revision 205145) +++ gcc/config/rs6000/vector.md (working copy) @@ -831,12 +831,7 @@ emit_insn (gen_vsx_xvcvdpsp (r1, operands[1])); emit_insn (gen_vsx_xvcvdpsp (r2, operands[2])); - - if (BYTES_BIG_ENDIAN) - rs6000_expand_extract_even (operands[0], r1, r2); - else - rs6000_expand_extract_even (operands[0], r2, r1); - + rs6000_expand_extract_even (operands[0], r1, r2); DONE; }) @@ -851,12 +846,7 @@ emit_insn (gen_vsx_xvcvdpsxws (r1, operands[1])); emit_insn (gen_vsx_xvcvdpsxws (r2, operands[2])); - - if (BYTES_BIG_ENDIAN) - rs6000_expand_extract_even (operands[0], r1, r2); - else - rs6000_expand_extract_even (operands[0], r2, r1); - + rs6000_expand_extract_even (operands[0], r1, r2); DONE; }) @@ -871,12 +861,7 @@ emit_insn (gen_vsx_xvcvdpuxws (r1, operands[1])); emit_insn (gen_vsx_xvcvdpuxws (r2, operands[2])); - - if (BYTES_BIG_ENDIAN) - rs6000_expand_extract_even (operands[0], r1, r2); - else - rs6000_expand_extract_even (operands[0], r2, r1); - + rs6000_expand_extract_even (operands[0], r1, r2); DONE; }) Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 205145) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -30116,7 +30116,7 @@ rs6000_expand_interleave (rtx target, rtx op0, rtx unsigned i, high, nelt = GET_MODE_NUNITS (vmode); rtx perm[16]; - high = (highp == BYTES_BIG_ENDIAN ? 0 : nelt / 2); + high = (highp ? 0 : nelt / 2); for (i = 0; i < nelt / 2; i++) { perm[i * 2] = GEN_INT (i + high);