OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [mips/] [dsp-ctrl.c] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 321 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O2 -mdsp -mgp32" } */
3
 
4
extern void abort (void);
5
extern void exit (int);
6
 
7
NOMIPS16 void __attribute__ ((noinline))
8
test1 (int i)
9
{
10
  __builtin_mips_wrdsp (i, 63);
11
}
12
 
13
NOMIPS16 void __attribute__ ((noinline))
14
test2 ()
15
{
16
  long long a = 0;
17
  __builtin_mips_extpdp (a, 3);
18
}
19
 
20
NOMIPS16 void __attribute__ ((noinline))
21
test3 (int i)
22
{
23
  long long a = 0;
24
  __builtin_mips_extpdp (a, i);
25
}
26
 
27
NOMIPS16 void __attribute__ ((noinline))
28
test4 ()
29
{
30
  long long a = 0;
31
  int i = 0;
32
  __builtin_mips_mthlip (a, i);
33
}
34
 
35
NOMIPS16 int
36
main ()
37
{
38
  int cntl;
39
 
40
  /* Test 1: wrdsp */
41
  __builtin_mips_wrdsp (0,63);
42
  test1 (63);
43
  cntl = __builtin_mips_rddsp (63);
44
  if (cntl != 63)
45
    abort ();
46
 
47
  /* Test 2: extpdp */
48
  __builtin_mips_wrdsp (63,63);
49
  test2 ();
50
  cntl = __builtin_mips_rddsp (63);
51
  if (cntl != 59)
52
    abort ();
53
 
54
  /* Test 3: extpdpv */
55
  __builtin_mips_wrdsp (63,63);
56
  test3 (10);
57
  cntl = __builtin_mips_rddsp (63);
58
  if (cntl != 52)
59
    abort ();
60
 
61
  /* Test 4: mthlip */
62
  __builtin_mips_wrdsp (8,63);
63
  test4 ();
64
  cntl = __builtin_mips_rddsp (63);
65
  if (cntl != 40)
66
    abort ();
67
 
68
  exit (0);
69
}

powered by: WebSVN 2.1.0

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