File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -15314,6 +15314,33 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) {
1531415314 Result = RHS;
1531515315 return true;
1531615316 }
15317+
15318+ case Builtin::BI__builtin_fmaximum_num:
15319+ case Builtin::BI__builtin_fmaximum_numf:
15320+ case Builtin::BI__builtin_fmaximum_numl:
15321+ case Builtin::BI__builtin_fmaximum_numf16:
15322+ case Builtin::BI__builtin_fmaximum_numf128: {
15323+ APFloat RHS(0.);
15324+ if (!EvaluateFloat(E->getArg(0), Result, Info) ||
15325+ !EvaluateFloat(E->getArg(1), RHS, Info))
15326+ return false;
15327+ Result = maximumnum(Result, RHS);
15328+ return true;
15329+ }
15330+
15331+ case Builtin::BI__builtin_fminimum_num:
15332+ case Builtin::BI__builtin_fminimum_numf:
15333+ case Builtin::BI__builtin_fminimum_numl:
15334+ case Builtin::BI__builtin_fminimum_numf16:
15335+ case Builtin::BI__builtin_fminimum_numf128: {
15336+ APFloat RHS(0.);
15337+ if (!EvaluateFloat(E->getArg(0), Result, Info) ||
15338+ !EvaluateFloat(E->getArg(1), RHS, Info))
15339+ return false;
15340+ Result = minimumnum(Result, RHS);
15341+ return true;
15342+ }
15343+
1531715344 }
1531815345}
1531915346
Original file line number Diff line number Diff line change 5858
5959// Check __has_constexpr_builtin
6060#if !__has_constexpr_builtin(__builtin_fmax) || \
61- !__has_constexpr_builtin(__builtin_fmin)
61+ !__has_constexpr_builtin(__builtin_fmin) || \
62+ !__has_constexpr_builtin(__builtin_fmaximum_num) || \
63+ !__has_constexpr_builtin(__builtin_fmaximum_num)
6264#error Clang should have these constexpr builtins
6365#endif
6466
You can’t perform that action at this time.
0 commit comments