This is an archive of the discontinued LLVM Phabricator instance.

[ARM,MVE] Add intrinsics for FP rounding operations.
ClosedPublic

Authored by simon_tatham on Feb 10 2020, 8:53 AM.

Details

Summary

This adds the unpredicated forms of six different MVE intrinsics which
all round a vector of floating-point numbers to integer values,
leaving them still in FP format, differing only in rounding mode and
exception settings.

Five of them map to existing target-independent intrinsics in LLVM IR,
such as @llvm.trunc and @llvm.rint. The sixth, mapping to the vrintn
instruction, is done by inventing a target-specific intrinsic.

(vrintn behaves the same as vrintx in terms of the output value:
the side effects on the FPSCR flags are the only difference between
the two. But ACLE specifies separate user-callable intrinsics for the
two, so the side effects matter enough to make sure we generate the
right one of the two instructions in each case.)

Diff Detail

Event Timeline

simon_tatham created this revision.Feb 10 2020, 8:53 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptFeb 10 2020, 8:53 AM

Rebased to current master.

vrintn behaves the same as vrintx

vrintx is not mentioned anywhere in the patch. Should it say "llvm.rint" instead?

vrintx is not mentioned anywhere in the patch. Should it say "llvm.rint" instead?

No, I meant what I said: vrintx is the MVE machine instruction that llvm.rint already instruction-selects to (which is why I didn't have to mention it anywhere in this patch).

miyuki accepted this revision.Feb 11 2020, 8:28 AM
This revision is now accepted and ready to land.Feb 11 2020, 8:28 AM
This revision was automatically updated to reflect the committed changes.