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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [vmx/] [7-01a.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
#include <altivec.h>
3
extern vector signed short image[];
4
extern vector signed short band[];
5
 
6
#define load(a,b) vec_ld((b)*16, a)
7
#define store(v,a,b) vec_st(v,(b)*16,a)
8
 
9
void
10
haar (vector signed char a, vector signed char b, vector signed char c,
11
      vector signed char d, unsigned int N, int XX)
12
{
13
  unsigned int i;
14
  vector unsigned char high, low;
15
  vector signed int zero = ((vector signed int){0,0,0,0});
16
 
17
  for (i = 0; i < N; i++) {
18
    high = (vector unsigned char) (vec_vmrghh (load(image, i+XX),
19
                                               load(image, i)));
20
    low = (vector unsigned char) (vec_vmrglh (load(image, i+XX),
21
                                              load(image, i)));
22
 
23
    store (vec_vpkswss (vec_vmsummbm (a, high, zero),
24
                        vec_vmsummbm (a, low, zero)),
25
           band, i);
26
    store (vec_vpkswss (vec_vmsummbm (b, high, zero),
27
                        vec_vmsummbm (b, low, zero)),
28
           band, i+1);
29
    store(vec_vpkswss (vec_vmsummbm (c, high, zero),
30
                       vec_vmsummbm (c, low, zero)),
31
          band, i+2);
32
    store(vec_vpkswss (vec_vmsummbm (d, high, zero),
33
                       vec_vmsummbm (d, low, zero)),
34
          band, i+3);
35
  }
36
}

powered by: WebSVN 2.1.0

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