[clang] [Clang][AArch64] Use __clang_arm_builtin_alias for overloaded svreinterpret's (PR #92427)

via cfe-commits cfe-commits at lists.llvm.org
Thu May 16 11:20:09 PDT 2024


rsandifo-arm wrote:

> However we choose to emit this particular builtin, should we provide a way to write a function like this? Like, the caller has to either support sve, or have streaming enabled. Maybe call it __arm_streaming_compatible_requires_sve.

I'd like to make two (probably obvious) points before answering this:

* The existing three-way choice between normal, `__arm_streaming`, and `__arm_streaming_compatible` is simply a choice between possible incoming and outgoing PSTATE.SM states at runtime (0, 1, and 0 or 1, respectively).  It's intended to be independent of the architecture level, except for the fact that using `__arm_streaming` is an error when SME is not enabled.

* If `__arm_streaming_compatible` is being used to write a vector routine, the question isn't likely to be just “do I have SVE?” but “do I have this particular set of SVE features”?  For example, I imagine many integer-based algorithms would want at least SVE2.  At some point SVE2p1 would become a baseline for some users.

So if someone wants to say both “this function should be streaming-compatible” and “this function assumes it has access to these streaming SVE features” then I think those things should be specified as two separate annotations, rather than a single combined one.  The second one (about assuming/requiring available features) is useful more generally, for non-streaming and `__arm_streaming` as well as `__arm_streaming_compatible`.


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


More information about the cfe-commits mailing list