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

Amy Kwan via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 14 12:13:00 PST 2024


================
@@ -362,8 +362,16 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetInfo : public TargetInfo {
 
   // We support __builtin_cpu_supports/__builtin_cpu_is on targets that
   // have Glibc since it is Glibc that provides the HWCAP[2] in the auxv.
+  static constexpr int MINIMUM_AIX_OS_MAJOR = 7;
+  static constexpr int MINIMUM_AIX_OS_MINOR = 2;
   bool supportsCpuSupports() const override { return getTriple().isOSGlibc(); }
-  bool supportsCpuIs() const override { return getTriple().isOSGlibc(); }
+  bool supportsCpuIs() const override {
+    llvm::Triple Triple = getTriple();
+    // AIX 7.2 is the minimum requirement to support __builtin_cpu_is().
+    return Triple.isOSGlibc() ||
----------------
amy-kwan wrote:

Check clang-format for indentation.

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


More information about the cfe-commits mailing list