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

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 20 23:25:15 PDT 2023


tbaeder added a comment.

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

> I'd like to see test coverage for treatment of NaNs. According to the C23 standard, a quiet NaN is treated as missing data for fmax and fmin; so if there's a quiet NaN and a numeric value, the numeric value it's what's returned.

Isn't this always the case?
``
constexpr float qNan = __builtin_nan("");

constexpr float min = __builtin_fmin(qNan, 1);
static_assert(min == 1);
constexpr float min2 = __builtin_fmin(1, qNan);
static_assert(min2 == 1);

  works already.


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