aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.misc-tests/i386-pf-athlon-1.c
blob: d793437f17529f2fe79a0f24471b0ff7f562b041 (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
/* Test that the correct data prefetch instructions are generated for i386
   variants that use 3DNow! prefetchw or SSE prefetch instructions with
   locality hints.  */

/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } */

extern void exit (int);

char *msg = "howdy there";

void foo (char *p)
{
  __builtin_prefetch (p, 0, 0);
  __builtin_prefetch (p, 0, 1);
  __builtin_prefetch (p, 0, 2);
  __builtin_prefetch (p, 0, 3);
  __builtin_prefetch (p, 1, 0);
  __builtin_prefetch (p, 1, 1);
  __builtin_prefetch (p, 1, 2);
  __builtin_prefetch (p, 1, 3);
}

int main ()
{
  foo (msg);
  exit (0);
}

/* { dg-final { scan-assembler "prefetchw" } } */
/* { dg-final { scan-assembler "prefetchnta" } } */
/* { dg-final { scan-assembler "prefetcht" } } */