[flang-commits] [PATCH] D127785: [flang] NINT(-.4999) is 0, not overflow
Peter Klausler via Phabricator via flang-commits
flang-commits at lists.llvm.org
Thu Jun 16 10:48:09 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rG2665fbe71e1d: [flang] NINT(-.4999) is 0, not overflow (authored by klausler).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D127785/new/
https://reviews.llvm.org/D127785
Files:
flang/include/flang/Evaluate/real.h
Index: flang/include/flang/Evaluate/real.h
===================================================================
--- flang/include/flang/Evaluate/real.h
+++ flang/include/flang/Evaluate/real.h
@@ -280,8 +280,10 @@
if (IsSignBitSet()) {
result.value = result.value.Negate().value;
}
- if (IsSignBitSet() != result.value.IsNegative()) {
- result.flags.set(RealFlag::Overflow);
+ if (!result.value.IsZero()) {
+ if (IsSignBitSet() != result.value.IsNegative()) {
+ result.flags.set(RealFlag::Overflow);
+ }
}
if (result.flags.test(RealFlag::Overflow)) {
result.value =
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127785.437599.patch
Type: text/x-patch
Size: 626 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220616/c705c2c6/attachment.bin>
More information about the flang-commits
mailing list