I am a little hesitant about whether to let -march implicitly set
-mtune, because this is equivalent to making -march become another
-mcpu with higher priority, and we cannot avoid discussing the
priority of -march and -mtune again, and no matter what the priority
is, it will introduce more complicated rules, so I prefer not to
implicitly set -mtune.

And the option -march=unset was discussed at the RISC-V LLVM sync up
meeting, and at that time, the participants, including me, did not
realize that ARM already had this option.
Although I think -march=unset is ugly, but this does solve the current
problem and does not change the semantics or priority order of the
current overall options, so this is a valid option we may consider.

So we have few options here:

1. Accept -march=<cpu-name>. not changing -mtune
2. Accept -march=<cpu-name>. also implied -mtune
3. Accept -march=unset and -mtune=unset to let -mcpu be able to
override both options.

Here is example when we want to override arch with a cpu name by
different options:

1. riscv64-linux-gcc -march=rv64gc -march=foo-cpu
2. riscv64-linux-gcc -march=rv64gc -march=foo-cpu
3. riscv64-linux-gcc -march=rv64gc -march=unset -mcpu=foo-cpu

And when we also want to override mtune:

1. riscv64-linux-gcc -march=rv64gc -march=foo-cpu -mtune=foo-cpu
2. riscv64-linux-gcc -march=rv64gc -march=foo-cpu
3. riscv64-linux-gcc -march=rv64gc -march=unset -mtune=unset -mcpu=foo-cpu

Preference to me:
- Prefer option 1.
- Less prefer option 3. (acceptable but I don't like)
- Strongly dislike option 2.

Reply via email to