[clang] [PowerPC][RFC] Make power9-vector indicate isa-3.0 and power9-altivec (PR #86905)

Kai Luo via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 27 20:29:42 PDT 2024


https://github.com/bzEq created https://github.com/llvm/llvm-project/pull/86905

This is to address https://github.com/llvm/llvm-project/issues/84703. However this might not be a long-term solution in my view.

>From 99e76dbe0016332ed1d21edbf5297cd5189afe3d Mon Sep 17 00:00:00 2001
From: Kai Luo <lkail at cn.ibm.com>
Date: Thu, 28 Mar 2024 03:31:30 +0000
Subject: [PATCH] Indicate pwr9 and p9 altivec

---
 clang/lib/Basic/Targets/PPC.cpp | 3 +++
 1 file changed, 3 insertions(+)

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") {



More information about the cfe-commits mailing list