On 2025-05-21, Kito Cheng wrote:
On Wed, May 21, 2025 at 10:19 PM Robin Dapp <rdapp....@gmail.com> wrote:
> I could imagine that is a simpler way to set the march since the march
> string becomes terribly long - we have an arch string more than 300
> char...so I support this, although I think this should be discuss with
> LLVM community, but I think it's fine to accept as a GCC extension.
>
> So LGTM, go ahead to the trunk, and I will raise this topic in the
> next LLVM sync up meeting.
That would be great, thanks.
Another related issue. i386 and other targets, but not aarch64,
make -march imply -mtune. Was it a deliberate decision to _not_ do this?
Could we even add it still? ;) That might help simplify things a bit
further even.
That sounds make sense to me, but let me think about it a few more
(let me sleep first and think more tomorrow :P)
also discuss with a few more people, let's step by step...I don't want
to change too much at one time without sync with the LLVM community :)
--
Regards
Robin
I stumped across this change from
https://github.com/riscv-non-isa/riscv-toolchain-conventions/issues/88
and I want to express my strong disagreement with this change.
Perhaps I'm accustomed to Arm's behavior, but I believe using -march= to target
a specific CPU isn't ideal.
* -march=X: (execution domain) Generate code that can use instructions
available in the architecture X
* -mtune=X: (optimization domain) Optimize for the microarchitecture X, but
does not change the ABI or make assumptions about available instructions
* -mcpu=X: Specify both -march= and -mtune= but can be overridden by the two
options. The supported values are generally the same as -mtune=. The
architecture name is inferred from X
For execution domain settings, -march=X overrides -mcpu=X regardless of their
positions.
In cases like `-march=LOWER -mcpu=HIGHER` or `-mcpu=HIGHER -march=LOWER`, the
-march= option can disable certain target features.
I strongly disagree with Clang adopting this behavior.
I'm not convinced by the GCC patch explanation.
Suppose we have a Makefile that specifies -march=rv64gc by default.
In the project specifies a lower feature set, then the compiler should respect
it or the user should fix the project build system.