[PATCH] D35859: [PowerPC] Add codegen for VSX word extract convert to FP

Lei Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 25 14:58:34 PDT 2017


lei created this revision.

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 https://reviews.llvm.org/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


https://reviews.llvm.org/D35859

Files:
  lib/Target/PowerPC/PPCInstrVSX.td
  test/CodeGen/PowerPC/p9-xxinsertw-xxextractuw.ll
  test/CodeGen/PowerPC/remove-redundant-moves.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35859.108163.patch
Type: text/x-patch
Size: 10953 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170725/60320c0e/attachment.bin>


More information about the llvm-commits mailing list