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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vmx/] [newton-1.c] - Blame information for rev 774

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do compile } */
2
#include <altivec.h>
3
 
4
#define SPLAT76 ((vector unsigned char)\
5
                 {0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3})
6
#define SPLAT54 ((vector unsigned char)\
7
                 {4,5,6,7,4,5,6,7,4,5,6,7,4,5,6,7})
8
#define SPLAT32 ((vector unsigned char)\
9
                 {8,9,10,11,8,9,10,11,8,9,10,11,8,9,10,11})
10
#define SPLAT10 ((vector unsigned char)\
11
                 {12,13,14,15,12,13,14,15,12,13,14,15,12,13,14,15})
12
#define INTERLEAVE ((vector unsigned char)\
13
                    {0,1,16,17,4,5,20,21,8,9,24,25,12,13,28,29})
14
 
15
long real_32_manytaps (long ntaps, vector signed short *c, long ndat,
16
                       vector signed short *x, vector signed short *y)
17
{
18
  long i, j, op, ndatavec, ncoefvec;
19
  vector signed short x0, x1;
20
  vector signed short coef;
21
  vector signed short cr10, cr32, cr54, cr76;
22
  vector signed int y_even, y_odd;
23
  vector signed short *x1p;
24
 
25
  op = 0;
26
  ndatavec = ndat >> 3;
27
  ncoefvec = ntaps >> 3;
28
 
29
  for (i = 0; i < ndatavec; i += 1) {
30
    x0 = x[i];
31
 
32
    y_even = ((vector signed int){0x8000,0x8000,0x8000,0x8000});
33
    y_odd = ((vector signed int){0x8000,0x8000,0x8000,0x8000});
34
 
35
    j = 0;
36
    x1p = x + 1 + i;
37
 
38
    do {
39
 
40
      coef = c[j];
41
      x1 = x1p[j];
42
 
43
      cr10 = vec_perm(coef, coef, SPLAT10);
44
      y_odd = vec_msums(cr10, x1, y_odd);
45
      y_even = vec_msums(cr10, vec_sld(x0, x1, 14), y_even);
46
 
47
      cr32 = vec_perm(coef, coef, SPLAT32);
48
      y_odd = vec_msums(cr32, vec_sld(x0, x1, 12), y_odd);
49
      y_even = vec_msums(cr32, vec_sld(x0, x1, 10), y_even);
50
 
51
      cr54 = vec_perm(coef, coef, SPLAT54);
52
      y_odd = vec_msums(cr54, vec_sld(x0, x1, 8), y_odd);
53
      y_even = vec_msums(cr54, vec_sld(x0, x1, 6), y_even);
54
 
55
      cr76 = vec_perm(coef, coef, SPLAT76);
56
      y_odd = vec_msums(cr76, vec_sld(x0, x1, 4), y_odd);
57
      y_even = vec_msums(cr76, vec_sld(x0, x1, 2), y_even);
58
 
59
      x0 = x1;
60
 
61
    } while (++j < ncoefvec);
62
    y[op++] = (vector signed short) vec_perm(y_even, y_odd, INTERLEAVE);
63
 
64
  }
65
 
66
  return op*8;
67
}

powered by: WebSVN 2.1.0

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