Microarchitecture test macro proposal#153
Microarchitecture test macro proposal#153garthlei wants to merge 1 commit intoriscv-non-isa:mainfrom
Conversation
|
My concern about this is it makes it easy to make code that only works for one microarch, and breaks if compiled with a different Currently how |
|
Hi @lenary, thank you for your reply!
Do you mean something like the scenario where the developer writes some microarch-specific code within some
I do agree that the documentation of the macros needs rephrasing if the new |
I think I was thinking of this originally
But this could also be a problem - it's not just "work as well on other models", the problem comes if you use @topperc thinks "clang stopped defining new tune macros for x86 years ago", so we should maybe try to learn the lessons other architectures have. I trust (but haven't verified) this claim, but this proposal should probably address what happened with x86 and why riscv won't hit the same issues. |
I can now imagine a scenario where someone writes some inline assembly assuming VLEN≥512 in a @lenary Does it sound better to define only CPU macros, which rely on |
|
Hello @garthlei, your proposal was discussed at the last Toolchain SIG meeting on 01/15:
See meeting notes at https://riscv.atlassian.net/wiki/spaces/SSNJ/pages/1137115137/2026-01-15+Toolchain+SIG+Meeting+Notes |
Some developers may want to use macros to guard their microarchitecture-specific optimized code. We note that other architectures like x86 have macros based on the
-mtuneoption, and maybe we could do the same for RISC-V?