This is an archive of the discontinued LLVM Phabricator instance.

Patch IEEEFloat::isSignificandAllZeros and IEEEFloat::isSignificandAllOnes (bug 34579)
ClosedPublic

Authored by andrewbriand on Sep 25 2020, 2:33 PM.

Details

Summary

Patch IEEEFloat::isSignificandAllZeros and IEEEFloat::isSignificandAllOnes to behave correctly in the case that the size of the significand is a multiple of the width of the integerParts making up the significand.

The patch to IEEEFloat::isSignificandAllOnes fixes bug 34579, and the patch to IEEE:Float:isSignificandAllZeros fixes the unit test "APFloatTest.x87Next" I added here. I have included both in this diff since the changes are very similar.

Diff Detail

Event Timeline

andrewbriand created this revision.Sep 25 2020, 2:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 25 2020, 2:33 PM
andrewbriand requested review of this revision.Sep 25 2020, 2:33 PM
craig.topper added inline comments.Sep 29 2020, 9:54 PM
llvm/lib/Support/APFloat.cpp
845

Does the original code just work if we change this line to "unsigned PartCount = partCountForBits(semantics->precision)"? That will calculate the part count without the guard bit.

Use partCountForBits(semantics->precision) to calculate part count without guard bit.

andrewbriand added inline comments.Sep 30 2020, 11:29 AM
llvm/lib/Support/APFloat.cpp
845

Yes, that does work. I've updated the patch accordingly.

This revision is now accepted and ready to land.Sep 30 2020, 11:31 AM

LGTM

Thank you, I don't have commit access so I can't commit this myself.