aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/avx2-dupv4si.c
blob: ffe6318cdfcc778179bf42a66aafa11110c81687 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* { dg-do compile } */
/* { dg-options "-mavx2 -O2" } */
/* { dg-final { scan-assembler-times "vpbroadcastd" 2 } } */

typedef int __attribute__ ((vector_size (16))) v4si;

v4si bcst_reg (int i)
{
  register int x asm ("xmm7") = i;

  asm ("" : "+v" (x));
  return (v4si) {x, x, x, x};
}

v4si bcst_mem (const int *i)
{
  return (v4si) {*i, *i, *i, *i};
}