[clang] [compiler-rt] [AArch64] Implement __builtin_cpu_supports, compiler-rt tests. (PR #82378)

via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 28 23:32:56 PST 2024


eaeltsin wrote:

@ilinpv the problem is that a lot of third party code out there might fail to compile now because it assumes GCC's behavior for invalid `__builtin_cpu_supports`. At least we can see many breakages in the third party that we use in our codebase.

By intentionally diverging from GCC this way you assume third party code owners will have to add architecture-specific guards around each use of `__builtin_cpu_supports`, which might be pretty disruptive.

Is there any document that specifies how builtins should behave when they are not supported/their parameter is not supported? I assume there is a reason behind failing the compilation in these cases, as not every builtin can simply answer "no", but I think this should be documented very explicitly.



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


More information about the cfe-commits mailing list