PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr39543-2.c
blobd0deb6b7430b1d92db8c7c3ea7115535bf1c3ad7
1 /* PR inline-asm/39543 */
2 /* { dg-do compile } */
3 /* { dg-options "-O3" } */
4 /* { dg-skip-if "" { ia32 && { ! nonpic } } } */
6 float __attribute__ ((aligned (16))) s0[128];
7 const float s1 = 0.707;
8 float s2[8] __attribute__ ((aligned (16)));
9 float s3[8] __attribute__ ((aligned (16)));
10 float s4[16] __attribute__ ((aligned (16)));
11 float s5[16] __attribute__ ((aligned (16)));
13 void
14 foo (int k, float *x, float *y, const float *d, const float *z)
16 float *a, *b, *c, *e;
18 a = x + 2 * k;
19 b = a + 2 * k;
20 c = b + 2 * k;
21 e = y + 2 * k;
22 __asm__ volatile (""
23 : "=m" (x[0]), "=m" (b[0]), "=m" (a[0]), "=m" (c[0])
24 : "m" (y[0]), "m" (y[k * 2]), "m" (x[0]), "m" (a[0])
25 : "memory");
26 for (;;)
28 __asm__ volatile (""
30 : "m" (y[2]), "m" (d[2]), "m" (e[2]), "m" (z[2])
31 : "memory");
32 if (!--k)
33 break;
35 __asm__ volatile (""
36 : "=m" (x[2]), "=m" (x[10]), "=m" (x[6]), "=m" (x[14])
37 : "m" (y[2]), "m" (y[6]), "m" (x[2]), "m" (x[6]), "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);