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

Amy Kwan via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 5 08:48:09 PST 2024


================
@@ -362,8 +362,18 @@ 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.
+#define MINIMUM_AIX_OS_MAJOR 7
+#define 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 Tri = getTriple();
+    // The AIX7.2 is mininum requirement to support __builtin_cpu_is().
----------------
amy-kwan wrote:

```suggestion
    llvm::Triple Triple = getTriple();
    // AIX 7.2 is the minimum requirement to support __builtin_cpu_is().
```
nit: on the variable naming and comment. Also, updated on the typo.

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


More information about the cfe-commits mailing list