From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Gray Subject: Re: [PATCH xf86-video-intel] configure: check for cpuid.h Date: Sun, 31 Aug 2014 22:27:29 +1000 Message-ID: <20140831122729.GA22706@mail.netspace.net.au> References: <1409474936-1867-1-git-send-email-jsg@jsg.id.au> <20140831105306.GB16746@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from lechuck.jsg.id.au (jsg.id.au [210.15.216.215]) by gabe.freedesktop.org (Postfix) with ESMTP id 02F8389824 for ; Sun, 31 Aug 2014 05:28:09 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20140831105306.GB16746@nuc-i3427.alporthouse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Chris Wilson , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Sun, Aug 31, 2014 at 11:53:06AM +0100, Chris Wilson wrote: > On Sun, Aug 31, 2014 at 06:48:56PM +1000, Jonathan Gray wrote: > > Instead of checking for a particular version of GCC check for > > a cpuid.h with __cpuid_count. This allows cpuid.h to be > > provided for older/different compilers. > > > > Signed-off-by: Jonathan Gray > > I didn't have much luck last time I tried with clang, but this seems to > still work for me, so pushed. > > To ssh://git.freedesktop.org/git/xorg/driver/xf86-video-intel > 2086965..2c564c0 master -> master > -Chris Thanks, the particular case I have in mind is adding the clang cpuid.h to gcc 4.2.1 for OpenBSD as cpuid.h is needed for Mesa and a few other things as well. http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/cpuid.h?revision=197399&view=co The clang cpuid.h has all of the functions used it just needs some small changes for bit values along the lines of the following patch. These aren't needed for xf86-video-intel and Mesa as bit values are defined in each project. --- cpuid.h.orig Sun Aug 31 22:15:36 2014 +++ cpuid.h Sun Aug 31 22:15:46 2014 @@ -44,7 +44,9 @@ #define bit_PCID 0x00020000 #define bit_DCA 0x00040000 #define bit_SSE41 0x00080000 +#define bit_SSE4_1 bit_SSE41 /* for gcc compat */ #define bit_SSE42 0x00100000 +#define bit_SSE4_2 bit_SSE42 /* for gcc compat */ #define bit_x2APIC 0x00200000 #define bit_MOVBE 0x00400000 #define bit_POPCNT 0x00800000 @@ -89,6 +91,7 @@ /* Features in %ebx for level 7 sub-leaf 0 */ #define bit_FSGSBASE 0x00000001 +#define bit_AVX2 0x00000020 #define bit_SMEP 0x00000080 #define bit_ENH_MOVSB 0x00000200