aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/prefetch-9.c
blob: afbb8a0474dbf21c0b2e5e495bab43b8aeeea90a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
/* { dg-require-effective-target sse2 } */
/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=athlon" } } */
/* { dg-options "-O2 -fno-tree-loop-vectorize -fprefetch-loop-arrays -march=athlon -msse2 -mfpmath=sse --param simultaneous-prefetches=100 -fdump-tree-aprefetch-details -fdump-tree-optimized" } */

#define K 1000000
int a[K], b[K];

void test()
{
  unsigned i;

  /* Nontemporal store should be used for a, nontemporal prefetch for b.  */
  for (i = 0; i < K; i++)
    a[i] = b[i];

}

/* { dg-final { scan-tree-dump-times "Issued nontemporal prefetch" 1 "aprefetch" } } */
/* { dg-final { scan-tree-dump-times "a nontemporal store" 1 "aprefetch" } } */

/* { dg-final { scan-tree-dump-times "builtin_prefetch" 1 "optimized" } } */
/* { dg-final { scan-tree-dump "=\\{nt\\}" "optimized" } } */
/* { dg-final { scan-tree-dump-times "__builtin_ia32_mfence" 1 "optimized" } } */

/* { dg-final { scan-assembler-times "prefetchnta" 1 } } */
/* { dg-final { scan-assembler "movnti" } } */
/* { dg-final { scan-assembler-times "mfence" 1 } } */

/* { dg-final { cleanup-tree-dump "aprefetch" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */