This is an archive of the discontinued LLVM Phabricator instance.

[flang] Make SQRT folding exact
ClosedPublic

Authored by klausler on Jun 22 2022, 3:43 PM.

Details

Summary

Replace the latter half of the SQRT() folding algorithm with code that
calculates an exact root with extra rounding bits, and then lets the
usual normalization and rounding code do the right thing. Extend
tests to catch regressions.

Diff Detail

Event Timeline

klausler created this revision.Jun 22 2022, 3:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 22 2022, 3:43 PM
Herald added a subscriber: jdoerfert. · View Herald Transcript
klausler requested review of this revision.Jun 22 2022, 3:43 PM
jeanPerier accepted this revision.Jun 23 2022, 1:19 AM

LGTM, maybe some leftover debugging in unittests/Evaluate/real.cpp though.

flang/unittests/Evaluate/real.cpp
403

Was it intended to push this part ?

This revision is now accepted and ready to land.Jun 23 2022, 1:19 AM
klausler added inline comments.Jun 23 2022, 8:36 AM
flang/unittests/Evaluate/real.cpp
403

No, of course not.

This revision was automatically updated to reflect the committed changes.