Jump to content

Photo

CPU_FLAGS_X86

- - - - -

7 replies to this topic

#1
drobbins

drobbins

    Administrator

  • Administrators
  • 140 posts

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


  • Philipp Ludwig likes this

#2
uudruid74

uudruid74

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationDallas, TX USA

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.


https://github.com/u.../bashTheObjects -- Object Oriented Programming in BASH !!
https://eddon.systems -- Stuff I'm Working on.


#3
Tassie_Tux

Tassie_Tux

    Advanced Member

  • Members
  • PipPipPip
  • 49 posts
  • LocationHobart, Tasmania (Australia)

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



#4
uudruid74

uudruid74

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationDallas, TX USA
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

https://github.com/u.../bashTheObjects -- Object Oriented Programming in BASH !!
https://eddon.systems -- Stuff I'm Working on.


#5
uudruid74

uudruid74

    Advanced Member

  • Members
  • PipPipPip
  • 134 posts
  • LocationDallas, TX USA
Very odd. Just installed it to 2 systems. It installed two versions. Version 1 outputs in s format suitable to be read by the shell. Version 2 does not. Odd change. Seems like going backwards.

https://github.com/u.../bashTheObjects -- Object Oriented Programming in BASH !!
https://eddon.systems -- Stuff I'm Working on.


#6
Sandro

Sandro

    Advanced Member

  • Members
  • PipPipPip
  • 358 posts
  • LocationSaronno, Via IV Novembre, 23 21047 Italy

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 !!!!!!!!!!!!!!!!!!!!!!!!!


#7
paddymac

paddymac

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts

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.



#8
Sandro

Sandro

    Advanced Member

  • Members
  • PipPipPip
  • 358 posts
  • LocationSaronno, Via IV Novembre, 23 21047 Italy

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 :|





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users