===================================================================
@@ -1,3 +1,13 @@
+2012-10-09 Venkataramanan Kumar <venkataramanan.kumar@amd.com>
+
+ PR testsuite/53397
+ * gcc/testsuite/gcc.dg: Remove test cases pr53397-1.c and pr53397-2.c
+ they are moved to gcc.target/i386 as they are specific to i386/x86_64.
+ * gcc/testsuite/gcc.target/i386/pr53397-1.c: New test
+ Checks we are prefetching for loop invariant steps
+ * gcc/testsuite/gcc.target/i386/pr53397-2.c: New test
+ Checks we are not prefetching for loop variant steps
+
2012-10-10 Ganesh Gopalasubramanian <Ganesh.Gopalasubramanian@amd.com>
PR target/51109
===================================================================
@@ -0,0 +1,28 @@
+/* Prefetching when the step is loop invariant. */
+/* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-require-effective-target sse2 } */
+/* { dg-options "-O3 -msse2 -fprefetch-loop-arrays -fdump-tree-aprefetch-details --param min-insn-to-prefetch-ratio=3 --param simultaneous-prefetches=10 -fdump-tree-aprefetch-details" } */
+
+
+double data[16384];
+void prefetch_when_non_constant_step_is_invariant(int step, int n)
+{
+ int a;
+ int b;
+ for (a = 1; a < step; a++) {
+ for (b = 0; b < n; b += 2 * step) {
+
+ int i = 2*(b + a);
+ int j = 2*(b + a + step);
+
+
+ data[j] = data[i];
+ data[j+1] = data[i+1];
+ }
+ }
+}
+
+/* { dg-final { scan-tree-dump "Issued prefetch" "aprefetch" } } */
+/* { dg-final { scan-assembler "prefetcht0" } } */
+
+/* { dg-final { cleanup-tree-dump "aprefetch" } } */
===================================================================
@@ -0,0 +1,28 @@
+/* Not prefetching when the step is loop variant. */
+/* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-require-effective-target sse2 } */
+/* { dg-options "-O3 -msse2 -fprefetch-loop-arrays -fdump-tree-aprefetch-details --param min-insn-to-prefetch-ratio=3 --param simultaneous-prefetches=10 -fdump-tree-aprefetch-details" } */
+
+double data[16384];
+void donot_prefetch_when_non_constant_step_is_variant(int step, int n)
+{
+ int a;
+ int b;
+ for (a = 1; a < step; a++,step*=2) {
+ for (b = 0; b < n; b += 2 * step) {
+
+ int i = 2*(b + a);
+ int j = 2*(b + a + step);
+
+
+ data[j] = data[i];
+ data[j+1] = data[i+1];
+ }
+ }
+}
+
+/* { dg-final { scan-tree-dump "Not prefetching" "aprefetch" } } */
+/* { dg-final { scan-tree-dump "loop variant step" "aprefetch" } } */
+
+/* { dg-final { cleanup-tree-dump "aprefetch" } } */
+
===================================================================
@@ -1,28 +0,0 @@
-/* Prefetching when the step is loop invariant. */
-/* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
-/* { dg-require-effective-target sse2 } */
-/* { dg-options "-O3 -fprefetch-loop-arrays -fdump-tree-aprefetch-details --param min-insn-to-prefetch-ratio=3 --param simultaneous-prefetches=10 -fdump-tree-aprefetch-details" } */
-
-
-double data[16384];
-void prefetch_when_non_constant_step_is_invariant(int step, int n)
-{
- int a;
- int b;
- for (a = 1; a < step; a++) {
- for (b = 0; b < n; b += 2 * step) {
-
- int i = 2*(b + a);
- int j = 2*(b + a + step);
-
-
- data[j] = data[i];
- data[j+1] = data[i+1];
- }
- }
-}
-
-/* { dg-final { scan-tree-dump "Issued prefetch" "aprefetch" } } */
-/* { dg-final { scan-assembler "prefetcht0" } } */
-
-/* { dg-final { cleanup-tree-dump "aprefetch" } } */
===================================================================
@@ -1,28 +0,0 @@
-/* Not prefetching when the step is loop variant. */
-/* { dg-do compile { target { i?86-*-* x86_64-*-* } } } */
-/* { dg-require-effective-target sse2 } */
-/* { dg-options "-O3 -fprefetch-loop-arrays -fdump-tree-aprefetch-details --param min-insn-to-prefetch-ratio=3 --param simultaneous-prefetches=10 -fdump-tree-aprefetch-details" } */
-
-double data[16384];
-void donot_prefetch_when_non_constant_step_is_variant(int step, int n)
-{
- int a;
- int b;
- for (a = 1; a < step; a++,step*=2) {
- for (b = 0; b < n; b += 2 * step) {
-
- int i = 2*(b + a);
- int j = 2*(b + a + step);
-
-
- data[j] = data[i];
- data[j+1] = data[i+1];
- }
- }
-}
-
-/* { dg-final { scan-tree-dump "Not prefetching" "aprefetch" } } */
-/* { dg-final { scan-tree-dump "loop variant step" "aprefetch" } } */
-
-/* { dg-final { cleanup-tree-dump "aprefetch" } } */
-