[clang] [PowerPC] Disable float128 on AIX in Clang (PR #67298)

via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 25 02:06:24 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

<details>
<summary>Changes</summary>

PowerPC AIX backend does not support float128 at all. Diagnose even when specifying -mfloat128 to avoid backend crash.

---
Full diff: https://github.com/llvm/llvm-project/pull/67298.diff


2 Files Affected:

- (modified) clang/lib/Basic/Targets/PPC.cpp (+1-1) 
- (modified) clang/test/Sema/128bitfloat.cpp (+1) 


``````````diff
diff --git a/clang/lib/Basic/Targets/PPC.cpp b/clang/lib/Basic/Targets/PPC.cpp
index e0abc069032e1ce..119ed9c1ac4504e 100644
--- a/clang/lib/Basic/Targets/PPC.cpp
+++ b/clang/lib/Basic/Targets/PPC.cpp
@@ -52,7 +52,7 @@ bool PPCTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
       HasDirectMove = true;
     } else if (Feature == "+htm") {
       HasHTM = true;
-    } else if (Feature == "+float128") {
+    } else if (Feature == "+float128" && !getTriple().isOSAIX()) {
       HasFloat128 = true;
     } else if (Feature == "+power9-vector") {
       HasP9Vector = true;
diff --git a/clang/test/Sema/128bitfloat.cpp b/clang/test/Sema/128bitfloat.cpp
index b98b42496e8db27..bd9f2889c98f6aa 100644
--- a/clang/test/Sema/128bitfloat.cpp
+++ b/clang/test/Sema/128bitfloat.cpp
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 -verify -std=gnu++11 %s
 // RUN: %clang_cc1 -verify -std=c++11 %s
 // RUN: %clang_cc1 -triple powerpc64-linux -verify -std=c++11 %s
+// RUN: %clang_cc1 -triple powerpc64-ibm-aix -target-feature +float128 -verify -std=c++11 %s
 // RUN: %clang_cc1 -triple i686-windows-gnu -verify -std=c++11 %s
 // RUN: %clang_cc1 -triple x86_64-windows-gnu -verify -std=c++11 %s
 // RUN: %clang_cc1 -triple x86_64-windows-msvc -verify -std=c++11 %s

``````````

</details>


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


More information about the cfe-commits mailing list