[cfe-dev] Exact meaning of '-march=' and '-mcpu=' options in clang

ardi via cfe-dev cfe-dev at lists.llvm.org
Fri Jan 18 04:42:40 PST 2019


Hi!

I'm not able to find an accurate descriptions of these two options at
the docs. In the case of GCC, '-march' selects the instruction set
being used, while '-mcpu' just tunes the code for a processor without
reducing the compatibility, so, without using instructions not implied
by the '-march' setting  (ie: with '-march=G5' you will generate PPC
code that won't run in processors older than G5, but with '-mcpu=G5'
it will run in older processors if the '-march' option allows).

Is it the same in clang?

Also, are the possible values for '-mcpu' the same as for '-march', or
do they differ? Where can I find a list of accepted values for both
options?

Thanks a lot,

ardi



More information about the cfe-dev mailing list