[clang] [clang] constexpr built-in fma function. (PR #113020)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Oct 19 01:35:08 PDT 2024
================
@@ -15314,6 +15314,22 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) {
Result.changeSign();
return true;
+ case Builtin::BI__builtin_fma:
+ case Builtin::BI__builtin_fmaf:
+ case Builtin::BI__builtin_fmal:
+ case Builtin::BI__builtin_fmaf128: {
+ APFloat Y(0.), Z(0.);
+ if (!EvaluateFloat(E->getArg(0), Result, Info) ||
+ !EvaluateFloat(E->getArg(1), Y, Info) ||
+ !EvaluateFloat(E->getArg(2), Z, Info))
+ return false;
+
+ llvm::RoundingMode RM = getActiveRoundingMode(Info, E);
+ Result.multiply(Y, RM);
+ Result.add(Z, RM);
----------------
c8ef wrote:
Done. Thanks for pointing it out!
https://github.com/llvm/llvm-project/pull/113020
More information about the cfe-commits
mailing list