[clang] [llvm] [AIX] support builtin_cpu_is() for aix (PR #80069)

Nemanja Ivanovic via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 8 11:28:58 PST 2024


https://github.com/nemanjai commented:

Do we really want to support only `__builtin_cpu_is` on AIX? It doesn't seem like this would achieve the desired goal. Most users will use these builtins to test for some capability on the target machine. It almost never really matters to a user whether the CPU is a Power10. They are much more likely to care about whether the system supports MMA so they can insert calls to MMA functions; prefixed instructions so they can add them in inline asm, etc.
It is not clear to me what goal is achieved by just providing the processor identification and not its capabilities.

I think it would be better if (in consultation with the AIX team), we determine what it means when the kernel reports that the CPU is for example `Power10` and then we emulate `__builtin_cpu_supports` as well based on that.
For example, a call to `__builtin_cpu_supports("mma")` ends up emitting a check for whether the CPU is `Power10` or above.

https://github.com/llvm/llvm-project/pull/80069


More information about the cfe-commits mailing list