This is an archive of the discontinued LLVM Phabricator instance.

Add f16 nearbyint support.
ClosedPublic

Authored by Leonc on Oct 3 2022, 8:29 PM.

Details

Summary

Enable lowering of FNEARBYINT for f16 and extend existing tests.

Diff Detail

Event Timeline

Leonc created this revision.Oct 3 2022, 8:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 3 2022, 8:29 PM
Leonc requested review of this revision.Oct 3 2022, 8:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 3 2022, 8:29 PM
arsenm added inline comments.Oct 3 2022, 8:31 PM
llvm/test/CodeGen/AMDGPU/fnearbyint.ll
6–7

This test is missing checks somehow

Leonc added inline comments.Oct 3 2022, 8:34 PM
llvm/test/CodeGen/AMDGPU/fnearbyint.ll
6–7

Do we want checks for all of the functions? The comment on lines 5-6 suggests the checks were left out intentionally.

Leonc added a comment.Oct 3 2022, 8:37 PM

Comments on SWDEV-353076 suggested there was a related issue with roundeven but I wasn't able to find any.

arsenm added inline comments.Oct 3 2022, 9:03 PM
llvm/test/CodeGen/AMDGPU/fnearbyint.ll
6–7

The comment is nonsense and it's bad practice to have no checks

Leonc added inline comments.Oct 3 2022, 9:14 PM
llvm/test/CodeGen/AMDGPU/fnearbyint.ll
6–7

I'm happy to add the checks. If I only add them for nearbyint.f16 people might argue that the new code is inconsistent. If I add them for every function the changes would be out of scope for the task. What's the preferred option here?

arsenm added inline comments.Oct 3 2022, 9:26 PM
llvm/test/CodeGen/AMDGPU/fnearbyint.ll
6–7

Fix the test by adding checks in a pre commit before this patch

Leonc updated this revision to Diff 467526.Oct 13 2022, 10:23 AM
  • Add FileCheck directives.
Leonc marked 3 inline comments as done.Oct 13 2022, 10:26 AM
arsenm accepted this revision.Oct 13 2022, 6:50 PM

LGTM

This revision is now accepted and ready to land.Oct 13 2022, 6:50 PM
This revision was automatically updated to reflect the committed changes.