This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Add G_INTRINSIC_LRINT and translate from llvm.lrint
ClosedPublic

Authored by aemerson on Jul 24 2020, 1:04 PM.

Diff Detail

Event Timeline

aemerson created this revision.Jul 24 2020, 1:04 PM

This will conflict with D84159.

Why does the IR have rint, lrint, and llrint? libm has all 3, but they seem to just differ by the return integer type? Why isn't there just the one rint intrinsic and clang is responsible for picking the right result type?

This will conflict with D84159.

Why does the IR have rint, lrint, and llrint? libm has all 3, but they seem to just differ by the return integer type? Why isn't there just the one rint intrinsic and clang is responsible for picking the right result type?

Conflict in what way?

This will conflict with D84159.

Why does the IR have rint, lrint, and llrint? libm has all 3, but they seem to just differ by the return integer type? Why isn't there just the one rint intrinsic and clang is responsible for picking the right result type?

Conflict in what way?

Touches the same lines

Ok. I can see there's a different in FP exception behavior for rint but I'm not sure what the difference is between llvm.lrint.i64.f32 and llvm.llrint.f32.

aemerson updated this revision to Diff 280626.Jul 24 2020, 5:14 PM

Update legalizer validation test.

arsenm accepted this revision.Jul 29 2020, 9:43 AM

Ping

These intrinsics were added a lot more recently than I thought by D62017

I think it doesn't really make sense to provide these redundant intrinsics, and math intrinsics are not supposed to provide a 1:1 wrapper around libm. But they're there now, and I would like to eliminate the intrinsic handling delta against SelectionDAG

This revision is now accepted and ready to land.Jul 29 2020, 9:43 AM
This revision was landed with ongoing or failed builds.Jul 29 2020, 11:51 AM
This revision was automatically updated to reflect the committed changes.