================ @@ -5980,6 +5987,64 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, return Ret; } +static bool endsWithRoundingModeSuffix(StringRef FuncName) { + size_t Underscore = FuncName.find_last_of("_"); + if (Underscore == StringRef::npos || Underscore < 2) + return false; + StringRef Suffix = FuncName.substr(Underscore + 1); + static const StringRef RMSuffixes[] = {"rtz", "rte", "rtp", "rtn", "rhaz", + "rz", "rn", "ru", "rd"}; + for (auto RM : RMSuffixes) { + if (Suffix == RM) + return true; + } + return false; +} + +bool CodeGenFunction::requiresDynamicRounding(const CGCallee &Callee) { + if (Callee.isOrdinary()) { + const Decl *CalleeDecl = Callee.getAbstractInfo().getCalleeDecl().getDecl(); + if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(CalleeDecl)) { + IdentifierInfo *FuncNameII = FD->getDeclName().getAsIdentifierInfo(); + if (FuncNameII) { + StringRef FuncName = FuncNameII->getName(); + // If a reserved identifier ends with rounding mode suffix preceded by + // underscore, this function does not need the previous dynamic rounding + // mode to be set. ---------------- jcranmer-intel wrote:
Where is this rule coming from? https://github.com/llvm/llvm-project/pull/89617 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits