quinnp created this revision.
Herald added subscribers: shchenz, kbarton, nemanjai.
quinnp requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

[NFC] This patch adds features for pwr7, pwr8, and pwr9 that can be
used for semacheking builtin functions that are only valid for certain
versions of ppc.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105501

Files:
  clang/lib/Basic/Targets/PPC.cpp


Index: clang/lib/Basic/Targets/PPC.cpp
===================================================================
--- clang/lib/Basic/Targets/PPC.cpp
+++ clang/lib/Basic/Targets/PPC.cpp
@@ -422,6 +422,14 @@
     return false;
   }
 
+  Features["isa207"] = llvm::StringSwitch<bool>(CPU)
+                           .Case("pwr9", true)
+                           .Case("ppc64le", true)
+                           .Case("pwr8", true)
+                           .Default(false);
+  Features["isa30"] =
+      llvm::StringSwitch<bool>(CPU).Case("pwr9", true).Default(false);
+
   return TargetInfo::initFeatureMap(Features, Diags, CPU, FeaturesVec);
 }
 
@@ -434,6 +442,7 @@
   Features["power10-vector"] = true;
   Features["pcrelative-memops"] = true;
   Features["prefix-instrs"] = true;
+  Features["isa31"] = true;
   return;
 }
 


Index: clang/lib/Basic/Targets/PPC.cpp
===================================================================
--- clang/lib/Basic/Targets/PPC.cpp
+++ clang/lib/Basic/Targets/PPC.cpp
@@ -422,6 +422,14 @@
     return false;
   }
 
+  Features["isa207"] = llvm::StringSwitch<bool>(CPU)
+                           .Case("pwr9", true)
+                           .Case("ppc64le", true)
+                           .Case("pwr8", true)
+                           .Default(false);
+  Features["isa30"] =
+      llvm::StringSwitch<bool>(CPU).Case("pwr9", true).Default(false);
+
   return TargetInfo::initFeatureMap(Features, Diags, CPU, FeaturesVec);
 }
 
@@ -434,6 +442,7 @@
   Features["power10-vector"] = true;
   Features["pcrelative-memops"] = true;
   Features["prefix-instrs"] = true;
+  Features["isa31"] = true;
   return;
 }
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to