This is an archive of the discontinued LLVM Phabricator instance.

[AVX-512] Add lowering to cvttpd2udq/cvttps2udq for fptoui v2f64/2f32 to 2i32
ClosedPublic

Authored by craig.topper on Nov 6 2016, 12:53 AM.

Details

Summary

This patch adds support for fptoui to 2i32 from both 2f64 and 2f32, building on Simon's change for the signed version in r284459 and using AVX-512 instructions.

If we don't have VLX support we need to use a 512-bit operation for v2f64->v2i32 and extract the result.

It also recognises that cvttpd2udq zeroes the upper 64-bits of the xmm result.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper retitled this revision from to [AVX-512] Add lowering to cvttpd2udq/cvttps2udq for fptoui v2f64/2f32 to 2i32.
craig.topper updated this object.
craig.topper added reviewers: RKSimon, delena, zvi.
craig.topper added a subscriber: llvm-commits.
RKSimon edited edge metadata.Nov 7 2016, 11:02 AM

The non-VLX needs testing - add -mattr=+avx512f only tests to vec_fp_to_int.ll?

craig.topper edited edge metadata.

Updated to show the change for the avx512 without vlx case. I added the command line to the test in r286216 so this only shows the delta for this patch.

RKSimon accepted this revision.Nov 8 2016, 4:39 AM
RKSimon edited edge metadata.

LGTM (with1 minor comment tweak).

lib/Target/X86/X86ISelLowering.h
305 ↗(On Diff #77150)

Vector double to signed/unsigned integer (truncated).

This revision is now accepted and ready to land.Nov 8 2016, 4:39 AM
This revision was automatically updated to reflect the committed changes.