1 #include "harness.h"
2
test()3 static void test()
4 {
5 vector unsigned char vuca = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
6 vector unsigned char vucb = {2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3};
7 vector signed char vsca = {-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7};
8 vector signed char vscb = {2,-3,2,-3,2,-3,2,-3,2,-3,2,-3,2,-3,2,-3};
9 vector unsigned short vusa = {0,1,2,3,4,5,6,7};
10 vector unsigned short vusb = {2,3,2,3,2,3,2,3};
11 vector signed short vssa = {-4,-3,-2,-1,0,1,2,3};
12 vector signed short vssb = {2,-3,2,-3,2,-3,2,-3};
13 vector unsigned short vuse, vuso;
14 vector signed short vsse, vsso;
15 vector unsigned int vuie, vuio;
16 vector signed int vsie, vsio;
17
18 vuse = vec_mule (vuca, vucb);
19 vuso = vec_mulo (vuca, vucb);
20 vsse = vec_mule (vsca, vscb);
21 vsso = vec_mulo (vsca, vscb);
22 vuie = vec_mule (vusa, vusb);
23 vuio = vec_mulo (vusa, vusb);
24 vsie = vec_mule (vssa, vssb);
25 vsio = vec_mulo (vssa, vssb);
26
27 check (vec_all_eq (vuse,
28 ((vector unsigned short){0,4,8,12,16,20,24,28})),
29 "vuse");
30 check (vec_all_eq (vuso,
31 ((vector unsigned short){3,9,15,21,27,33,39,45})),
32 "vuso");
33 check (vec_all_eq (vsse,
34 ((vector signed short){-16,-12,-8,-4,0,4,8,12})),
35 "vsse");
36 check (vec_all_eq (vsso,
37 ((vector signed short){21,15,9,3,-3,-9,-15,-21})),
38 "vsso");
39 check (vec_all_eq (vuie, ((vector unsigned int){0,4,8,12})), "vuie");
40 check (vec_all_eq (vuio, ((vector unsigned int){3,9,15,21})), "vuio");
41 check (vec_all_eq (vsie, ((vector signed int){-8,-4,0,4})), "vsie");
42 check (vec_all_eq (vsio, ((vector signed int){9,3,-3,-9})), "vsio");
43 }
44