This is an archive of the discontinued LLVM Phabricator instance.

[APFloat] Fix subtraction of subnormal numbers
ClosedPublic

Authored by ekatz on Nov 3 2019, 12:31 PM.

Details

Summary

Fix incorrect determination of the bigger number out of the two subtracted, while subnormal numbers are involved.

Diff Detail

Event Timeline

ekatz created this revision.Nov 3 2019, 12:31 PM
lattner edited reviewers, added: scanon; removed: lattner.Nov 3 2019, 3:57 PM

I'd recommend adding Steve Canon to APFloat related patches. Thanks!

foad added a reviewer: foad.Nov 19 2019, 1:31 PM
foad added a subscriber: foad.

LGTM.

Would you mind adding a fused multiply-add test case like the one from bug 44010?

llvm/lib/Support/APFloat.cpp
1549

The diff would be smaller if you left these tests in the same order :-)

foad accepted this revision.Nov 19 2019, 1:32 PM

LGTM.

This revision is now accepted and ready to land.Nov 19 2019, 1:32 PM
foad added a comment.Nov 20 2019, 11:17 AM

@ekatz are you able to commit this yourself? Or are planning to obtain commit access (https://llvm.org/docs/DeveloperPolicy.html#new-contributors)?

ekatz added a comment.Nov 20 2019, 1:52 PM

@ekatz are you able to commit this yourself? Or are planning to obtain commit access (https://llvm.org/docs/DeveloperPolicy.html#new-contributors)?

Thanks for asking. I've requested commit access - waiting for reply.

ekatz updated this revision to Diff 230673.Nov 22 2019, 9:34 AM

Reordered the conditions, to make a smaller diff.

Also replaced the previous test case with the one from PR44010, as it is practically the same, but also tests the result.

foad accepted this revision.Nov 22 2019, 10:18 AM

Looks even better to me now :-)

This revision was automatically updated to reflect the committed changes.