From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115583 invoked by alias); 29 Apr 2015 13:21:38 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 115564 invoked by uid 89); 29 Apr 2015 13:21:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-ig0-f175.google.com Received: from mail-ig0-f175.google.com (HELO mail-ig0-f175.google.com) (209.85.213.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 29 Apr 2015 13:21:36 +0000 Received: by igbhj9 with SMTP id hj9so48102714igb.1 for ; Wed, 29 Apr 2015 06:21:34 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.43.97.130 with SMTP id ck2mr3363661icc.91.1430313694079; Wed, 29 Apr 2015 06:21:34 -0700 (PDT) Received: by 10.36.108.21 with HTTP; Wed, 29 Apr 2015 06:21:34 -0700 (PDT) In-Reply-To: <1425500052.2996.15.camel@gnopaine> References: <1425500052.2996.15.camel@gnopaine> Date: Wed, 29 Apr 2015 13:27:00 -0000 Message-ID: Subject: Re: [PATCH,rs6000] Change -mcrypto to only affect Category:Vector.Crypto instructions From: David Edelsohn To: Bill Schmidt Cc: GCC Patches Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2015-04/txt/msg01873.txt.bz2 On Wed, Mar 4, 2015 at 3:14 PM, Bill Schmidt wrote: > Hi, > > I recently observed that -mno-crypto disables all instructions in > section 5.11 of the 2.07 ISA, rather than just those flagged as > Category:Vector.Crypto. This patch fixes that undesirable situation. > > The main fix is to ensure the remaining instructions are gated by > TARGET_P8_VECTOR rather than TARGET_CRYPTO. This leaves us in a > somewhat ugly state where we have builtins named __builtin_crypto_* that > are not controlled by -mcrypto. However, we have to keep support for > these existing builtins. As discussed elsewhere, the longer-term plan > is to implement a different common naming scheme for these builtins > across all POWER compilers, at which point the __builtin_crypto_* forms > will be deprecated. > > The changes to rs6000-builtin.def aren't the prettiest in the world, but > were the best I could think of that continues support for the existing > builtins while changing their predicates. Let me know if there's a > better way. > > Ok for trunk once GCC 5 branches? I would eventually like to fix this > in 4.8, 4.9, and 5 as well. > Index: gcc/testsuite/gcc.target/powerpc/crypto-builtin-2.c > =================================================================== > --- gcc/testsuite/gcc.target/powerpc/crypto-builtin-2.c (revision 0) > +++ gcc/testsuite/gcc.target/powerpc/crypto-builtin-2.c (working copy) > @@ -0,0 +1,36 @@ > +/* { dg-do compile { target { powerpc*-*-* } } } */ > +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ > +/* { dg-require-effective-target powerpc_vsx_ok } */ > +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ > +/* { dg-options "-O2 -mcpu=power8 -mno-crypto" } */ Bill, I think this test criterion is wrong and should be Index: crypto-builtin-2.c =================================================================== --- crypto-builtin-2.c (revision 222534) +++ crypto-builtin-2.c (working copy) @@ -1,6 +1,6 @@ /* { dg-do compile { target { powerpc*-*-* } } } */ /* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ -/* { dg-require-effective-target powerpc_vsx_ok } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */ /* { dg-options "-O2 -mcpu=power8 -mno-crypto" } */ Thoughts? - David