1 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
2 /* { dg-require-effective-target ilp32 } */
3 /* { dg-require-effective-target sse2 } */
4 /* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=athlon" } } */
5 /* { dg-options "-O2 -fprefetch-loop-arrays -march=athlon -msse2 -mfpmath=sse --param simultaneous-prefetches=100 -fdump-tree-aprefetch-details -fdump-tree-optimized" } */
14 /* Nontemporal store should be used for a. */
15 for (i
= 0; i
< K
; i
++)
18 /* Nontemporal store should be used for a, nontemporal prefetch for b. */
19 for (i
= 0; i
< K
; i
++)
22 /* Nontemporal store should not be used here (only write and read temporal
24 for (i
= 0; i
< K
- 10000; i
++)
27 /* Nontemporal store should not be used here (only write and read nontemporal
29 for (i
= 0; i
< K
- 100000; i
++)
32 /* Nontemporal store should be used neither for a nor for p, as we do not know
33 whether they alias or not. */
34 for (i
= 0; i
< K
; i
++)
40 /* Nontemporal store should not be used for a, as we do not know whether its
41 value will be reused or not. */
42 for (i
= 0; i
< 1000; i
++)
46 /* { dg-final { scan-tree-dump-times "Issued prefetch" 5 "aprefetch" } } */
47 /* { dg-final { scan-tree-dump-times "Issued nontemporal prefetch" 3 "aprefetch" } } */
48 /* { dg-final { scan-tree-dump-times "a nontemporal store" 2 "aprefetch" } } */
50 /* { dg-final { scan-tree-dump-times "builtin_prefetch" 8 "optimized" } } */
51 /* { dg-final { scan-tree-dump-times "=\\{nt\\}" 18 "optimized" } } */
52 /* { dg-final { scan-tree-dump-times "__builtin_ia32_mfence" 2 "optimized" } } */
54 /* { dg-final { scan-assembler-times "prefetchw" 5 } } */
55 /* { dg-final { scan-assembler-times "prefetcht" 1 } } */
56 /* { dg-final { scan-assembler-times "prefetchnta" 2 } } */
57 /* { dg-final { scan-assembler-times "movnti" 18 } } */
58 /* { dg-final { scan-assembler-times "mfence" 2 } } */
60 /* { dg-final { cleanup-tree-dump "aprefetch" } } */
61 /* { dg-final { cleanup-tree-dump "optimized" } } */