This is an archive of the discontinued LLVM Phabricator instance.

[flang] Cope with overflow in real MOD/MODULO
ClosedPublic

Authored by klausler on Jul 1 2022, 3:15 PM.

Details

Summary

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

Diff Detail

Event Timeline

klausler created this revision.Jul 1 2022, 3:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 1 2022, 3:15 PM
Herald added a subscriber: jdoerfert. · View Herald Transcript
klausler requested review of this revision.Jul 1 2022, 3:15 PM
vzakhari accepted this revision.Jul 5 2022, 1:28 PM

Sorry for the delay. LGTM.

This revision is now accepted and ready to land.Jul 5 2022, 1:28 PM
This revision was automatically updated to reflect the committed changes.