From patchwork Sun Feb 16 16:18:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 320781 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B52152C0099 for ; Mon, 17 Feb 2014 03:19:00 +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=PaW L+68RtYDkXQRje0EymIyXsoTnakIjJvMfy1RFrhAgDXNB64EIVaZxmgkyoW/Ljwn gyqgr0Fj0S39gxDEUz1x2zVYlDTwhW1gj6SIyVOOJxs4zMkPhArI2Sg7jfqmpjZs NUqOWH3/g9ZTI60a8qd1tMgkIHm/sMZkLlS7TFqk= 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=uW0xGhEjn SwdNOZPg1M9w0DjmHI=; b=UqE1dQH/d8FuJLW+UfHN6daCJwxNN3rMvnLIBly+T TOb68dVBvF/rft6+z2GH22N4isO92fUWSk0Pp9wddik/fZwg18UDvNFvk+WGFzCc ZyQ8ABCWNDY8iVcFpmmbZUMIFxpV6wSc/pzszEuOtcGGp+xTm07qBxnv4Oo8pOuv U0= Received: (qmail 13588 invoked by alias); 16 Feb 2014 16:18:52 -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 13578 invoked by uid 89); 16 Feb 2014 16:18:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.7 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e23smtp05.au.ibm.com Received: from e23smtp05.au.ibm.com (HELO e23smtp05.au.ibm.com) (202.81.31.147) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sun, 16 Feb 2014 16:18:50 +0000 Received: from /spool/local by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 17 Feb 2014 02:18:45 +1000 Received: from d23dlp03.au.ibm.com (202.81.31.214) by e23smtp05.au.ibm.com (202.81.31.211) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 17 Feb 2014 02:18:44 +1000 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [9.190.235.152]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id B47FE3578054 for ; Mon, 17 Feb 2014 03:18:43 +1100 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s1GFx1ZH8323340 for ; Mon, 17 Feb 2014 02:59:01 +1100 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s1GGIhZC007063 for ; Mon, 17 Feb 2014 03:18:43 +1100 Received: from [9.77.137.133] (sig-9-77-137-133.mts.ibm.com [9.77.137.133]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s1GGId3p007023; Mon, 17 Feb 2014 03:18:41 +1100 Message-ID: <1392567538.20991.17.camel@gnopaine> Subject: [PATCH, rs6000] Fix powerpc64le-linux bootstrap failure with -mcpu=power8 From: Bill Schmidt To: gcc-patches@gcc.gnu.org Cc: dje.gcc@gmail.com Date: Sun, 16 Feb 2014 10:18:58 -0600 Mime-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14021616-1396-0000-0000-0000044CF9E4 X-IsSubscribed: yes Hi, Now that I have Power8 hardware to test on, I've discovered that I introduced a problem with http://gcc.gnu.org/ml/gcc-patches/2014-01/msg01547.html that causes a bootstrap failure when specifying -mcpu=power8. I moved some logic from rs6000_expand_vec_perm_const_1 into vsx_xxpermdi2__1. I failed to notice there is another path into vsx_xxpermdi2__1 that is exercised during the bootstrap. To avoid the problem, this patch adjusts the code generated along this other path so that the later transformation will be correct. Bootstrapped and tested on powerpc64{,le}-unknown-linux-gnu configured both with -mcpu=power7 and with -mcpu=power8 with no regressions. The Power8 LE bootstrap now completes cleanly. Is this ok for trunk? Thanks, Bill 2014-02-16 Bill Schmidt * config/rs6000/vsx.md (vsx_xxpermdi_): Handle little endian targets. Index: gcc/config/rs6000/vsx.md =================================================================== --- gcc/config/rs6000/vsx.md (revision 207809) +++ gcc/config/rs6000/vsx.md (working copy) @@ -1621,7 +1621,18 @@ op1 = gen_lowpart (V2DImode, op1); } } - emit_insn (gen (target, op0, op1, perm0, perm1)); + /* In little endian mode, vsx_xxpermdi2__1 will perform a + transformation we don't want; it is necessary for + rs6000_expand_vec_perm_const_1 but not for this use. So we + prepare for that by reversing the transformation here. */ + if (BYTES_BIG_ENDIAN) + emit_insn (gen (target, op0, op1, perm0, perm1)); + else + { + rtx p0 = GEN_INT (3 - INTVAL (perm1)); + rtx p1 = GEN_INT (3 - INTVAL (perm0)); + emit_insn (gen (target, op1, op0, p0, p1)); + } DONE; })