Can "x86-64-v1" be explicit?

I understand the implication of compile option -C target_cpu=x86-64-v2 or -C target_cpu=x86-64-v3...
However when trying to use -C target_cpu=x86-64-v1, I get

'x86-64-v1' is not a recognized processor for this target (ignoring processor)

I understand that the "default, most generic" x86_64 architecture is v1 anyway, so using --target=x86_64-<...>-<...> should use v1 without further -C target_cpu, but I find it strange that it cannot be explicit.

Is there a reason for that ?

Probably an unsatisfactory answer to you, but if I run rustc --print target-cpus, there is no x86-64-v1 target cpu, while there is a x86-64 one. AFAIK, the supported target cpus come from llvm and not rustc. As to how they chose the names for their target cpus, I have no idea (there are target cpus skylake-avx512 and skylake_avx512 which make me very curious).

1 Like

Ok, that strange naming non-homogeneity seems to originate from LLVM, not rust

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.