Page MenuHomePhabricator

AMDGPU: Fix implementation of isCanonicalized
ClosedPublic

Authored by arsenm on Jul 20 2018, 9:28 AM.

Details

Summary

If denormals are enabled, denormals are canonical.
Also fix a few other issues. minnum/maxnum are supposed
to canonicalize. Temporarily improve workaround for the
instruction behavior change in gfx9.

Handle selects and fcopysign.

The tests were also largely broken, since they were
checking for a flush used on

Diff Detail

Event Timeline

arsenm created this revision.Jul 20 2018, 9:28 AM

I think we need a diff against master.

arsenm added inline comments.Jul 20 2018, 12:37 PM
lib/Target/AMDGPU/SIISelLowering.cpp
6798–6799

I'm not sure if this is right. I'm not sure if the nan needs to be a canonicalized nan with the payload bits cleared if the input had them

arsenm updated this revision to Diff 157461.Jul 26 2018, 4:27 AM

Fix snan understanding

rampitec added inline comments.Jul 26 2018, 12:02 PM
lib/Target/AMDGPU/SIISelLowering.cpp
6784

I think you are missing DAG.isKnownNeverNaN() condition.

arsenm added inline comments.Jul 26 2018, 12:11 PM
lib/Target/AMDGPU/SIISelLowering.cpp
6784

No, I think this is correct. It doesn't matter if there is a nan input since an snan will be correctly quieted

rampitec added inline comments.Jul 26 2018, 12:20 PM
lib/Target/AMDGPU/SIISelLowering.cpp
6784

Hmm.. That sounds right.

This revision is now accepted and ready to land.Jul 26 2018, 12:20 PM
arsenm closed this revision.Aug 6 2018, 2:39 PM

r339061