[clang] [llvm] Implement a subset of builtin_cpu_supports() features (PR #82809)

Lei Huang via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 23 12:40:05 PDT 2024


================
@@ -0,0 +1,43 @@
+// RUN: %clang_cc1 -triple powerpc-ibm-aix7.2.0.0 -emit-llvm -o - %s | FileCheck %s
+
+int main() { 
+  int ret = 0; 
+  ret += __builtin_cpu_supports("vsx");
+  ret += __builtin_cpu_supports("htm");
+  ret += __builtin_cpu_supports("cellbe");
+  ret += __builtin_cpu_supports("power4");
+  return ret;
----------------
lei137 wrote:

would be good to add a call that will directly return true, another call to syscfg and doc which is which within the src here.

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


More information about the llvm-commits mailing list