OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [sh/] [sh2a-prefetch.c] - Blame information for rev 325

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 325 jeremybenn
/* Testcase to check generation of a SH2A specific instruction PREF @Rm.  */
2
/* { dg-do assemble {target sh*-*-*}}  */
3
/* { dg-options "-O0" }  */
4
/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single -m2a-single-only" }  */
5
/* { dg-final { scan-assembler "pref"} }  */
6
 
7
void
8
opt (void)
9
{
10
  int *p, wk;
11
  int data[100];
12
 
13
  /* data prefetch , instructions hit the cache. */
14
 
15
  __builtin_prefetch (&data[0], 0, 0);
16
  __builtin_prefetch (&data[0], 0, 1);
17
  __builtin_prefetch (&data[0], 0, 2);
18
  __builtin_prefetch (&data[0], 0, 3);
19
  __builtin_prefetch (&data[0], 1, 0);
20
  __builtin_prefetch (&data[0], 1, 1);
21
  __builtin_prefetch (&data[0], 1, 2);
22
  __builtin_prefetch (&data[0], 1, 3);
23
 
24
 
25
  for (p = &data[0]; p < &data[9]; p++)
26
    {
27
      if (*p > *(p + 1))
28
        {
29
          wk = *p;
30
          *p = *(p + 1);
31
          *(p + 1) = wk;
32
        }
33
    }
34
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.