projg2 / cpuid2cpuflags

Tool to generate CPU_FLAGS_* for your CPU
GNU General Public License v2.0
104 stars 20 forks source link

Add a tool to convert CFLAGS into CPU_FLAGS #24

Open mgorny opened 8 months ago

mgorny commented 8 months ago

It has been suggested that we could have a tool that would take an -march= option and output the corresponding CPU_FLAGS_*. I'm thinking the cleanest approach would be to actually to defer to GCC to expand CFLAGS into a set of -m options, and map them onto CPU_FLAGS_*. However, we first need to check if all of the flags have corresponding -m options.

mgorny commented 8 months ago

x86: only mmxext (not very important, as it's implied by SSE), and padlock are missing.

ppc: there's only -mvsx, we apparently also check for vsx2 + vsx3 based on architecture version.

arm: we have a bunch of ABI-related options that won't be available from -march, some of the flags are part of -march, need to investigate more.