PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / xop-imul32widen-vector.c
blob94a40595648419077f18d1cbc497becd3524971a
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 int i32[SIZE];
17 long i64[SIZE];
18 } a, b, c, d;
20 void
21 imul32_to_64 (void)
23 int i;
25 for (i = 0; i < SIZE; i++)
26 a.i64[i] = ((long)b.i32[i]) * ((long)c.i32[i]);
29 int main ()
31 imul32_to_64 ();
32 exit (0);
35 /* { dg-final { scan-assembler "vpmuldq" } } */
36 /* { dg-final { scan-assembler "vpmacsdqh" } } */