[clang] [PowerPC] Disable float128 on AIX in Clang (PR #67298)
Qiu Chaofan via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 15 23:09:33 PST 2023
https://github.com/ecnelises updated https://github.com/llvm/llvm-project/pull/67298
>From 58cd725354eae6aa733c98374a804de0ef595c60 Mon Sep 17 00:00:00 2001
From: Qiu Chaofan <qiucofan at cn.ibm.com>
Date: Mon, 25 Sep 2023 16:57:39 +0800
Subject: [PATCH 1/2] [PowerPC] Disable float128 on AIX in Clang
PowerPC AIX backend does not support float128 at all. Diagnose even when
specifying -mfloat128 to avoid backend crash.
---
clang/lib/Basic/Targets/PPC.cpp | 2 +-
clang/test/Sema/128bitfloat.cpp | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
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
>From f9dee59aff25899aaafc33b681bfab8ae217a01c Mon Sep 17 00:00:00 2001
From: Qiu Chaofan <qcf at ecnelises.com>
Date: Thu, 16 Nov 2023 15:09:27 +0800
Subject: [PATCH 2/2] Apply suggestions from code review
Co-authored-by: Kai Luo <gluokai at gmail.com>
---
clang/lib/Basic/Targets/PPC.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/clang/lib/Basic/Targets/PPC.cpp b/clang/lib/Basic/Targets/PPC.cpp
index 119ed9c1ac4504e..f6900c9d712536d 100644
--- a/clang/lib/Basic/Targets/PPC.cpp
+++ b/clang/lib/Basic/Targets/PPC.cpp
@@ -52,8 +52,8 @@ bool PPCTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
HasDirectMove = true;
} else if (Feature == "+htm") {
HasHTM = true;
- } else if (Feature == "+float128" && !getTriple().isOSAIX()) {
- HasFloat128 = true;
+ } else if (Feature == "+float128") {
+ HasFloat128 = !getTriple().isOSAIX();
} else if (Feature == "+power9-vector") {
HasP9Vector = true;
} else if (Feature == "+power10-vector") {
More information about the cfe-commits
mailing list