[libcxx-commits] [clang] [libcxx] [Clang] Allow __builtin_fma/fmaf/fmal to be used in a constant expression (PR #158048)
Chaitanya Koparkar via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Sep 18 06:56:32 PDT 2025
ckoparkar wrote:
> It seems the result got folded despite potential changes to the rounding mode at run time?
The constexpr evaluator uses [getActiveRoundingMode](https://github.com/llvm/llvm-project/blob/main/clang/lib/AST/ExprConstant.cpp#L2765) to get the current rounding mode; it is used to evaluate fma, along with binary ops like *, +, -, etc. Here are the tests for fma with various rounding modes: [clang/test/CodeGen/rounding-math.cpp](https://github.com/llvm/llvm-project/blob/main/clang/test/CodeGen/rounding-math.cpp#L15).
> Also, the FENV_ROUND pragma is working despite the warning. Tests should be added.
Is your suggestion to add tests with different rounding modes?
https://github.com/llvm/llvm-project/pull/158048
More information about the libcxx-commits
mailing list