The patch complements https://github.com/llvm/llvm-project/pull/68919 and adds AArch64 support for builtin `__builtin_cpu_supports("feature1+...+featureN")` which return true if all specified CPU features in argument are detected. Also compiler-rt aarch64 native run tests for features detection mechanism were added and 'cpu_model' check was fixed after its refactor merged https://github.com/llvm/llvm-project/pull/75635 Original RFC was https://reviews.llvm.org/D153153
18 lines
521 B
C
18 lines
521 B
C
// REQUIRES: aarch64-target-arch
|
|
// REQUIRES: native-run
|
|
// RUN: %clang_builtins %s %librt -o %t && %run %t
|
|
// REQUIRES: librt_has_aarch64
|
|
int main(void) {
|
|
if (__builtin_cpu_supports("fp+simd+pmull+sha2+crc")) {
|
|
if (__builtin_cpu_supports("fp") && __builtin_cpu_supports("simd") &&
|
|
__builtin_cpu_supports("pmull") && __builtin_cpu_supports("sha2") &&
|
|
__builtin_cpu_supports("crc")) {
|
|
return 0;
|
|
} else {
|
|
// Something wrong in feature detection
|
|
return 1;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|