On Mon, Mar 24, 2014 at 9:09 AM, Jakub Jelinek <ja...@redhat.com> wrote: > The following is recognized well: > > typedef char v32qi __attribute__((vector_size (32))); > v32qi foo (char a) > { > return (v32qi) { a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, > a, a, a, a, a, a, a, a, a, a, a, a, a }; > }
Perhaps "well" but not optimal. The created code is vmovd %edi, %xmm0 vpbroadcastb %xmm0, %xmm0 vinserti128 $1, %xmm0, %ymm0, %ymm0 It should generate for AVX2 vmovd %edi, %xmm0 vpbroadcastb %xmm0, %ymm0