Gentoo Archives: gentoo-dev

From: Matt Turner <mattst88@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: CPU use flag detection
Date: Sat, 18 May 2013 19:15:03
Message-Id: CAEdQ38F5mvS9F=9jCuBx5D4AATX2q0i3jAeBWyoka96RErZy+Q@mail.gmail.com
In Reply to: [gentoo-dev] Re: CPU use flag detection by Ryan Hill
1 On Fri, May 17, 2013 at 9:39 PM, Ryan Hill <dirtyepic@g.o> wrote:
2 > On Wed, 15 May 2013 16:59:57 +0200
3 > yac <yac@g.o> wrote:
4 >
5 >> Hi,
6 >>
7 >> I was recently investigating what cpu flags do I have and how does it
8 >> work. I have put what I have so far at [1].
9 >>
10 >> So I thought I let you know in case someone wants to chip in.
11 >>
12 >> [1] https://github.com/yaccz/cufd
13 >
14 > I've seen gcc -Q --help=target giving false results before due to the way that
15 > options are parsed and some flags that set other flags not getting processed on
16 > the --help code path. The second option you list is better.
17 >
18 > -native doesn't set 3dnow, mmx, sse, sse2, sse3, ssse3 or sse4a. I'm guessing
19 > they're just handed through the -march setting.
20
21 Yes, they are.
22
23 > sys-apps/cpuid is awesome.
24 >
25 > MMX2/MMXEXT still confuses me.
26
27 SSE1 and /Enhanced/ 3DNow! added some extra MMX instructions. Some
28 (pshufw and pmulhuw particularly) turn out to be rather useful in
29 software compositing. I use them in the pixman MMX code.
30
31 See http://mattst88.com/programming/asmref/ (Sorry about the broken
32 search box. It works, you just don't see what you type)
33
34 Set Requires = Enhanced 3DNow!. The instructions that are listed as
35 'Enhanced 3DNow! or SSE1' are what are known as MMX2 or MMXEXT.
36
37 The particularly annoying thing about using them is that there's no
38 -mmmx2 or -mmmxext, but turning on -msse causes illegal instructions
39 to be generated for old AMD or Geode CPUs, while -m3dnow causes the
40 same problems for Intel CPUs. And, there's not actually even an
41 -m3dnowext flag (anymore?) anyway, so it's kind of a mess.

Replies

Subject Author
Re: [gentoo-dev] Re: CPU use flag detection Walter Dnes <waltdnes@××××××××.org>
[gentoo-dev] Re: CPU use flag detection Ryan Hill <dirtyepic@g.o>