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

via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 19 23:21:02 PST 2023


Author: Qiu Chaofan
Date: 2023-11-20T15:20:57+08:00
New Revision: d572c4cdef4b3a2b1f57769233f33a1788f5172e

URL: https://github.com/llvm/llvm-project/commit/d572c4cdef4b3a2b1f57769233f33a1788f5172e
DIFF: https://github.com/llvm/llvm-project/commit/d572c4cdef4b3a2b1f57769233f33a1788f5172e.diff

LOG: [PowerPC] Disable float128 on AIX in Clang (#67298)

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

---------

Co-authored-by: Kai Luo <gluokai at gmail.com>

Added: 
    

Modified: 
    clang/lib/Basic/Targets/PPC.cpp
    clang/test/Sema/128bitfloat.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Basic/Targets/PPC.cpp b/clang/lib/Basic/Targets/PPC.cpp
index 5ce276e1af9ef64..045c273f03c7a0c 100644
--- a/clang/lib/Basic/Targets/PPC.cpp
+++ b/clang/lib/Basic/Targets/PPC.cpp
@@ -53,7 +53,7 @@ bool PPCTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
     } else if (Feature == "+htm") {
       HasHTM = true;
     } else if (Feature == "+float128") {
-      HasFloat128 = true;
+      HasFloat128 = !getTriple().isOSAIX();
     } else if (Feature == "+power9-vector") {
       HasP9Vector = true;
     } else if (Feature == "+power10-vector") {

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


        


More information about the cfe-commits mailing list