This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Fix target options fp32/64-denormals
ClosedPublic

Authored by yaxunl on Sep 13 2016, 9:33 AM.

Details

Summary

Fix target options for fp32/64-denormals so that

+fp64-denormals is set if fp64 is supported
-fp32-denormals if fp32 denormals is not supported, or -cl-denorms-are-zero is set
+fp32-denormals if fp32 denormals is supported and -cl-denorms-are-zero is not set

If target feature fp32/64-denormals is explicitly set, they will override default options and options deduced from -cl-denorms-are-zero.

Diff Detail

Repository
rL LLVM

Event Timeline

yaxunl updated this revision to Diff 71183.Sep 13 2016, 9:33 AM
yaxunl retitled this revision from to AMDGPU: Fix target options fp32/64-denormals.
yaxunl updated this object.
yaxunl added subscribers: cfe-commits, Restricted Project.
yaxunl updated this object.Sep 13 2016, 9:36 AM
tstellarAMD accepted this revision.Sep 13 2016, 9:58 AM
tstellarAMD edited edge metadata.

Once small comment otherwise. LGTM.

lib/Basic/Targets.cpp
1962 ↗(On Diff #71183)

I think this name is a little confusing, because the hardware does support fp32 denorms. I would change this to something like hasFullSpeedFP32Denorms.

This revision is now accepted and ready to land.Sep 13 2016, 9:58 AM
yaxunl added inline comments.Sep 13 2016, 10:02 AM
lib/Basic/Targets.cpp
1962 ↗(On Diff #71183)

I will change that when committing. Thanks.

This revision was automatically updated to reflect the committed changes.