https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77399

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot 
gnu.org

--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
I have a patch handling same-size element conversions mixed with permutations.
Thus in addition to the testcase in the description also

typedef int v4si __attribute__((vector_size(16)));
typedef float v4sf __attribute__((vector_size(16)));
v4sf vec_cast(v4si f)
{
  return (v4sf){f[1], f[1], f[2], f[3]};
}

expanding to

vec_cast:
.LFB0:
        .cfi_startproc
        pshufd  $229, %xmm0, %xmm0
        cvtdq2ps        %xmm0, %xmm0
        ret

Note this doesn't handle int <-> double conversions where on GIMPLE we'd have
VEC_UNPACK_* VEC_PACK_* but I'm not sure those represent a good middle-end
representation for optimizers (we should create/pattern match those late
and only if the target supports the ops).

vector construction from loads is another story (I think SLP vectorization
should handle this and IIRC there is already a bug for this - CONSTRUCTORS
supposed to be handled the same as grouped stores).

Reply via email to