public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] CPU use flag detection
@ 2013-05-15 14:59 yac
  2013-05-18  4:39 ` [gentoo-dev] " Ryan Hill
  0 siblings, 1 reply; 9+ messages in thread
From: yac @ 2013-05-15 14:59 UTC (permalink / raw
  To: gentoo-dev

Hi,

I was recently investigating what cpu flags do I have and how does it
work. I have put what I have so far at [1]. 

So I thought I let you know in case someone wants to chip in.

[1] https://github.com/yaccz/cufd


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gentoo-dev] Re: CPU use flag detection
  2013-05-15 14:59 [gentoo-dev] CPU use flag detection yac
@ 2013-05-18  4:39 ` Ryan Hill
  2013-05-18 19:14   ` Matt Turner
  0 siblings, 1 reply; 9+ messages in thread
From: Ryan Hill @ 2013-05-18  4:39 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 893 bytes --]

On Wed, 15 May 2013 16:59:57 +0200
yac <yac@gentoo.org> wrote:

> Hi,
> 
> I was recently investigating what cpu flags do I have and how does it
> work. I have put what I have so far at [1]. 
> 
> So I thought I let you know in case someone wants to chip in.
> 
> [1] https://github.com/yaccz/cufd

I've seen gcc -Q --help=target giving false results before due to the way that
options are parsed and some flags that set other flags not getting processed on
the --help code path.  The second option you list is better.

-native doesn't set 3dnow, mmx, sse, sse2, sse3, ssse3 or sse4a.  I'm guessing
they're just handed through the -march setting.

sys-apps/cpuid is awesome.

MMX2/MMXEXT still confuses me.


-- 
Ryan Hill                        psn: dirtyepic_sk
   gcc-porting/toolchain/wxwidgets @ gentoo.org

47C3 6D62 4864 0E49 8E9E  7F92 ED38 BD49 957A 8463

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] Re: CPU use flag detection
  2013-05-18  4:39 ` [gentoo-dev] " Ryan Hill
@ 2013-05-18 19:14   ` Matt Turner
  2013-05-19  2:31     ` Walter Dnes
  2013-05-22  4:59     ` Ryan Hill
  0 siblings, 2 replies; 9+ messages in thread
From: Matt Turner @ 2013-05-18 19:14 UTC (permalink / raw
  To: gentoo-dev

On Fri, May 17, 2013 at 9:39 PM, Ryan Hill <dirtyepic@gentoo.org> wrote:
> On Wed, 15 May 2013 16:59:57 +0200
> yac <yac@gentoo.org> wrote:
>
>> Hi,
>>
>> I was recently investigating what cpu flags do I have and how does it
>> work. I have put what I have so far at [1].
>>
>> So I thought I let you know in case someone wants to chip in.
>>
>> [1] https://github.com/yaccz/cufd
>
> I've seen gcc -Q --help=target giving false results before due to the way that
> options are parsed and some flags that set other flags not getting processed on
> the --help code path.  The second option you list is better.
>
> -native doesn't set 3dnow, mmx, sse, sse2, sse3, ssse3 or sse4a.  I'm guessing
> they're just handed through the -march setting.

Yes, they are.

> sys-apps/cpuid is awesome.
>
> MMX2/MMXEXT still confuses me.

SSE1 and /Enhanced/ 3DNow! added some extra MMX instructions. Some
(pshufw and pmulhuw particularly) turn out to be rather useful in
software compositing. I use them in the pixman MMX code.

See http://mattst88.com/programming/asmref/ (Sorry about the broken
search box. It works, you just don't see what you type)

Set Requires = Enhanced 3DNow!. The instructions that are listed as
'Enhanced 3DNow! or SSE1' are what are known as MMX2 or MMXEXT.

The particularly annoying thing about using them is that there's no
-mmmx2 or -mmmxext, but turning on -msse causes illegal instructions
to be generated for old AMD or Geode CPUs, while -m3dnow causes the
same problems for Intel CPUs. And, there's not actually even an
-m3dnowext flag (anymore?) anyway, so it's kind of a mess.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] Re: CPU use flag detection
  2013-05-18 19:14   ` Matt Turner
@ 2013-05-19  2:31     ` Walter Dnes
  2013-05-19 15:47       ` Alexis Ballier
  2013-05-22  4:59     ` Ryan Hill
  1 sibling, 1 reply; 9+ messages in thread
From: Walter Dnes @ 2013-05-19  2:31 UTC (permalink / raw
  To: gentoo-dev

On Sat, May 18, 2013 at 12:14:35PM -0700, Matt Turner wrote

> The particularly annoying thing about using them is that there's no
> -mmmx2 or -mmmxext...

  Now that you mention it...

[i660][waltdnes][~] grep mmxext /usr/portage/profiles/use.local.desc 
media-libs/libpostproc:mmxext - Enable mmx2 support.
media-plugins/vdr-softdevice:mmxext - enables MMXExt support
media-video/ffmpeg:mmxext - Enables mmx2 support
media-video/libav:mmxext - Enable mmx2 support.
media-video/mplayer:mmxext - Enables mmx2 support
media-video/mplayer2:mmxext - Enables mmx2 support
x11-libs/pixman:mmxext - Enable MMX2 support.

...shouldn't "mmxext" be moved out of use.local.desc into use.desc?

-- 
Walter Dnes <waltdnes@waltdnes.org>
I don't run "desktop environments"; I run useful applications


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] Re: CPU use flag detection
  2013-05-19  2:31     ` Walter Dnes
@ 2013-05-19 15:47       ` Alexis Ballier
  2013-05-19 16:03         ` vivo75
  2013-05-19 16:17         ` Matt Turner
  0 siblings, 2 replies; 9+ messages in thread
From: Alexis Ballier @ 2013-05-19 15:47 UTC (permalink / raw
  To: gentoo-dev

On Sat, 18 May 2013 22:31:11 -0400
"Walter Dnes" <waltdnes@waltdnes.org> wrote:

[...]
> ...shouldn't "mmxext" be moved out of use.local.desc into use.desc?


all the cpu flags should be global IMHO, regardless of how many packages
use them: we already mask/unmask them globally on arches where they are
irrelevant.

Alexis.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] Re: CPU use flag detection
  2013-05-19 15:47       ` Alexis Ballier
@ 2013-05-19 16:03         ` vivo75
  2013-05-19 16:36           ` René Neumann
  2013-05-19 16:17         ` Matt Turner
  1 sibling, 1 reply; 9+ messages in thread
From: vivo75 @ 2013-05-19 16:03 UTC (permalink / raw
  To: gentoo-dev; +Cc: Alexis Ballier

On 05/19/13 17:47, Alexis Ballier wrote:
> On Sat, 18 May 2013 22:31:11 -0400
> "Walter Dnes" <waltdnes@waltdnes.org> wrote:
>
> [...]
>> ...shouldn't "mmxext" be moved out of use.local.desc into use.desc?
>
> all the cpu flags should be global IMHO, regardless of how many packages
> use them: we already mask/unmask them globally on arches where they are
> irrelevant.
>
> Alexis.
>
+1
also +1 they should be easily recognizable as cpu features USE flags, as
already mentioned recently by someone (sorry could not search)



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] Re: CPU use flag detection
  2013-05-19 15:47       ` Alexis Ballier
  2013-05-19 16:03         ` vivo75
@ 2013-05-19 16:17         ` Matt Turner
  1 sibling, 0 replies; 9+ messages in thread
From: Matt Turner @ 2013-05-19 16:17 UTC (permalink / raw
  To: gentoo-dev

On Sun, May 19, 2013 at 8:47 AM, Alexis Ballier <aballier@gentoo.org> wrote:
> On Sat, 18 May 2013 22:31:11 -0400
> "Walter Dnes" <waltdnes@waltdnes.org> wrote:
>
> [...]
>> ...shouldn't "mmxext" be moved out of use.local.desc into use.desc?
>
>
> all the cpu flags should be global IMHO, regardless of how many packages
> use them: we already mask/unmask them globally on arches where they are
> irrelevant.
>
> Alexis.

Yes, they should. And while we're at it, we should stop naming them
differently. (sse4_1 vs sse41)

Also, since SSE4 isn't a thing (there's SSE4.1, SSE4.2, and SSE4a) we
shouldn't have /any/ USE=sse4 in the tree.

And we should never set up the masks like this:
https://bugs.gentoo.org/show_bug.cgi?id=470220


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] Re: CPU use flag detection
  2013-05-19 16:03         ` vivo75
@ 2013-05-19 16:36           ` René Neumann
  0 siblings, 0 replies; 9+ messages in thread
From: René Neumann @ 2013-05-19 16:36 UTC (permalink / raw
  To: gentoo-dev

Am 19.05.2013 18:03, schrieb vivo75@gmail.com:
> On 05/19/13 17:47, Alexis Ballier wrote:
>> On Sat, 18 May 2013 22:31:11 -0400
>> "Walter Dnes" <waltdnes@waltdnes.org> wrote:
>>
>> [...]
>>> ...shouldn't "mmxext" be moved out of use.local.desc into use.desc?
>>
>> all the cpu flags should be global IMHO, regardless of how many packages
>> use them: we already mask/unmask them globally on arches where they are
>> irrelevant.
>>
>> Alexis.
>>
> +1
> also +1 they should be easily recognizable as cpu features USE flags, as
> already mentioned recently by someone (sorry could not search)

So this sounds like one of the places, where a USE_EXPAND could really
be correct and worthwhile :).

- René



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gentoo-dev] Re: CPU use flag detection
  2013-05-18 19:14   ` Matt Turner
  2013-05-19  2:31     ` Walter Dnes
@ 2013-05-22  4:59     ` Ryan Hill
  1 sibling, 0 replies; 9+ messages in thread
From: Ryan Hill @ 2013-05-22  4:59 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1310 bytes --]

On Sat, 18 May 2013 12:14:35 -0700
Matt Turner <mattst88@gentoo.org> wrote:

> > MMX2/MMXEXT still confuses me.
> 
> SSE1 and /Enhanced/ 3DNow! added some extra MMX instructions. Some
> (pshufw and pmulhuw particularly) turn out to be rather useful in
> software compositing. I use them in the pixman MMX code.
> 
> See http://mattst88.com/programming/asmref/ (Sorry about the broken
> search box. It works, you just don't see what you type)

Oh I am going to get a lot of use out of this.

> Set Requires = Enhanced 3DNow!. The instructions that are listed as
> 'Enhanced 3DNow! or SSE1' are what are known as MMX2 or MMXEXT.
> 
> The particularly annoying thing about using them is that there's no
> -mmmx2 or -mmmxext, but turning on -msse causes illegal instructions
> to be generated for old AMD or Geode CPUs, while -m3dnow causes the
> same problems for Intel CPUs. And, there's not actually even an
> -m3dnowext flag (anymore?) anyway, so it's kind of a mess.

Ah, that explains why I always thought they were Enh 3DNow options.  Looks like
I have them spread out between MMX and Enh 3DNow in analyze-x86.  Oops.


-- 
Ryan Hill                        psn: dirtyepic_sk
   gcc-porting/toolchain/wxwidgets @ gentoo.org

47C3 6D62 4864 0E49 8E9E  7F92 ED38 BD49 957A 8463

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-05-22  4:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-15 14:59 [gentoo-dev] CPU use flag detection yac
2013-05-18  4:39 ` [gentoo-dev] " Ryan Hill
2013-05-18 19:14   ` Matt Turner
2013-05-19  2:31     ` Walter Dnes
2013-05-19 15:47       ` Alexis Ballier
2013-05-19 16:03         ` vivo75
2013-05-19 16:36           ` René Neumann
2013-05-19 16:17         ` Matt Turner
2013-05-22  4:59     ` Ryan Hill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox