[all-commits] [llvm/llvm-project] 715283: [flang] Cope with overflow in real MOD/MODULO

Peter Klausler via All-commits all-commits at lists.llvm.org
Wed Jul 6 17:35:16 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 715283aa1792ed1dc0cf513128f272fd92dd06da
      https://github.com/llvm/llvm-project/commit/715283aa1792ed1dc0cf513128f272fd92dd06da
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2022-07-06 (Wed, 06 Jul 2022)

  Changed paths:
    M flang/lib/Evaluate/real.cpp
    M flang/runtime/numeric.cpp
    M flang/test/Evaluate/fold-mod.f90

  Log Message:
  -----------
  [flang] Cope with overflow in real MOD/MODULO

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.)

Differential Revision: https://reviews.llvm.org/D129020




More information about the All-commits mailing list