summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/pr39543-1.c
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gcc.target/i386/pr39543-1.c
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/pr39543-1.c')
-rw-r--r--gcc/testsuite/gcc.target/i386/pr39543-1.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/pr39543-1.c b/gcc/testsuite/gcc.target/i386/pr39543-1.c
new file mode 100644
index 000000000..a8442b2e6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr39543-1.c
@@ -0,0 +1,52 @@
+/* PR inline-asm/39543 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fomit-frame-pointer" } */
+
+float __attribute__ ((aligned (16))) s0[128];
+const float s1 = 0.707;
+float s2[8] __attribute__ ((aligned (16)));
+float s3[8] __attribute__ ((aligned (16)));
+float s4[16] __attribute__ ((aligned (16)));
+float s5[16] __attribute__ ((aligned (16)));
+
+void
+foo (int k, float *x, float *y, const float *d, const float *z)
+{
+ float *a, *b, *c, *e;
+
+ a = x + 2 * k;
+ b = a + 2 * k;
+ c = b + 2 * k;
+ e = y + 2 * k;
+ __asm__ volatile (""
+ : "=m" (x[0]), "=m" (b[0]), "=m" (a[0]), "=m" (c[0])
+ : "m" (y[0]), "m" (y[k * 2]), "m" (x[0]), "m" (a[0])
+ : "memory");
+ for (;;)
+ {
+ __asm__ volatile (""
+ :
+ : "m" (y[2]), "m" (d[2]), "m" (e[2]), "m" (z[2])
+ : "memory");
+ if (!--k)
+ break;
+ }
+ __asm__ volatile (""
+ : "=m" (x[2]), "=m" (x[10]), "=m" (x[6]), "=m" (x[14])
+ : "m" (y[2]), "m" (y[6]), "m" (x[2]), "m" (x[6]),
+ "m" (y[18]), "m" (s1)
+ : "memory");
+}
+
+void
+bar (float *a)
+{
+ foo (4, a, a + 16, s2, s3);
+ foo (8, a, a + 32, s4, s5);
+}
+
+void
+baz (void)
+{
+ bar (s0);
+}