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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20010224-1.c] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
extern void abort (void);
2
 
3
typedef signed short int16_t;
4
typedef unsigned short uint16_t;
5
 
6
int16_t logadd (int16_t *a, int16_t *b);
7
void ba_compute_psd (int16_t start);
8
 
9
int16_t masktab[6] = { 1, 2, 3, 4, 5};
10
int16_t psd[6] = { 50, 40, 30, 20, 10};
11
int16_t bndpsd[6] = { 1, 2, 3, 4, 5};
12
 
13
void ba_compute_psd (int16_t start)
14
{
15
  int i,j,k;
16
  int16_t lastbin = 4;
17
 
18
  j = start;
19
  k = masktab[start];
20
 
21
  bndpsd[k] = psd[j];
22
  j++;
23
 
24
  for (i = j; i < lastbin; i++) {
25
    bndpsd[k] = logadd(&bndpsd[k], &psd[j]);
26
    j++;
27
  }
28
}
29
 
30
int16_t logadd (int16_t *a, int16_t *b)
31
{
32
  return *a + *b;
33
}
34
 
35
int main (void)
36
{
37
  int i;
38
 
39
  ba_compute_psd (0);
40
 
41
  if (bndpsd[1] != 140) abort ();
42
  return 0;
43
}
44
 

powered by: WebSVN 2.1.0

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