From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page CPU FLAGS X86 and the translation is 81% complete.

Warning: Display title "CPU_FLAGS_X86" overrides earlier display title "CPU FLAGS X86".

Other languages:

CPU_FLAGS_X86 is an USE_EXPAND variable containing instruction set and other CPU-specific features.

Previous USE flags corresponding to the instruction sets and other features specific to the x86/amd64 architecture are being moved into a separate USE_EXPAND variable called CPU_FLAGS_X86.



root #emerge --ask app-portage/cpuid2cpuflags



为了不丢失 CPU 特点优化,用户将需要更新 make.conf(可能还有 package.use)文件。例如,如果存在以下 USE 标志:

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

这些标志需要复制到新创建的 CPU_FLAGS_X86 变量中:

文件 /etc/portage/make.conf
CPU_FLAGS_X86="mmx mmxext sse sse2 sse3"
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

大多数标志名称与 /proc/cpuinfo 名称匹配,例外是 sse3,它在 /proc/ 中称为 pni cpuinfo(也请不要将它与不同的 ssse3 混淆)。

为了帮助用户启用正确的 USE 标志,有一个 Python 脚本可供使用,该脚本使用 /proc/cpuinfo 生成正确的值。它可以在 app-portage/cpuid2cpuflags 包中找到。

保存不推荐使用的 USE 标记

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.



版本 1 或 2:

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

版本 3 或更高版本:

user $cpuid2cpuflags
CPU_FLAGS_X86: mmx mmxext sse sse2 sse3


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