This is an archive of the discontinued LLVM Phabricator instance.

Fix fptosi, fptoui from f16 vectors to i8, i16 vectors
ClosedPublic

Authored by pirama on Nov 23 2015, 2:24 PM.

Details

Summary

Convert v4f16 and v8f16 to corresponding f32 vectors before doing the
conversion to int.

Add tests for v4f16, v8f16.

Diff Detail

Repository
rL LLVM

Event Timeline

pirama updated this revision to Diff 40980.Nov 23 2015, 2:24 PM
pirama retitled this revision from to Fix fptosi, fptoui from f16 vectors to i8, i16 vectors.
pirama updated this object.
pirama added reviewers: ab, jmolloy.
pirama added subscribers: srhines, llvm-commits.
jmolloy requested changes to this revision.Dec 8 2015, 1:49 AM
jmolloy edited edge metadata.

Hi Pirama,

Why are we only doing this for v4f16 and v8f16? What about oversized vectors - is there any specific reason you're excluding these? I'm not even sure oversized/undersized vectors can get this far, but it seems strange to whitelist.

I also think this code should be sunk down into LowerVectorFP_TO_INT.

Cheers,

James

This revision now requires changes to proceed.Dec 8 2015, 1:49 AM
pirama updated this revision to Diff 42260.EditedDec 8 2015, 6:05 PM
pirama edited edge metadata.

Removed vector length checks and refactored as suggested. Larger vectors indeed don't reach here. But it is still better to do the promotion unconditionally.

pirama updated this revision to Diff 42266.Dec 8 2015, 9:50 PM
pirama edited edge metadata.

Remove unnecessary braces.

jmolloy accepted this revision.Dec 10 2015, 2:50 AM
jmolloy edited edge metadata.

This now looks good to me. Thanks for making those changes!

This revision is now accepted and ready to land.Dec 10 2015, 2:50 AM
This revision was automatically updated to reflect the committed changes.