Skip to content

[PowerPC] Disable float128 on AIX in Clang #67298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 20, 2023

Conversation

ecnelises
Copy link
Member

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

PowerPC AIX backend does not support float128 at all. Diagnose even when
specifying -mfloat128 to avoid backend crash.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Sep 25, 2023
@llvmbot
Copy link
Member

llvmbot commented Sep 25, 2023

@llvm/pr-subscribers-clang

Changes

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 --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

Copy link
Collaborator

@bzEq bzEq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@ecnelises ecnelises merged commit d572c4c into llvm:main Nov 20, 2023
@ecnelises ecnelises deleted the aix_float128_disable branch November 20, 2023 07:21
sr-tream pushed a commit to sr-tream/llvm-project that referenced this pull request Nov 20, 2023
PowerPC AIX backend does not support float128 at all. Diagnose even when
specifying -mfloat128 to avoid backend crash.

---------

Co-authored-by: Kai Luo <[email protected]>
zahiraam pushed a commit to zahiraam/llvm-project that referenced this pull request Nov 20, 2023
PowerPC AIX backend does not support float128 at all. Diagnose even when
specifying -mfloat128 to avoid backend crash.

---------

Co-authored-by: Kai Luo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants