Jump to content
Forums in Read-Only Mode - Please use Reddit ×

CPU_FLAGS_X86


Recommended Posts

  • Funtoo Linux BDFL

Hi All,

 

One new thing that we have had to deal with is the addition of the CPU_FLAGS_X86 variable to Gentoo and Funtoo Linux. As you may know, there are a lot of USE flags that deal with CPU instruction sets, such as "mmx", "sse", etc. These have been migrated to a CPU_FLAGS_X86 variable, which works similarly to other variables like VIDEO_CARDS.

 

Strangely, I couldn't find any good documentation on the USE flags that are now CPU_FLAGS_X86, so I created my own docs for everyone on this page:

 

http://www.funtoo.org/CPU_FLAGS

 

As you can see, the history of CPU instruction sets for x86 systems has been pretty interesting and complex.

 

One thing you might be wondering, especially if you are a new user, is what instructions are being used for your Funtoo Linux system. This is actually determined by the CFLAGS -march setting, primarily. This tells the compiler which instruction sets to use when building C programs. The additional CPU_FLAGS_X86 flags enable optional build-time functionality in ebuilds for these instruction sets that must be specifically enabled. Typically, these are special optimized parts that have been hand-written to run very fast on systems with these instruction sets. I hope this clarifies things.

 

Over the next week, expect updates to the Subarches page on the wiki to reference CPU_FLAGS_X86 instead of USE.

 

Regards,

Daniel

Link to comment
Share on other sites

  • 3 months later...

There should be some option that peeks at /proc/cpuinfo for all the flags to see what your CPU supports and uses -march=native for the usual architecture build.   No good if building for another host, but most people are building on their own box.

Link to comment
Share on other sites

There should be some option that peeks at /proc/cpuinfo for all the flags to see what your CPU supports

 

app-portage/cpuinfo2cpuflags seems to achieve that goal in the context of adding a suitable CPU_FLAGS_X86 entry to make.conf

Link to comment
Share on other sites

Someone has done it! Awesome. Wish it was the default rather than an odd on, like if you don't have the variable specified, emerge would just look at the flags and go, but... we don't always get what we want!

 

Thanks for mentioning that package though. Trying it now

Link to comment
Share on other sites

  • 1 month later...

Fantastic magic Daniel :)

 

Your words must be written also in a book: "Hystory of processors" :)

 

I use "-march=native" cause sometimes in advanced steppings were added new instructions.

 

But to have a stage3 compiled for various architectures is a great idea and a great work.

 

I think only funtoo is so precise.
I like Your Work .....
 
... and another time .... thank You Daniel !!!!!!!!
 
I respect you very much ...... You're a great man.
 
Thank You for Your Work !!!!!!!!!!!!!!!!!!!!!!!!!
Link to comment
Share on other sites

  • 2 months later...

In some cases, the CPU flags are not just optional but necessary -- especially for binary software. For example, the binary Adobe Flash requires sse2 support in the processor, and the ebuild checks to see if the sse2 flag is enabled. If not, the ebuild won't emerge. Although the ebuild doesn't check for it (though it probably should), lightspark is an example of a program that requires sse2 processor support. Even though it will compile and install fine without sse2 support, it will crash when it runs if the CPU doesn't support sse2.

Link to comment
Share on other sites

  • 2 months later...

HEHE ... it is a very interesting thing. for example i had a K6-2 450 3D-now! with a "nvidia Riva TNT" .... whit optimizations (running 3dmark 99) my PC was faster in 3dmark 99 vs my brother PC based on "Celeron - P2 architecture @466 MHz (with fpu (with "pipelined-burst technology" + nvidia riva TNT2 :D)

 

If used ... the SIMD may give very higher performances.... it is the reason that i use a source based (and *too .... the Portage is for me the best manager in this planet :D)

 

Haswell and later supports also AVX2

 

But my new question (excuse if off topic) is relative to the knoledge of clang/llvm vs gcc :|

Link to comment
Share on other sites

×
×
  • Create New...