From patchwork Thu Jul 19 12:13:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 171945 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 9DD302C00A2 for ; Thu, 19 Jul 2012 22:13:57 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1343304838; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:In-Reply-To:References:Date: Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=cXgk2Pm3AnY5aa0NIF2A49glZIk=; b=C50XGZ1GVkVwwcQMmWVg3aYTCmPzj84m+AxCPXg/a31DPScanvNjDgcwX+x2PO OIl+Wy/EWS6q33rW+MXUm3wOVotXe/uNKkpo7rOaCe7i5hDJT4mrtzh1ky4oj/zu zybLJMlzmEOpQh34x+iEHg6a1K0Jf6T9CqgTW66WsmffU= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=C8Q8GXpmJ8zTzieK+DdgeOQkRPXeawUlwYWiYb2R2T2dsZ6U1w1ccgBn469bZQ hsmQK34F9ZwwLTbIt+Oon1hSEgh6R9VAFxNofWaC5nwUqEh+O41s4ovsYsKZj5Ok LKRtiCofsFFnUrI45bT+A7PDYL0UpzWC7jh4QloHAyti0=; Received: (qmail 1015 invoked by alias); 19 Jul 2012 12:13:51 -0000 Received: (qmail 1007 invoked by uid 22791); 19 Jul 2012 12:13:50 -0000 X-SWARE-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-yx0-f175.google.com (HELO mail-yx0-f175.google.com) (209.85.213.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 19 Jul 2012 12:13:37 +0000 Received: by yenl13 with SMTP id l13so2772813yen.20 for ; Thu, 19 Jul 2012 05:13:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.66.79.195 with SMTP id l3mr3387129pax.33.1342700016305; Thu, 19 Jul 2012 05:13:36 -0700 (PDT) Received: by 10.66.11.130 with HTTP; Thu, 19 Jul 2012 05:13:36 -0700 (PDT) In-Reply-To: <20120719095116.GB13076@tucnak.redhat.com> References: <20120719091042.GK9077@tucnak.redhat.com> <20120719095116.GB13076@tucnak.redhat.com> Date: Thu, 19 Jul 2012 14:13:36 +0200 Message-ID: Subject: Re: [PATCH] Intrinsics for ADCX, ADOX, RDSEED and PREFETCHW From: Uros Bizjak To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org, Michael Zolotukhin , Kirill Yukhin , "H.J. Lu" 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 On Thu, Jul 19, 2012 at 11:51 AM, Jakub Jelinek wrote: > I think it is fine to change existing mm3dnow.h header, but not in the way > it has been changed in the patch. The thing is that unlike the newly added > intrinsics headers, mm3dnow.h is still publicly includable header, and just > including that header should work properly, so mm3dnow.h has to include > prftchwintrin.h, which should be allowed to be included from x86intrin.h > as well as mm3dnow.h, and that header should have guards, so that if both > x86intrin.h is included and mm3dnow.h too (the latter first), > prftchwintrin.h isn't included in twice. Probably something like attached patch, with following changes to the original patch: +#if !defined _X86INTRIN_H_INCLUDED && !defined _IMMINTRIN_H_INCLUDED +# error "Never use directly; include instead." +#endif No need to check for _IMMINTRIN_H_INCLUDED (in all new headers). In config/i386/prfchwintrin.h, change this part to: +#if !defined _X86INTRIN_H_INCLUDED && !defined _MM3DNOW_H_INCLUDED +# error "Never use directly; include or instead." +#endif Uros. Index: mm3dnow.h =================================================================== --- mm3dnow.h (revision 189643) +++ mm3dnow.h (working copy) @@ -30,6 +30,7 @@ #ifdef __3dNOW__ #include +#include extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_femms (void) @@ -157,12 +158,6 @@ __builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */); } -extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) -_m_prefetchw (void *__P) -{ - __builtin_prefetch (__P, 1, 3 /* _MM_HINT_T0 */); -} - extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _m_from_float (float __A) { Index: x86intrin.h =================================================================== --- x86intrin.h (revision 189643) +++ x86intrin.h (working copy) @@ -97,4 +97,8 @@ #include #endif +#ifdef __PRFCHW__ +#include +#endif + #endif /* _X86INTRIN_H_INCLUDED */