[PATCH] Add Clang support for -mdirect-move on PPC

Nemanja Ivanovic nemanja.i.ibm at gmail.com
Thu Apr 9 10:46:57 PDT 2015


Hi wschmidt, hfinkel, kbarton,

This is to complete the changes in review D8928 for supporting FP <-> INT conversions using direct move instructions.

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D8930

Files:
  include/clang/Driver/Options.td
  lib/Basic/Targets.cpp

Index: include/clang/Driver/Options.td
===================================================================
--- include/clang/Driver/Options.td
+++ include/clang/Driver/Options.td
@@ -1266,6 +1266,10 @@
     Group<m_ppc_Features_Group>;
 def mnopower8_crypto : Flag<["-"], "mno-crypto">,
     Group<m_ppc_Features_Group>;
+def mdirect_move : Flag<["-"], "mdirect-move">,
+    Group<m_ppc_Features_Group>;
+def mnodirect_move : Flag<["-"], "mno-direct-move">,
+    Group<m_ppc_Features_Group>;
 def mhtm : Flag<["-"], "mhtm">, Group<m_ppc_Features_Group>;
 def mno_htm : Flag<["-"], "mno-htm">, Group<m_ppc_Features_Group>;
 def mfprnd : Flag<["-"], "mfprnd">, Group<m_ppc_Features_Group>;
Index: lib/Basic/Targets.cpp
===================================================================
--- lib/Basic/Targets.cpp
+++ lib/Basic/Targets.cpp
@@ -742,6 +742,7 @@
   bool HasVSX;
   bool HasP8Vector;
   bool HasP8Crypto;
+  bool HasDirectMove;
   bool HasQPX;
   bool HasHTM;
 
@@ -751,7 +752,7 @@
 public:
   PPCTargetInfo(const llvm::Triple &Triple)
     : TargetInfo(Triple), HasVSX(false), HasP8Vector(false),
-      HasP8Crypto(false), HasQPX(false), HasHTM(false) {
+      HasP8Crypto(false), HasDirectMove(false), HasQPX(false), HasHTM(false) {
     BigEndian = (Triple.getArch() != llvm::Triple::ppc64le);
     LongDoubleWidth = LongDoubleAlign = 128;
     LongDoubleFormat = &llvm::APFloat::PPCDoubleDouble;
@@ -1021,6 +1022,11 @@
       continue;
     }
 
+    if (Feature == "direct-move") {
+      HasDirectMove = true;
+      continue;
+    }
+
     if (Feature == "qpx") {
       HasQPX = true;
       continue;
@@ -1233,14 +1239,19 @@
     .Case("ppc64le", true)
     .Case("pwr8", true)
     .Default(false);
+  Features["direct-move"] = llvm::StringSwitch<bool>(CPU)
+    .Case("ppc64le", true)
+    .Case("pwr8", true)
+    .Default(false);
 }
 
 bool PPCTargetInfo::hasFeature(StringRef Feature) const {
   return llvm::StringSwitch<bool>(Feature)
     .Case("powerpc", true)
     .Case("vsx", HasVSX)
     .Case("power8-vector", HasP8Vector)
     .Case("crypto", HasP8Crypto)
+    .Case("direct-move", HasDirectMove)
     .Case("qpx", HasQPX)
     .Case("htm", HasHTM)
     .Default(false);

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8930.23509.patch
Type: text/x-patch
Size: 2205 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150409/2f0f6408/attachment.bin>


More information about the cfe-commits mailing list