1 /* { dg-additional-options "-O3" } */
2 /* { dg-require-effective-target vect_double } */
3 /* { dg-additional-options "-mprefer-vector-width=128" { target x86_64-*-* i?86-*-* } } */
7 extern void abort (void);
8 extern void *malloc (__SIZE_TYPE__
);
25 for(i
=0,s
=lattice
;i
<sites_on_node
;i
++,s
++)
26 for(dir
=0;dir
<32;dir
++)
31 s
->link
[dir
].e
[j
][k
].real
*= s
->phase
[dir
];
32 s
->link
[dir
].e
[j
][k
].imag
*= s
->phase
[dir
];
34 /* Avoid loop vectorizing the outer loop after unrolling
36 __asm__
volatile ("" : : : "memory");
45 lattice
= malloc (sizeof (struct site
) * sites_on_node
);
46 for (i
= 0; i
< 32; ++i
)
48 lattice
->phase
[i
] = i
;
49 for (j
= 0; j
< 3; ++j
)
50 for (k
= 0; k
< 3; ++k
)
52 lattice
->link
[i
].e
[j
][k
].real
= 1.0;
53 lattice
->link
[i
].e
[j
][k
].imag
= 1.0;
54 __asm__
volatile ("" : : : "memory");
58 for (i
= 0; i
< 32; ++i
)
59 for (j
= 0; j
< 3; ++j
)
61 for (k
= 0; k
< 3; ++k
)
62 if (lattice
->link
[i
].e
[j
][k
].real
!= i
63 || lattice
->link
[i
].e
[j
][k
].imag
!= i
)
68 /* We should also be able to use 2-lane SLP to initialize the real and
69 imaginary components in the first loop of main. */
70 /* { dg-final { scan-tree-dump-times "optimized: basic block" 10 "slp1" { target {! { vect1024 } } } } } */
71 /* { dg-final { scan-tree-dump-times "optimized: basic block" 11 "slp1" { target { { vect1024 } } } } } */
72 /* We should see the s->phase[dir] operand splatted and no other operand built
73 from scalars. See PR97334. */
74 /* { dg-final { scan-tree-dump "Using a splat" "slp1" } } */
75 /* { dg-final { scan-tree-dump-times "Building vector operands from scalars" 0 "slp1" } } */