[libcxx] [clang] [PowerPC] Emit libcall to frexpl for calls to frexp(ppcDoublDouble) (PR #75226)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 12 17:39:24 PST 2023


================
@@ -3410,9 +3419,15 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
                                    { Src0->getType(), Src1->getType() });
     return RValue::get(Builder.CreateCall(F, { Src0, Src1 }));
   }
+  case Builtin::BI__builtin_frexpl: {
+    auto &Triple = getTarget().getTriple();
+    if (Triple.isPPC() && Triple.isOSLinux() &&
----------------
efriedma-quic wrote:

Checking isOSLinux() seems more likely to cause trouble than to solve anything; checking the floating-point format should be sufficient to ensure this doesn't trigger by accident.

Maybe add a brief comment here explaining why this special case is necessary.

https://github.com/llvm/llvm-project/pull/75226


More information about the cfe-commits mailing list