[flang-commits] [PATCH] D129020: [flang] Cope with overflow in real MOD/MODULO

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Jul 1 15:15:40 PDT 2022


klausler created this revision.
klausler added a reviewer: vzakhari.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
Herald added a project: All.
klausler requested review of this revision.

In folding and in the runtime library for real MOD/MODULO(A,P),
detect overflow from the division A/P and return a properly signed
zero result.  (When A/P overflows and both A and P are finite numbers
with nonzero P, the quotient would be a large integer when rounded to
the precision of the floating-point representation.)


https://reviews.llvm.org/D129020

Files:
  flang/lib/Evaluate/real.cpp
  flang/runtime/numeric.cpp
  flang/test/Evaluate/fold-mod.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129020.441795.patch
Type: text/x-patch
Size: 5581 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220701/142c4030/attachment.bin>


More information about the flang-commits mailing list