efriedma added inline comments.

================
Comment at: clang/include/clang/Basic/LangOptions.h:622
     setFPContractMode(LangOptions::FPM_Off);
     setRoundingMode(static_cast<RoundingMode>(LangOptions::FPR_ToNearest));
     setFPExceptionMode(LangOptions::FPE_Ignore);
----------------
sepavloff wrote:
> efriedma wrote:
> > I'm suggesting this should be 
> > `setRoundingMode(llvm::RoundingMode::Dynamic)`.
> > 
> > If FENV_ACCESS is off, getEffectiveRoundingMode() converts that to 
> > "nearest".  If FENV_ACCESS is turned on, the mode is treated as dynamic.  
> > This is exactly what we want.
> It would change semantics. In particular, it would make impossible to use FP 
> arithmetic in constexpr functions. An expression like `1.0 / 3.0` cannot be 
> evaluated with dynamic rounding mode.
Can we just change the relevant code in ExprConstant to call 
getEffectiveRoundingMode()?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126364/new/

https://reviews.llvm.org/D126364

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to