PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr39543-1.c
bloba8442b2e6cc4ef05c41d326d11a4243920d730fe
1 /* PR inline-asm/39543 */
2 /* { dg-do compile } */
3 /* { dg-options "-O3 -fomit-frame-pointer" } */
5 float __attribute__ ((aligned (16))) s0[128];
6 const float s1 = 0.707;
7 float s2[8] __attribute__ ((aligned (16)));
8 float s3[8] __attribute__ ((aligned (16)));
9 float s4[16] __attribute__ ((aligned (16)));
10 float s5[16] __attribute__ ((aligned (16)));
12 void
13 foo (int k, float *x, float *y, const float *d, const float *z)
15 float *a, *b, *c, *e;
17 a = x + 2 * k;
18 b = a + 2 * k;
19 c = b + 2 * k;
20 e = y + 2 * k;
21 __asm__ volatile (""
22 : "=m" (x[0]), "=m" (b[0]), "=m" (a[0]), "=m" (c[0])
23 : "m" (y[0]), "m" (y[k * 2]), "m" (x[0]), "m" (a[0])
24 : "memory");
25 for (;;)
27 __asm__ volatile (""
29 : "m" (y[2]), "m" (d[2]), "m" (e[2]), "m" (z[2])
30 : "memory");
31 if (!--k)
32 break;
34 __asm__ volatile (""
35 : "=m" (x[2]), "=m" (x[10]), "=m" (x[6]), "=m" (x[14])
36 : "m" (y[2]), "m" (y[6]), "m" (x[2]), "m" (x[6]),
37 "m" (y[18]), "m" (s1)
38 : "memory");
41 void
42 bar (float *a)
44 foo (4, a, a + 16, s2, s3);
45 foo (8, a, a + 32, s4, s5);
48 void
49 baz (void)
51 bar (s0);