Rebase.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / xop-imul64-vector.c
blobfc8c8806f78c88c0a5f92f0150ab3874fd5ed87a
1 /* Test that the compiler properly optimizes floating point multiply and add
2 instructions vector into pmacsdd/etc. on XOP systems. */
4 /* { dg-do compile } */
5 /* { dg-require-effective-target lp64 } */
6 /* { dg-options "-O2 -mxop -mno-avx2 -ftree-vectorize" } */
8 extern void exit (int);
10 typedef long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
12 #define SIZE 10240
14 union {
15 __m128i i_align;
16 long i64[SIZE];
17 } a, b, c, d;
19 void
20 imul64 (void)
22 int i;
24 for (i = 0; i < SIZE; i++)
25 a.i64[i] = b.i64[i] * c.i64[i];
28 int main ()
30 imul64 ();
31 exit (0);
34 /* { dg-final { scan-assembler "vpmulld" } } */
35 /* { dg-final { scan-assembler "vphadddq" } } */