Skip to content

Conversation

@bzEq
Copy link
Collaborator

@bzEq bzEq commented Mar 28, 2024

This is to address #84703. However this might not be a long-term solution in my view.

@llvmbot llvmbot added clang Clang issues not falling into any other category backend:PowerPC clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Mar 28, 2024
@llvmbot
Copy link
Member

llvmbot commented Mar 28, 2024

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-backend-powerpc

Author: Kai Luo (bzEq)

Changes

This is to address #84703. However this might not be a long-term solution in my view.


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

1 Files Affected:

  • (modified) clang/lib/Basic/Targets/PPC.cpp (+3)
diff --git a/clang/lib/Basic/Targets/PPC.cpp b/clang/lib/Basic/Targets/PPC.cpp
index aebe51bfa4daad..14caa1898a9eb8 100644
--- a/clang/lib/Basic/Targets/PPC.cpp
+++ b/clang/lib/Basic/Targets/PPC.cpp
@@ -597,6 +597,7 @@ bool PPCTargetInfo::initFeatureMap(
                                           .Default(false);
 
   Features["isa-v30-instructions"] =
+      llvm::is_contained(FeaturesVec, "+power9-vector") or
       llvm::StringSwitch<bool>(CPU).Case("pwr9", true).Default(false);
 
   Features["quadword-atomics"] =
@@ -605,6 +606,8 @@ bool PPCTargetInfo::initFeatureMap(
                                        .Case("pwr8", true)
                                        .Default(false);
 
+  Features["power9-altivec"] = llvm::is_contained(FeaturesVec, "+power9-vector");
+
   // Power10 includes all the same features as Power9 plus any features specific
   // to the Power10 core.
   if (CPU == "pwr10" || CPU == "power10") {

@github-actions
Copy link

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff 4d315ff382de912e5129b417c997116851088d4b 99e76dbe0016332ed1d21edbf5297cd5189afe3d -- clang/lib/Basic/Targets/PPC.cpp
View the diff from clang-format here.
diff --git a/clang/lib/Basic/Targets/PPC.cpp b/clang/lib/Basic/Targets/PPC.cpp
index 14caa1898a..b6b968d638 100644
--- a/clang/lib/Basic/Targets/PPC.cpp
+++ b/clang/lib/Basic/Targets/PPC.cpp
@@ -606,7 +606,8 @@ bool PPCTargetInfo::initFeatureMap(
                                        .Case("pwr8", true)
                                        .Default(false);
 
-  Features["power9-altivec"] = llvm::is_contained(FeaturesVec, "+power9-vector");
+  Features["power9-altivec"] =
+      llvm::is_contained(FeaturesVec, "+power9-vector");
 
   // Power10 includes all the same features as Power9 plus any features specific
   // to the Power10 core.

@chenzheng1030
Copy link
Collaborator

No need for this change if GCC is going to drop this option in its latest versions.

@bzEq
Copy link
Collaborator Author

bzEq commented Feb 13, 2025

I am not going to pursue this PR, close it.

@bzEq bzEq closed this Feb 13, 2025
@bzEq bzEq deleted the power9-vector branch February 13, 2025 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend:PowerPC 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