Safe CFLAGS

This article provides CPU flags on Gentoo Linux.]]

Automatic CPU detection by tools
The package can attempt to automatically detect all supported CPU flags for the currently running processor. After installing the package, issue the following command for output:

Automatic CPU detection by the compiler
A recommended default choice for CFLAGS or CXXFLAGS is to use. This enables auto-detection of the CPU's architecture. A possible entry might look like:

Finding the CPU
To identify the model of the CPU, take a look inside for the "cpu family" and "model" numbers like so:

Once this information is found match the CPU to one listed on this page in order to find out the suggested "safe" CFLAGS.

Below is a list of CFLAGS which are to be considered "safe" for the given processors. These are the settings that should be used, especially when unsure which CFLAGS the processor needs.

Generic psABI levels
If you have a distcc farm with slightly different CPUs, it might make more sense to generate code that is just old enough to work for all of them, without bogging down to the really generic code. The psABI microarchitecture levels aims to provide just that for common eras of amd64 CPUs. See x86-64 for a description of the levels.

PPC 970 (G5)
Compatible processors are IBM PPC970, PPC970FX, PPC970MP and PPC970GX.

PPC 7450 family
Compatible processors are Motorola/Freescale MPC7450, MPC7440, MPC7451, MPC7441, MPC7455, MPC7445, MPC7457, MPC7447, MPC7447/A, and MPC7448.

PPC 7400 family
Compatible processors are Motorola MPC7400 and MPC7410. Note: IBM manufactured the MPC7400 as 06K5319 and 10K8298 when Motorola was not able to fulfill Apple's demands.

G3 (PPC 7XX)
Compatible processors are Motorola/Freescale MPC750, MPC740, MPC755 and MPC745 as well as IBM PPC750, PPC740, PPC750L, PPC740L, PPC750CX, PPC750CXe, PPCDBK ("Gekko"), PPC750FX, PPC750GX, PPC750CXr, PPC750CL ("Broadway"), PPC750GL and PPC750FL. The BAE Systems RAD750 is a radiation hardened variant of the PPC750. The "Espresso" (following the "Gekko" and "Broadway") is also based on the PPC750.

For CPUs for embedded systems such as the Gekko (PPCDBK, used in the Nintendo GameCube) additional CFLAGS (like ) will be required.

External resources

 * GCC Online Documentation on GNU.org
 * GCC x86 performance hints from Intel
 * List of AMD Microarchitectures with extended info
 * List of Intel Microarchitectures with extended info