Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Sep 2019 19:43:00 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r352539 - in projects/clang900-import/contrib/llvm/tools/clang: include/clang/Driver lib/Basic/Targets lib/CodeGen
Message-ID:  <201909191943.x8JJh0ZJ096361@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Thu Sep 19 19:42:59 2019
New Revision: 352539
URL: https://svnweb.freebsd.org/changeset/base/352539

Log:
  Pull in r371066 from upstream clang trunk (by Justin Hibbits):
  
    Add -m(no)-spe to clang
  
    Summary:
    r337347 added support for the Signal Processing Engine (SPE) to LLVM.
    This follows that up with the clang side.
  
    This adds -mspe and -mno-spe, to match GCC.
  
    Subscribers: nemanjai, kbarton, cfe-commits
  
    Differential Revision: https://reviews.llvm.org/D49754

Modified:
  projects/clang900-import/contrib/llvm/tools/clang/include/clang/Driver/Options.td
  projects/clang900-import/contrib/llvm/tools/clang/lib/Basic/Targets/PPC.cpp
  projects/clang900-import/contrib/llvm/tools/clang/lib/Basic/Targets/PPC.h
  projects/clang900-import/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp

Modified: projects/clang900-import/contrib/llvm/tools/clang/include/clang/Driver/Options.td
==============================================================================
--- projects/clang900-import/contrib/llvm/tools/clang/include/clang/Driver/Options.td	Thu Sep 19 19:39:34 2019	(r352538)
+++ projects/clang900-import/contrib/llvm/tools/clang/include/clang/Driver/Options.td	Thu Sep 19 19:42:59 2019	(r352539)
@@ -2241,6 +2241,8 @@ def faltivec : Flag<["-"], "faltivec">, Group<f_Group>
 def fno_altivec : Flag<["-"], "fno-altivec">, Group<f_Group>, Flags<[DriverOption]>;
 def maltivec : Flag<["-"], "maltivec">, Group<m_ppc_Features_Group>;
 def mno_altivec : Flag<["-"], "mno-altivec">, Group<m_ppc_Features_Group>;
+def mspe : Flag<["-"], "mspe">, Group<m_ppc_Features_Group>;
+def mno_spe : Flag<["-"], "mno-spe">, Group<m_ppc_Features_Group>;
 def mvsx : Flag<["-"], "mvsx">, Group<m_ppc_Features_Group>;
 def mno_vsx : Flag<["-"], "mno-vsx">, Group<m_ppc_Features_Group>;
 def msecure_plt : Flag<["-"], "msecure-plt">, Group<m_ppc_Features_Group>;

Modified: projects/clang900-import/contrib/llvm/tools/clang/lib/Basic/Targets/PPC.cpp
==============================================================================
--- projects/clang900-import/contrib/llvm/tools/clang/lib/Basic/Targets/PPC.cpp	Thu Sep 19 19:39:34 2019	(r352538)
+++ projects/clang900-import/contrib/llvm/tools/clang/lib/Basic/Targets/PPC.cpp	Thu Sep 19 19:42:59 2019	(r352539)
@@ -54,6 +54,10 @@ bool PPCTargetInfo::handleTargetFeatures(std::vector<s
       HasFloat128 = true;
     } else if (Feature == "+power9-vector") {
       HasP9Vector = true;
+    } else if (Feature == "+spe") {
+      HasSPE = true;
+      LongDoubleWidth = LongDoubleAlign = 64;
+      LongDoubleFormat = &llvm::APFloat::IEEEdouble();
     } else if (Feature == "-hard-float") {
       FloatABI = SoftFloat;
     }
@@ -165,6 +169,10 @@ void PPCTargetInfo::getTargetDefines(const LangOptions
     Builder.defineMacro("__VEC__", "10206");
     Builder.defineMacro("__ALTIVEC__");
   }
+  if (HasSPE) {
+    Builder.defineMacro("__SPE__");
+    Builder.defineMacro("__NO_FPRS__");
+  }
   if (HasVSX)
     Builder.defineMacro("__VSX__");
   if (HasP8Vector)
@@ -203,7 +211,6 @@ void PPCTargetInfo::getTargetDefines(const LangOptions
   //   __CMODEL_LARGE__
   //   _CALL_SYSV
   //   _CALL_DARWIN
-  //   __NO_FPRS__
 }
 
 // Handle explicit options being passed to the compiler here: if we've
@@ -332,6 +339,7 @@ bool PPCTargetInfo::hasFeature(StringRef Feature) cons
       .Case("extdiv", HasExtDiv)
       .Case("float128", HasFloat128)
       .Case("power9-vector", HasP9Vector)
+      .Case("spe", HasSPE)
       .Default(false);
 }
 

Modified: projects/clang900-import/contrib/llvm/tools/clang/lib/Basic/Targets/PPC.h
==============================================================================
--- projects/clang900-import/contrib/llvm/tools/clang/lib/Basic/Targets/PPC.h	Thu Sep 19 19:39:34 2019	(r352538)
+++ projects/clang900-import/contrib/llvm/tools/clang/lib/Basic/Targets/PPC.h	Thu Sep 19 19:42:59 2019	(r352539)
@@ -66,6 +66,7 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetInfo : public T
   bool HasBPERMD = false;
   bool HasExtDiv = false;
   bool HasP9Vector = false;
+  bool HasSPE = false;
 
 protected:
   std::string ABI;

Modified: projects/clang900-import/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp
==============================================================================
--- projects/clang900-import/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp	Thu Sep 19 19:39:34 2019	(r352538)
+++ projects/clang900-import/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp	Thu Sep 19 19:42:59 2019	(r352539)
@@ -9716,7 +9716,8 @@ const TargetCodeGenInfo &CodeGenModule::getTargetCodeG
 
   case llvm::Triple::ppc:
     return SetCGInfo(
-        new PPC32TargetCodeGenInfo(Types, CodeGenOpts.FloatABI == "soft"));
+        new PPC32TargetCodeGenInfo(Types, CodeGenOpts.FloatABI == "soft" ||
+                                   getTarget().hasFeature("spe")));
   case llvm::Triple::ppc64:
     if (Triple.isOSBinFormatELF()) {
       PPC64_SVR4_ABIInfo::ABIKind Kind = PPC64_SVR4_ABIInfo::ELFv1;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909191943.x8JJh0ZJ096361>