From patchwork Sun Aug 31 12:27:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Gray X-Patchwork-Id: 4815271 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0EA06C0338 for ; Sun, 31 Aug 2014 12:28:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3D5DF20107 for ; Sun, 31 Aug 2014 12:28:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0D065200F4 for ; Sun, 31 Aug 2014 12:28:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8780F89824; Sun, 31 Aug 2014 05:28:11 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org 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) Received: from carla.jsg.id.au (carla.jsg.id.au [192.168.1.42]) by lechuck.jsg.id.au (8.14.8/8.14.8) with ESMTP id s7VCRUEm011059; Sun, 31 Aug 2014 22:27:30 +1000 (EST) Received: from carla.jsg.id.au (localhost.jsg.id.au [127.0.0.1]) by carla.jsg.id.au (8.14.8/8.14.3) with ESMTP id s7VCRTLQ009411; Sun, 31 Aug 2014 22:27:29 +1000 (EST) Received: (from jsg@localhost) by carla.jsg.id.au (8.14.8/8.14.3/Submit) id s7VCRTJ3004519; Sun, 31 Aug 2014 22:27:29 +1000 (EST) Date: Sun, 31 Aug 2014 22:27:29 +1000 From: Jonathan Gray To: Chris Wilson , intel-gfx@lists.freedesktop.org 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-Disposition: inline In-Reply-To: <20140831105306.GB16746@nuc-i3427.alporthouse.com> User-Agent: Mutt/1.4.2.3i Subject: Re: [Intel-gfx] [PATCH xf86-video-intel] configure: check for cpuid.h X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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