This is an archive of the discontinued LLVM Phabricator instance.

[X86][SSE] Replace (V)CVTTPS2DQ and VCVTTPD2DQ truncating (round to zero) f32/f64 to i32 with generic IR (llvm)
ClosedPublic

Authored by RKSimon on Jun 1 2016, 5:40 AM.

Details

Summary

This patch removes the llvm intrinsics (V)CVTTPS2DQ and VCVTTPD2DQ truncation (round to zero) conversions and auto-upgrades to FP_TO_SINT calls instead.

Note: I looked at updating CVTTPD2DQ as well but this still requires a lot more work to correctly lower.

A companion patch (D20859) removes the clang intrinsics.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon updated this revision to Diff 59209.Jun 1 2016, 5:40 AM
RKSimon retitled this revision from to [X86][SSE] Replace (V)CVTTPS2DQ and VCVTTPD2DQ truncating (round to zero) f32/f64 to i32 with generic IR (llvm).
RKSimon updated this object.
RKSimon set the repository for this revision to rL LLVM.
RKSimon added a subscriber: llvm-commits.
ab accepted this revision.Jun 1 2016, 7:57 AM
ab edited edge metadata.

LGTM

lib/Target/X86/X86InstrSSE.td
2111–2112

Have you looked into moving the patterns into the instruction defs? Might be tricky with NoVLX though.

This revision is now accepted and ready to land.Jun 1 2016, 7:57 AM
RKSimon added inline comments.Jun 2 2016, 3:09 AM
lib/Target/X86/X86InstrSSE.td
2111–2112

I'm afraid not - there doesn't seem to be a way to filter patterns if they are in the def.

This revision was automatically updated to reflect the committed changes.