From: Jonathan Gray <jsg@jsg.id.au>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH xf86-video-intel] configure: check for cpuid.h
Date: Sun, 31 Aug 2014 22:27:29 +1000 [thread overview]
Message-ID: <20140831122729.GA22706@mail.netspace.net.au> (raw)
In-Reply-To: <20140831105306.GB16746@nuc-i3427.alporthouse.com>
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 <jsg@jsg.id.au>
>
> 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
prev parent reply other threads:[~2014-08-31 12:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-31 8:48 [PATCH xf86-video-intel] configure: check for cpuid.h Jonathan Gray
2014-08-31 10:53 ` Chris Wilson
2014-08-31 12:27 ` Jonathan Gray [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140831122729.GA22706@mail.netspace.net.au \
--to=jsg@jsg.id.au \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox