From patchwork Tue Feb 15 18:22:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Meissner X-Patchwork-Id: 83277 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 430BDB7136 for ; Wed, 16 Feb 2011 05:25:09 +1100 (EST) Received: (qmail 4259 invoked by alias); 15 Feb 2011 18:25:07 -0000 Received: (qmail 4239 invoked by uid 22791); 15 Feb 2011 18:25:06 -0000 X-SWARE-Spam-Status: No, hits=-0.1 required=5.0 tests=AWL, BAYES_50, NO_DNS_FOR_FROM, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e1.ny.us.ibm.com (HELO e1.ny.us.ibm.com) (32.97.182.141) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 15 Feb 2011 18:25:01 +0000 Received: from d01dlp01.pok.ibm.com (d01dlp01.pok.ibm.com [9.56.224.56]) by e1.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p1FIDSwi032278; Tue, 15 Feb 2011 13:15:31 -0500 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id E3896728633; Tue, 15 Feb 2011 13:22:12 -0500 (EST) Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p1FIMCKN171822; Tue, 15 Feb 2011 13:22:12 -0500 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p1FIJmt1011572; Tue, 15 Feb 2011 11:19:48 -0700 Received: from hungry-tiger.westford.ibm.com (dyn9033037078.westford.ibm.com [9.33.37.78]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p1FIJmDM011540; Tue, 15 Feb 2011 11:19:48 -0700 Received: by hungry-tiger.westford.ibm.com (Postfix, from userid 500) id A186BF7C1D; Tue, 15 Feb 2011 13:22:10 -0500 (EST) Date: Tue, 15 Feb 2011 13:22:10 -0500 From: Michael Meissner To: gcc-patches@gcc.gnu.org, dje.gcc@gmail.com, bergner@gcc.gnu.org Subject: Re: [PATCH] Fix PR 47755 on powerpc, make vector constant of all 0's not generate a load instruction Message-ID: <20110215182210.GA7950@hungry-tiger.westford.ibm.com> Mail-Followup-To: Michael Meissner , gcc-patches@gcc.gnu.org, dje.gcc@gmail.com, bergner@gcc.gnu.org References: <20110215174926.GA6507@hungry-tiger.westford.ibm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110215174926.GA6507@hungry-tiger.westford.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Content-Scanned: Fidelis XPS MAILER 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 Here is a revised patch that explains the removal of TImode in easy_vector_constant in the ChangeLog. [gcc] 2011-02-15 Michael Meissner PR target/47755 * config/rs6000/predicates.md (easy_vector_constant): Allow V2DI mode for vector constants. Remove code that checks for TImode, since TImode is not a vector type, nor presently allowed in VSX and Altivec registers. [gcc/testsuite] 2011-02-15 Michael Meissner PR target/47755 * gcc.target/powerpc/pr47755.c: New file, test all 0 vector constant does not generate a load from memory. Index: gcc/config/rs6000/predicates.md =================================================================== --- gcc/config/rs6000/predicates.md (revision 170149) +++ gcc/config/rs6000/predicates.md (working copy) @@ -328,13 +328,11 @@ (define_predicate "easy_vector_constant" if (TARGET_PAIRED_FLOAT) return false; - if ((VSX_VECTOR_MODE (mode) || mode == TImode) && zero_constant (op, mode)) - return true; - - if (ALTIVEC_VECTOR_MODE (mode)) + if (VECTOR_MEM_ALTIVEC_OR_VSX_P (mode)) { if (zero_constant (op, mode)) - return true; + return true; + return easy_altivec_constant (op, mode); } Index: gcc/testsuite/gcc.target/powerpc/pr47755.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/pr47755.c (revision 0) +++ gcc/testsuite/gcc.target/powerpc/pr47755.c (revision 0) @@ -0,0 +1,16 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-options "-O3 -mcpu=power7" } */ +/* { dg-final { scan-assembler "xxlxor" } } */ +/* { dg-final { scan-assembler-not "lxvd2x" } } */ +/* { dg-final { scan-assembler-not "lxvw4x" } } */ +/* { dg-final { scan-assembler-not "lvx" } } */ + +/* PR 47755: Compiler loads vector constant of 0 from TOC instead of using + xxlxor. */ +void +func (vector long long *p) +{ + *p = (vector long long) { 0LL, 0LL }; +}