This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Add codegen for VSX word extract convert to FP
ClosedPublic

Authored by lei on Jul 25 2017, 2:58 PM.

Details

Summary

Add codegen for VSX word extract conversion from signed/unsigned to single/double precision.

For UINT_TO_FP:
Extract word unsigned and convert to float was implemented in https://reviews.llvm.org/D20239.
Here we will add the missing extract integer and conversion to double. This utilizes the new P9 instruction xxextractuw to extracting an integer element when the result will be converted to double thereby saving 2 direct moves (VSR <-> GPR).

For SINT_TO_FP:
We will implement the following sequence which will also reduce the number of instructions by saving 2 direct moves.

v4i32->f32:
        xxspltw
        xvcvsxwsp
        xscvspdpn 

v4i32->f64:
        xxspltw
        xvcvsxwdp

Diff Detail

Event Timeline

lei created this revision.Jul 25 2017, 2:58 PM
lei added a comment.Aug 8 2017, 8:42 AM

Friendly reminder .... waiting for review.

nemanjai accepted this revision.Aug 11 2017, 2:43 PM

LGTM.

This revision is now accepted and ready to land.Aug 11 2017, 2:43 PM
This revision was automatically updated to reflect the committed changes.