This is an archive of the discontinued LLVM Phabricator instance.

[FPEnv] Add constrained CEIL/FLOOR/ROUND/TRUNC intrinsics
ClosedPublic

Authored by cameron.mcinally on Oct 18 2018, 1:46 PM.

Details

Summary

Here's a small patch to support constrained ceil and floor intrinsics.

These operations only signal INVALID and are never influenced by the rounding mode, so I could be persuaded that we don't *really* need them. But from a pure trap-safety standpoint, we do need them for completeness.

Diff Detail

Repository
rL LLVM

Event Timeline

While you're at it, shouldn't we also add ROUND and TRUNC to complete the set?

kpn added a comment.Oct 19 2018, 5:56 AM

While you're at it, shouldn't we also add ROUND and TRUNC to complete the set?

Those are in D43515 which I'm still working on.

In D53411#1269133, @kpn wrote:

While you're at it, shouldn't we also add ROUND and TRUNC to complete the set?

Those are in D43515 which I'm still working on.

I don't see them there ... D43515 does have FP_ROUND and FP_EXTEND (conversions between different FP formats), but it doesn't have FROUND and FTRUNC (the two other versions of round-to-integral-value within the same FP format, together with FRINT, FNEARBYINT, FFLOOR, and FCEIL).

cameron.mcinally retitled this revision from [FPEnv] Add constrained CEIL and FLOOR intrinsics to [FPEnv] Add constrained CEIL/FLOOR/ROUND/TRUNC intrinsics.

@uweigand

Add support for FROUND and FTRUNC too.

Rebase and remove extra '^' characters from docs/LangRef.rst.

andrew.w.kaylor accepted this revision.Nov 2 2018, 4:00 PM

This looks good, except that I assume now you'll be removing the FMA checks from the tests.

This revision is now accepted and ready to land.Nov 2 2018, 4:00 PM
This revision was automatically updated to reflect the committed changes.