* gcc.dg/vmx/1b-01.c: New.
[official-gcc.git] / gcc / testsuite / gcc.dg / vmx / zero.c
blob9a337e6e8554d018f529923f5bde3378375d3baf
1 #include "harness.h"
3 vector signed short zs16() { return ((vector signed short){0,0,0,0,0,0,0,0}); }
4 vector signed short s16ss() { vector signed short a; return vec_subs(a,a); }
5 vector signed short s16s() { vector signed short a; return vec_sub(a,a); }
6 vector signed short s16x() { vector signed short a; return vec_xor(a,a); }
7 vector signed short s16a() { vector signed short a; return vec_andc(a,a); }
9 vector unsigned short zu16() { return ((vector unsigned short){0,0,0,0,0,0,0,0}); }
10 vector unsigned short u16ss() { vector unsigned short a; return vec_subs(a,a); }
11 vector unsigned short u16s() { vector unsigned short a; return vec_sub(a,a); }
12 vector unsigned short u16x() { vector unsigned short a; return vec_xor(a,a); }
13 vector unsigned short u16a() { vector unsigned short a; return vec_andc(a,a); }
15 vector signed int zs32() { return ((vector signed int){0,0,0,0}); }
16 vector signed int s32ss() { vector signed int a; return vec_subs(a,a); }
17 vector signed int s32s() { vector signed int a; return vec_sub(a,a); }
18 vector signed int s32x() { vector signed int a; return vec_xor(a,a); }
19 vector signed int s32a() { vector signed int a; return vec_andc(a,a); }
21 vector unsigned int zu32() { return ((vector unsigned int){0,0,0,0}); }
22 vector unsigned int u32ss() { vector unsigned int a; return vec_subs(a,a); }
23 vector unsigned int u32s() { vector unsigned int a; return vec_sub(a,a); }
24 vector unsigned int u32x() { vector unsigned int a; return vec_xor(a,a); }
25 vector unsigned int u32a() { vector unsigned int a; return vec_andc(a,a); }
27 vector signed char zs8() { return ((vector signed char){0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}); }
28 vector signed char s8ss() { vector signed char a; return vec_subs(a,a); }
29 vector signed char s8s() { vector signed char a; return vec_sub(a,a); }
30 vector signed char s8x() { vector signed char a; return vec_xor(a,a); }
31 vector signed char s8a() { vector signed char a; return vec_andc(a,a); }
33 vector unsigned char zu8() { return ((vector unsigned char){0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}); }
34 vector unsigned char u8ss() { vector unsigned char a; return vec_subs(a,a); }
35 vector unsigned char u8s() { vector unsigned char a; return vec_sub(a,a); }
36 vector unsigned char u8x() { vector unsigned char a; return vec_xor(a,a); }
37 vector unsigned char u8a() { vector unsigned char a; return vec_andc(a,a); }
39 vector pixel zp16() { return ((vector pixel){0,0,0,0,0,0,0,0}); }
41 vector bool short zb16() { return ((vector bool short){0,0,0,0,0,0,0,0}); }
43 vector bool short b16x() { vector bool short a; return vec_xor(a,a); }
44 vector bool short b16a() { vector bool short a; return vec_andc(a,a); }
45 vector bool int zb32() { return ((vector bool int){0,0,0,0}); }
47 vector bool int b32x() { vector bool int a; return vec_xor(a,a); }
48 vector bool int b32a() { vector bool int a; return vec_andc(a,a); }
49 vector bool char zb8() { return ((vector bool char){0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}); }
51 vector bool char b8x() { vector bool char a; return vec_xor(a,a); }
52 vector bool char b8a() { vector bool char a; return vec_andc(a,a); }
54 static void test()
56 static vector unsigned int zerov;
57 #define zcheck(val, tag) \
58 check(vec_all_eq((vector unsigned int)(val), zerov), tag)
60 zcheck(zs16(), "zs16");
61 zcheck(s16ss(), "s16ss");
62 zcheck(s16s(), "s16s");
63 zcheck(s16x(), "s16x");
64 zcheck(s16a(), "s16a");
65 zcheck(zu16(), "zu16");
66 zcheck(u16ss(), "u16ss");
67 zcheck(u16s(), "u16s");
68 zcheck(u16x(), "u16x");
69 zcheck(u16a(), "u16a");
70 zcheck(zs32(), "zs32");
71 zcheck(s32ss(), "s32ss");
72 zcheck(s32s(), "s32s");
73 zcheck(s32x(), "s32x");
74 zcheck(s32a(), "s32a");
75 zcheck(zu32(), "zu32");
76 zcheck(u32ss(), "u32ss");
77 zcheck(u32s(), "u32s");
78 zcheck(u32x(), "u32x");
79 zcheck(u32a(), "u32a");
80 zcheck(zs8(), "zs8");
81 zcheck(s8ss(), "s8ss");
82 zcheck(s8s(), "s8s");
83 zcheck(s8x(), "s8x");
84 zcheck(s8a(), "s8a");
85 zcheck(zu8(), "zu8");
86 zcheck(u8ss(), "u8ss");
87 zcheck(u8s(), "u8s");
88 zcheck(u8x(), "u8x");
89 zcheck(u8a(), "u8a");
90 zcheck(zp16(), "zp16");
91 zcheck(zb16(), "zb16");
92 zcheck(b16x(), "b16x");
93 zcheck(b16a(), "b16a");
94 zcheck(zb32(), "zb32");
95 zcheck(b32x(), "b32x");
96 zcheck(b32a(), "b32a");
97 zcheck(zb8(), "zb8");
98 zcheck(b8x(), "b8x");
99 zcheck(b8a(), "b8a");