llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-powerpc

@llvm/pr-subscribers-clang

Author: Alex Rønne Petersen (alexrp)

<details>
<summary>Changes</summary>

Fixes #<!-- -->105972.

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


1 Files Affected:

- (modified) clang/lib/Basic/Targets/PPC.cpp (+5-3) 


``````````diff
diff --git a/clang/lib/Basic/Targets/PPC.cpp b/clang/lib/Basic/Targets/PPC.cpp
index 04dc436eb1b9cd..91145b256804c7 100644
--- a/clang/lib/Basic/Targets/PPC.cpp
+++ b/clang/lib/Basic/Targets/PPC.cpp
@@ -402,9 +402,13 @@ void PPCTargetInfo::getTargetDefines(const LangOptions 
&Opts,
     Builder.defineMacro("__VEC__", "10206");
     Builder.defineMacro("__ALTIVEC__");
   }
-  if (HasSPE) {
+  if (HasSPE)
     Builder.defineMacro("__SPE__");
+  if (HasSPE || FloatABI == SoftFloat)
     Builder.defineMacro("__NO_FPRS__");
+  if (FloatABI == SoftFloat) {
+    Builder.defineMacro("_SOFT_FLOAT");
+    Builder.defineMacro("_SOFT_DOUBLE");
   }
   if (HasVSX)
     Builder.defineMacro("__VSX__");
@@ -439,14 +443,12 @@ void PPCTargetInfo::getTargetDefines(const LangOptions 
&Opts,
   // FIXME: The following are not yet generated here by Clang, but are
   //        generated by GCC:
   //
-  //   _SOFT_FLOAT_
   //   __RECIP_PRECISION__
   //   __APPLE_ALTIVEC__
   //   __RECIP__
   //   __RECIPF__
   //   __RSQRTE__
   //   __RSQRTEF__
-  //   _SOFT_DOUBLE_
   //   __NO_LWSYNC__
   //   __CMODEL_MEDIUM__
   //   __CMODEL_LARGE__

``````````

</details>


https://github.com/llvm/llvm-project/pull/106012
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to