Re: [gentoo-dev] Review: desc/cpu_flags_x86.desc

2015-01-30 Thread James Cloos
 MG == Michał Górny mgo...@gentoo.org writes:

MG sse4_1 - Enable SSE4.1 instruction support
MG sse4_2 - Enable SSE4.2 instruction support

Does everything use the _ versions?  The docs should cover
the . versions, as well, if anything still expects them.

I've had to use sse4.1 and sse4.2, too, for some stuff.

(Obviously . xor _ in the ebuilds (a/o eclasses?) would be nice.)

-JimC
-- 
James Cloos cl...@jhcloos.com OpenPGP: 0x997A9F17ED7DAEA6



Re: [gentoo-dev] Review: desc/cpu_flags_x86.desc

2015-01-20 Thread Alexis Ballier
On Tue, 20 Jan 2015 09:52:40 +0100
Michał Górny mgo...@gentoo.org wrote:

 Dnia 2015-01-19, o godz. 11:38:26
 Alexis Ballier aball...@gentoo.org napisał(a):
 
  On Sun, 18 Jan 2015 21:44:05 +0100
  Michał Górny mgo...@gentoo.org wrote:
  
   Hello,
   
   I would like to commit the following flags as cpu_flags_x86_desc.
   The list combines global USE flags with some local USE flags I've
   been able to find.
   
   
   3dnow - Use the 3DNow! instruction set
   3dnowext - Use the Enhanced 3DNow! instruction set
   aes-ni - Enable support for Intel's AES instruction set (aes in
   cpuinfo) avx - Adds support for Advanced Vector Extensions
   instructions avx2 - Adds support for Advanced Vector Extensions 2
   instructions fma - Use the Fused Multiply Add instruction set
   mmx - Use the MMX instruction set
   mmxext - Use the Extended MMX instruction set (intersection of
   Enhanced 3DNow! and SSE instruction sets) (3dnowext or sse in
   cpuinfo) padlock - Use VIA padlock instructions popcnt - Enable
   popcnt instruction support sse - Use the SSE instruction set
   sse2 - Use the SSE2 instruction set
   sse3 - Use the SSE3 instruction set (pni in cpuinfo)
   sse4 - Enable SSE4 instruction support
   sse4_1 - Enable SSE4.1 instruction support
   sse4_2 - Enable SSE4.2 instruction support
   sse4a - Enable SSE4a instruction support
   ssse3 - Use the SSSE3 instruction set
   
  
  e... are you aware that these descriptions are close to
  useless ? 'foo - enable foo' - thanks for the information I
  couldn't have guessed...
 
 It's not my fault we have to put some description there!

I know; I'm just ranting because you could grep use.local.desc to get
more informative ones for some of them; then we can start discussing on
how to improve the other ones :)

Alexis.



Re: [gentoo-dev] Review: desc/cpu_flags_x86.desc

2015-01-20 Thread Michał Górny
Dnia 2015-01-19, o godz. 11:38:26
Alexis Ballier aball...@gentoo.org napisał(a):

 On Sun, 18 Jan 2015 21:44:05 +0100
 Michał Górny mgo...@gentoo.org wrote:
 
  Hello,
  
  I would like to commit the following flags as cpu_flags_x86_desc.
  The list combines global USE flags with some local USE flags I've been
  able to find.
  
  
  3dnow - Use the 3DNow! instruction set
  3dnowext - Use the Enhanced 3DNow! instruction set
  aes-ni - Enable support for Intel's AES instruction set (aes in
  cpuinfo) avx - Adds support for Advanced Vector Extensions
  instructions avx2 - Adds support for Advanced Vector Extensions 2
  instructions fma - Use the Fused Multiply Add instruction set
  mmx - Use the MMX instruction set
  mmxext - Use the Extended MMX instruction set (intersection of
  Enhanced 3DNow! and SSE instruction sets) (3dnowext or sse in
  cpuinfo) padlock - Use VIA padlock instructions popcnt - Enable
  popcnt instruction support sse - Use the SSE instruction set
  sse2 - Use the SSE2 instruction set
  sse3 - Use the SSE3 instruction set (pni in cpuinfo)
  sse4 - Enable SSE4 instruction support
  sse4_1 - Enable SSE4.1 instruction support
  sse4_2 - Enable SSE4.2 instruction support
  sse4a - Enable SSE4a instruction support
  ssse3 - Use the SSSE3 instruction set
  
 
 e... are you aware that these descriptions are close to useless ?
 'foo - enable foo' - thanks for the information I couldn't have
 guessed...

It's not my fault we have to put some description there!

 you already have more useful ones available:
 
 flag name=fma3Enables FMA3 optimizations: AMD processors starting
   with Piledriver architecture and Intel Haswell based processors or
   later./flag
 flag name=fma4Enables FMA4 optimizations: AMD processors starting
 with Bulldozer architecture./flag
 flag name=sse4_2Enables SSE4.2 optimizations: Nehalem-based Intel
 Core i7 or later./flag
 flag name=ssse3Faster floating point optimization for SSSE3 capable
 chips (Intel Core 2 and later chips)/flag
 
 and so on...

Feel free to update them yourself. As far as I'm concerned, those
descriptions are worse than useless because they end up being
confusing. Many CPU lines had weird models with more or less
instruction sets, so brand name aren't really helpful. It's better to
focus on /proc/cpuinfo.

-- 
Best regards,
Michał Górny


pgpwEywupN5yb.pgp
Description: OpenPGP digital signature


Re: [gentoo-dev] Review: desc/cpu_flags_x86.desc

2015-01-19 Thread Gordon Pettey
On Mon, Jan 19, 2015 at 4:41 AM, Alexis Ballier aball...@gentoo.org wrote:

 On Sun, 18 Jan 2015 15:15:22 -0800
 Matt Turner matts...@gentoo.org wrote:
   mmx - Use the MMX instruction set
   mmxext - Use the Extended MMX instruction set (intersection of
   Enhanced 3DNow! and SSE instruction sets) (3dnowext or sse in
   cpuinfo) padlock - Use VIA padlock instructions popcnt - Enable
   popcnt instruction support sse - Use the SSE instruction set
   sse2 - Use the SSE2 instruction set
   sse3 - Use the SSE3 instruction set (pni in cpuinfo)
   sse4 - Enable SSE4 instruction support
 
  We shouldn't have an sse4 USE flag. It's either one of the three
  below, but SSE4 by itself isn't a thing.

 wikipedia says it is sse4.1 + sse4.2


Some CPUs don't have 4.2, and some don't have 4a. You'd still need the
separate flags, so an extraneous combined flag is a bit silly.


Re: [gentoo-dev] Review: desc/cpu_flags_x86.desc

2015-01-19 Thread Andrew Savchenko
On Mon, 19 Jan 2015 08:13:46 +0800 Patrick Lauer wrote:
 On Sunday 18 January 2015 21:44:05 Michał Górny wrote:
  Hello,
  
  I would like to commit the following flags as cpu_flags_x86_desc.
  The list combines global USE flags with some local USE flags I've been
  able to find.
  
  
  3dnow - Use the 3DNow! instruction set
  3dnowext - Use the Enhanced 3DNow! instruction set
 
 Those are kinda mostly dead (no new CPUs have them anymore)

1) Modern AMD CPUs still support them (and can give performance
benefits from using them.
2) I'm writing right now from an old host with CPU supporting them. 

  aes-ni - Enable support for Intel's AES instruction set (aes in cpuinfo)
  avx - Adds support for Advanced Vector Extensions instructions
  avx2 - Adds support for Advanced Vector Extensions 2 instructions
  fma - Use the Fused Multiply Add instruction set
 
  mmx - Use the MMX instruction set
 Not sure if this one needs to be specified - amd64 always has it, and on x86 
 your code should do cpu feature detection anyway

1) No. We have cpudetection USE flag if user wants it.
2) Not all VIA CPUs support MMX.
3) Run-time CPU detection is *always slower* than compiled in code.
(Learn the difference between using GOTs or long jupms and not
using them, especiall on non-amd64 sysmems.)

  mmxext - Use the Extended MMX instruction set (intersection of Enhanced
  3DNow! and SSE instruction sets) (3dnowext or sse in cpuinfo) padlock - Use
  VIA padlock instructions
 Kinda very dead, even more than 3dnow

So what? There are still people using it.

  popcnt - Enable popcnt instruction support
 Why?!

Why not? It is an instruction set outside from official SSE4.2
standard, as well as LZCNT by the way.

  sse - Use the SSE instruction set
 Always exists on amd64, so this would be x86 special
 
  sse2 - Use the SSE2 instruction set
  sse3 - Use the SSE3 instruction set (pni in cpuinfo)
  sse4 - Enable SSE4 instruction support
  sse4_1 - Enable SSE4.1 instruction support
  sse4_2 - Enable SSE4.2 instruction support
  sse4a - Enable SSE4a instruction support
  ssse3 - Use the SSSE3 instruction set
 Wow, such a wonderful mess :)

Very productive comment...

 So half of those are obsolete/dead, and the other half you need to do proper 
 feature detection - why do we want that as useflags again?
 
Because we have users interested in these flags, including myself
but not limited to.

Best regards,
Andrew Savchenko


pgplC2PtOBYLx.pgp
Description: PGP signature


Re: [gentoo-dev] Review: desc/cpu_flags_x86.desc

2015-01-19 Thread Alexis Ballier
On Sun, 18 Jan 2015 15:15:22 -0800
Matt Turner matts...@gentoo.org wrote:
  mmx - Use the MMX instruction set
  mmxext - Use the Extended MMX instruction set (intersection of
  Enhanced 3DNow! and SSE instruction sets) (3dnowext or sse in
  cpuinfo) padlock - Use VIA padlock instructions popcnt - Enable
  popcnt instruction support sse - Use the SSE instruction set
  sse2 - Use the SSE2 instruction set
  sse3 - Use the SSE3 instruction set (pni in cpuinfo)
  sse4 - Enable SSE4 instruction support
 
 We shouldn't have an sse4 USE flag. It's either one of the three
 below, but SSE4 by itself isn't a thing.

wikipedia says it is sse4.1 + sse4.2


Alexis.



Re: [gentoo-dev] Review: desc/cpu_flags_x86.desc

2015-01-19 Thread Alexis Ballier
On Sun, 18 Jan 2015 21:44:05 +0100
Michał Górny mgo...@gentoo.org wrote:

 Hello,
 
 I would like to commit the following flags as cpu_flags_x86_desc.
 The list combines global USE flags with some local USE flags I've been
 able to find.
 
 
 3dnow - Use the 3DNow! instruction set
 3dnowext - Use the Enhanced 3DNow! instruction set
 aes-ni - Enable support for Intel's AES instruction set (aes in
 cpuinfo) avx - Adds support for Advanced Vector Extensions
 instructions avx2 - Adds support for Advanced Vector Extensions 2
 instructions fma - Use the Fused Multiply Add instruction set
 mmx - Use the MMX instruction set
 mmxext - Use the Extended MMX instruction set (intersection of
 Enhanced 3DNow! and SSE instruction sets) (3dnowext or sse in
 cpuinfo) padlock - Use VIA padlock instructions popcnt - Enable
 popcnt instruction support sse - Use the SSE instruction set
 sse2 - Use the SSE2 instruction set
 sse3 - Use the SSE3 instruction set (pni in cpuinfo)
 sse4 - Enable SSE4 instruction support
 sse4_1 - Enable SSE4.1 instruction support
 sse4_2 - Enable SSE4.2 instruction support
 sse4a - Enable SSE4a instruction support
 ssse3 - Use the SSSE3 instruction set
 

e... are you aware that these descriptions are close to useless ?
'foo - enable foo' - thanks for the information I couldn't have
guessed...


you already have more useful ones available:

flag name=fma3Enables FMA3 optimizations: AMD processors starting
  with Piledriver architecture and Intel Haswell based processors or
  later./flag
flag name=fma4Enables FMA4 optimizations: AMD processors starting
with Bulldozer architecture./flag
flag name=sse4_2Enables SSE4.2 optimizations: Nehalem-based Intel
Core i7 or later./flag
flag name=ssse3Faster floating point optimization for SSSE3 capable
chips (Intel Core 2 and later chips)/flag

and so on...


Alexis.



Re: [gentoo-dev] Review: desc/cpu_flags_x86.desc

2015-01-19 Thread Alexis Ballier
On Mon, 19 Jan 2015 08:13:46 +0800
Patrick Lauer patr...@gentoo.org wrote:

 
 So half of those are obsolete/dead, and the other half you need to do
 proper feature detection - why do we want that as useflags again?
 



http://article.gmane.org/gmane.linux.gentoo.devel/94299



Re: [gentoo-dev] Review: desc/cpu_flags_x86.desc

2015-01-18 Thread Gordon Pettey
On Sun, Jan 18, 2015 at 6:13 PM, Patrick Lauer patr...@gentoo.org wrote:

 On Sunday 18 January 2015 21:44:05 Michał Górny wrote:

  popcnt - Enable popcnt instruction support
 Why?!


Because Intel and AMD support it via different cpuinfo feature names. It is
popcnt on Intel, and abm on AMD. The description of the flag should also
mention that it is included in feature abm on AMD CPUs (and Intel CPUs,
but since they list popcnt separately, too, that might be confusing).


Re: [gentoo-dev] Review: desc/cpu_flags_x86.desc

2015-01-18 Thread Diamond
On Sun, 18 Jan 2015 20:28:27 -0600
Gordon Pettey petteyg...@gmail.com wrote:

 
 
 Because Intel and AMD support it via different cpuinfo feature names.
 It is popcnt on Intel, and abm on AMD. The description of the flag
 should also mention that it is included in feature abm on AMD CPUs
 (and Intel CPUs, but since they list popcnt separately, too, that
 might be confusing).

That's probably not quite correct. I have both of them in /proc/cpuinfo
on AMD Phenom II CPU.



Re: [gentoo-dev] Review: desc/cpu_flags_x86.desc

2015-01-18 Thread Diamond
On Sun, 18 Jan 2015 21:44:05 +0100
Michał Górny mgo...@gentoo.org wrote:

 Hello,
 
 I would like to commit the following flags as cpu_flags_x86_desc.
 The list combines global USE flags with some local USE flags I've been
 able to find.
 
 
 3dnow - Use the 3DNow! instruction set
 3dnowext - Use the Enhanced 3DNow! instruction set
 aes-ni - Enable support for Intel's AES instruction set (aes in
 cpuinfo) avx - Adds support for Advanced Vector Extensions
 instructions avx2 - Adds support for Advanced Vector Extensions 2
 instructions fma - Use the Fused Multiply Add instruction set
 mmx - Use the MMX instruction set
 mmxext - Use the Extended MMX instruction set (intersection of
 Enhanced 3DNow! and SSE instruction sets) (3dnowext or sse in
 cpuinfo) padlock - Use VIA padlock instructions popcnt - Enable
 popcnt instruction support sse - Use the SSE instruction set
 sse2 - Use the SSE2 instruction set
 sse3 - Use the SSE3 instruction set (pni in cpuinfo)
 sse4 - Enable SSE4 instruction support
 sse4_1 - Enable SSE4.1 instruction support
 sse4_2 - Enable SSE4.2 instruction support
 sse4a - Enable SSE4a instruction support
 ssse3 - Use the SSSE3 instruction set
 

There are other cool instructions on modern CPUs too. For example,
iommu. There are versions of them in kernel config options. Maybe
genkernel should depend on them? IDK, because I configure kernel config
by hand.



Re: [gentoo-dev] Review: desc/cpu_flags_x86.desc

2015-01-18 Thread Diamond
On Mon, 19 Jan 2015 08:13:46 +0800
Patrick Lauer patr...@gentoo.org wrote:


  
  3dnow - Use the 3DNow! instruction set
  3dnowext - Use the Enhanced 3DNow! instruction set
 
 Those are kinda mostly dead (no new CPUs have them anymore)
 

My CPU still has them.

 
  mmxext - Use the Extended MMX instruction set (intersection of
  Enhanced 3DNow! and SSE instruction sets) (3dnowext or sse in
  cpuinfo) padlock - Use VIA padlock instructions
 Kinda very dead, even more than 3dnow
 

I still have CPU with this instruction too.



Re: [gentoo-dev] Review: desc/cpu_flags_x86.desc

2015-01-18 Thread Mike Gilbert
On Sun, Jan 18, 2015 at 7:13 PM, Patrick Lauer patr...@gentoo.org wrote:
 3dnow - Use the 3DNow! instruction set
 3dnowext - Use the Enhanced 3DNow! instruction set

 Those are kinda mostly dead (no new CPUs have them anymore)


I'm sure there are still plenty of these out in the wild. I know I have one.

 So half of those are obsolete/dead, and the other half you need to do proper
 feature detection - why do we want that as useflags again?

The alternative would be to hard-disable them for the relevant
packages where runtime detection is not implemented (probably rare).



Re: [gentoo-dev] Review: desc/cpu_flags_x86.desc

2015-01-18 Thread Michał Górny
Dnia 2015-01-18, o godz. 15:15:22
Matt Turner matts...@gentoo.org napisał(a):

 On Sun, Jan 18, 2015 at 12:44 PM, Michał Górny mgo...@gentoo.org wrote:
  Hello,
 
  I would like to commit the following flags as cpu_flags_x86_desc.
  The list combines global USE flags with some local USE flags I've been
  able to find.
 
 
  3dnow - Use the 3DNow! instruction set
  3dnowext - Use the Enhanced 3DNow! instruction set
  aes-ni - Enable support for Intel's AES instruction set (aes in cpuinfo)
  avx - Adds support for Advanced Vector Extensions instructions
  avx2 - Adds support for Advanced Vector Extensions 2 instructions
  fma - Use the Fused Multiply Add instruction set
 
 There are fma3 and fma4 instruction sets. We need to determine which
 one the packages that have this flag are actually using and name the
 flag appropriately.

Ok then:

fma3 - Use the Fused Multiply Add v3 instruction set
fma4 - Use the Fused Multiply Add v4 instruction set

  mmx - Use the MMX instruction set
  mmxext - Use the Extended MMX instruction set (intersection of Enhanced 
  3DNow! and SSE instruction sets) (3dnowext or sse in cpuinfo)
  padlock - Use VIA padlock instructions
  popcnt - Enable popcnt instruction support
  sse - Use the SSE instruction set
  sse2 - Use the SSE2 instruction set
  sse3 - Use the SSE3 instruction set (pni in cpuinfo)
  sse4 - Enable SSE4 instruction support
 
 We shouldn't have an sse4 USE flag. It's either one of the three
 below, but SSE4 by itself isn't a thing.

Ok. dev-libs/marisa has --enable for all *four* of them :). And some
totally crazy, broken --enable magic which looks very mismatched...

  sse4_1 - Enable SSE4.1 instruction support
  sse4_2 - Enable SSE4.2 instruction support
  sse4a - Enable SSE4a instruction support
  ssse3 - Use the SSSE3 instruction set

-- 
Best regards,
Michał Górny


pgpoRXAFBBcIa.pgp
Description: OpenPGP digital signature


Re: [gentoo-dev] Review: desc/cpu_flags_x86.desc

2015-01-18 Thread Matt Turner
On Sun, Jan 18, 2015 at 3:23 PM, Michał Górny mgo...@gentoo.org wrote:
 Dnia 2015-01-18, o godz. 15:15:22
 Matt Turner matts...@gentoo.org napisał(a):

 On Sun, Jan 18, 2015 at 12:44 PM, Michał Górny mgo...@gentoo.org wrote:
  Hello,
 
  I would like to commit the following flags as cpu_flags_x86_desc.
  The list combines global USE flags with some local USE flags I've been
  able to find.
 
 
  3dnow - Use the 3DNow! instruction set
  3dnowext - Use the Enhanced 3DNow! instruction set
  aes-ni - Enable support for Intel's AES instruction set (aes in cpuinfo)
  avx - Adds support for Advanced Vector Extensions instructions
  avx2 - Adds support for Advanced Vector Extensions 2 instructions
  fma - Use the Fused Multiply Add instruction set

 There are fma3 and fma4 instruction sets. We need to determine which
 one the packages that have this flag are actually using and name the
 flag appropriately.

 Ok then:

 fma3 - Use the Fused Multiply Add v3 instruction set
 fma4 - Use the Fused Multiply Add v4 instruction set

They're not actually versions 3 and 4, like SSE. The number is the
number of arguments the instructions take.

I'd just remove the 'v' from the description and call it good.

See http://en.wikipedia.org/wiki/FMA_instruction_set for more information.



Re: [gentoo-dev] Review: desc/cpu_flags_x86.desc

2015-01-18 Thread Patrick Lauer
On Sunday 18 January 2015 21:44:05 Michał Górny wrote:
 Hello,
 
 I would like to commit the following flags as cpu_flags_x86_desc.
 The list combines global USE flags with some local USE flags I've been
 able to find.
 
 
 3dnow - Use the 3DNow! instruction set
 3dnowext - Use the Enhanced 3DNow! instruction set

Those are kinda mostly dead (no new CPUs have them anymore)

 aes-ni - Enable support for Intel's AES instruction set (aes in cpuinfo)
 avx - Adds support for Advanced Vector Extensions instructions
 avx2 - Adds support for Advanced Vector Extensions 2 instructions
 fma - Use the Fused Multiply Add instruction set

 mmx - Use the MMX instruction set
Not sure if this one needs to be specified - amd64 always has it, and on x86 
your code should do cpu feature detection anyway

 mmxext - Use the Extended MMX instruction set (intersection of Enhanced
 3DNow! and SSE instruction sets) (3dnowext or sse in cpuinfo) padlock - Use
 VIA padlock instructions
Kinda very dead, even more than 3dnow

 popcnt - Enable popcnt instruction support
Why?!

 sse - Use the SSE instruction set
Always exists on amd64, so this would be x86 special

 sse2 - Use the SSE2 instruction set
 sse3 - Use the SSE3 instruction set (pni in cpuinfo)
 sse4 - Enable SSE4 instruction support
 sse4_1 - Enable SSE4.1 instruction support
 sse4_2 - Enable SSE4.2 instruction support
 sse4a - Enable SSE4a instruction support
 ssse3 - Use the SSSE3 instruction set
Wow, such a wonderful mess :)


So half of those are obsolete/dead, and the other half you need to do proper 
feature detection - why do we want that as useflags again?



[gentoo-dev] Review: desc/cpu_flags_x86.desc

2015-01-18 Thread Michał Górny
Hello,

I would like to commit the following flags as cpu_flags_x86_desc.
The list combines global USE flags with some local USE flags I've been
able to find.


3dnow - Use the 3DNow! instruction set
3dnowext - Use the Enhanced 3DNow! instruction set
aes-ni - Enable support for Intel's AES instruction set (aes in cpuinfo)
avx - Adds support for Advanced Vector Extensions instructions
avx2 - Adds support for Advanced Vector Extensions 2 instructions
fma - Use the Fused Multiply Add instruction set
mmx - Use the MMX instruction set
mmxext - Use the Extended MMX instruction set (intersection of Enhanced 3DNow! 
and SSE instruction sets) (3dnowext or sse in cpuinfo)
padlock - Use VIA padlock instructions
popcnt - Enable popcnt instruction support
sse - Use the SSE instruction set
sse2 - Use the SSE2 instruction set
sse3 - Use the SSE3 instruction set (pni in cpuinfo)
sse4 - Enable SSE4 instruction support
sse4_1 - Enable SSE4.1 instruction support
sse4_2 - Enable SSE4.2 instruction support
sse4a - Enable SSE4a instruction support
ssse3 - Use the SSSE3 instruction set

-- 
Best regards,
Michał Górny


pgpbuKGc5cgoI.pgp
Description: OpenPGP digital signature