[PATCH] Lower certain build_vectors to insertps instructions

Filipe Cabecinhas filcab+llvm.phabricator at gmail.com
Sun Apr 27 00:40:27 PDT 2014


I'm not following. Those still work. I have examples in the tests and they succeed.

I just ran them through llc, as well as additional examples (two slight modifications to shuffle the zeros around, described in the name of the functions) and here's is llc's output (including the comments for insertps, which show what we want:

  _shuf_XYZ0:                             ## @shuf_XYZ0
    .cfi_startproc
  ## BB#0:                                ## %entry
    insertps  $8, %xmm0, %xmm0 ## xmm0 = xmm0[0,1,2],zero
    retq
    .cfi_endproc
  
    .globl    _shuf_0YZW
    .align    4, 0x90
  _shuf_0YZW:                             ## @shuf_0YZW
    .cfi_startproc
  ## BB#0:                                ## %entry
    insertps  $81, %xmm0, %xmm0 ## xmm0 = zero,xmm0[1,2,3]
    retq
    .cfi_endproc
  
    .globl    _shuf_XY00
    .align    4, 0x90
  _shuf_XY00:                             ## @shuf_XY00
    .cfi_startproc
  ## BB#0:                                ## %entry
    insertps  $12, %xmm0, %xmm0 ## xmm0 = xmm0[0,1],zero,zero
    retq
    .cfi_endproc
  
    .globl    _shuf_X0Z0
    .align    4, 0x90
  _shuf_X0Z0:                             ## @shuf_X0Z0
    .cfi_startproc
  ## BB#0:                                ## %entry
    insertps  $10, %xmm0, %xmm0 ## xmm0 = xmm0[0],zero,xmm0[2],zero
    retq
    .cfi_endproc

If I misunderstood, please provide additional details.

Thanks,
Filipe

http://reviews.llvm.org/D3521






More information about the llvm-commits mailing list