Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.dg / vmx / 7-01a.c
blobc09835b437e061cb42f095e1f8f5005ee293336d
1 /* { dg-do compile } */
2 #include <altivec.h>
3 extern vector signed short image[];
4 extern vector signed short band[];
6 #define load(a,b) vec_ld((b)*16, a)
7 #define store(v,a,b) vec_st(v,(b)*16,a)
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)
13 unsigned int i;
14 vector unsigned char high, low;
15 vector signed int zero = ((vector signed int){0,0,0,0});
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)));
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);