CPU FLAGS X86


CPU_FLAGS_X86 is a USE_EXPAND variable containing instruction set and other CPU-specific features.
CPU_FLAGS_PPC is a USE_EXPAND variable containing instruction set and other CPU-specific features.
CPU_FLAGS_ARM is a USE_EXPAND variable containing instruction set and other CPU-specific features.

Configuration[edit | edit source]

These variables need to be set as CPU_FLAGS_X86 (CPU_FLAGS_ARM, CPU_FLAGS_PPC) variable in /etc/portage/make.conf or in /etc/portage/package.use:

FILE /etc/portage/make.conf
CPU_FLAGS_X86="mmx mmxext sse sse2 sse3"
Note
The same CPU_FLAGS_X86 variable is used both on x86 and amd64 architectures on Intel and AMD CPUs.

When in doubt, consult the flag descriptions using one of the commonly available tools, e.g. equery uses from app-portage/gentoolkit:

user $equery uses media-video/ffmpeg

Most of the flag names match /proc/cpuinfo names, with the notable exception of sse3 which is called pni in /proc/cpuinfo (please also do not confuse it with distinct ssse3).

Using cpuid2cpuflags[edit | edit source]

app-portage/cpuid2cpuflags helps users determine the correct CPU_FLAGS_ USE_EXPAND variables for their CPU architecture.

Emerge[edit | edit source]

root #emerge --ask app-portage/cpuid2cpuflags

Invocation[edit | edit source]

Version 1 or 2:

user $cpuinfo2cpuflags-x86
CPU_FLAGS_X86="mmx mmxext sse sse2 sse3"

Version 3 or greater:

user $cpuid2cpuflags
CPU_FLAGS_X86: mmx mmxext sse sse2 sse3

Example to apply globally:

root #echo "*/* $(cpuid2cpuflags)" > /etc/portage/package.use/00cpu-flags

Migration from deprecated USE flags[edit | edit source]

In order not to lose CPU-specific optimizations, users will be required to update the make.conf (and potentially package.use) file. For example, if the following USE flags were present:

FILE /etc/portage/make.conf
USE="mmx mmxext sse sse2 sse3"

They should be moved to the relevant CPU_FLAGS_* variable.

Saving deprecated USE flags[edit | edit source]

Previous USE flags corresponding to the instruction sets and other features specific to the x86/amd64, ppc/ppc64 and arm/arm64 architectures are being moved into separate USE_EXPAND variables.

In order to ensure safe migration and maintain compatibility with external repositories, it is recommended to preserve the old USE settings for a period of one year or until no package of interest is still using them.

See also[edit | edit source]

External resources[edit | edit source]

This article is issued from Gentoo. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.