Make IEEEFloat::roundToIntegral more standard conformant
authorSerge Pavlov <sepavloff@gmail.com>
Thu, 27 Feb 2020 11:16:14 +0000 (18:16 +0700)
committerSerge Pavlov <sepavloff@gmail.com>
Wed, 11 Mar 2020 03:38:46 +0000 (10:38 +0700)
commit14a1b80e044aac1947c891525cf30521be0a79b7
tree747231d13fe6fad8909535d57e4d732adf9a3336
parentc0ad75e7587d2e08ba2d5c55311b44ce7f9b20e4
Make IEEEFloat::roundToIntegral more standard conformant

Behavior of IEEEFloat::roundToIntegral is aligned with IEEE-754
operation roundToIntegralExact. In partucular this function now:
- returns opInvalid for signaling NaNs,
- returns opInexact if the result of rounding differs from argument.

Differential Revision: https://reviews.llvm.org/D75246
llvm/lib/Support/APFloat.cpp
llvm/unittests/ADT/APFloatTest.cpp