[PATCH] D155546: [clang][Interp] Implement __builtin_fmin

Joshua Cranmer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 25 11:37:56 PDT 2023


jcranmer-intel added a comment.

In D155546#4510691 <https://reviews.llvm.org/D155546#4510691>, @aaron.ballman wrote:

> It's not yet clear to me what happens when any of these functions encounter a signaling NaN at compile time. CC @hubert.reinterpretcast @jcranmer-intel @rsmith

`fmin(sNaN, x)` signals FE_INVALID, which would be a compile-time error per [library.c]p3 (every FP exception save FE_INEXACT is a compile-time error). Except sNaN raising FE_INVALID is only a //recommended// practice, so it's really unclear what the C++ standard attempts to say on this matter.

Treating sNaN as always signaling FE_INVALID is probably the safer option.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155546



More information about the cfe-commits mailing list