2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.dg / altivec-7.c
blob7e118d960cae91f2e89131996bfdddf3b178a58a
1 /* Origin: Aldy Hernandez <aldyh@redhat.com> */
3 /* { dg-do compile { target powerpc-*-* } } */
4 /* { dg-options "-maltivec" } */
6 #include <altivec.h>
8 long **longp;
9 int *var_int;
10 unsigned long **ulongp;
11 vector pixel *varpixel;
12 vector signed char *vecchar;
13 vector signed long *vecint;
14 vector signed short *vecshort;
15 vector unsigned char *vecuchar;
16 vector unsigned long *vecuint;
17 vector unsigned short *vecushort;
18 vector float *vecfloat;
20 int main ()
22 *vecfloat++ = vec_andc(vecint[0], vecfloat[1]);
23 *vecfloat++ = vec_andc(vecfloat[0], vecint[1]);
24 *vecfloat++ = vec_vxor(vecint[0], vecfloat[1]);
25 *vecfloat++ = vec_vxor(vecfloat[0], vecint[1]);
26 *varpixel++ = vec_packpx(vecuint[0], vecuint[1]);
27 *varpixel++ = vec_vpkpx(vecuint[0], vecuint[1]);
28 *vecshort++ = vec_vmulosb(vecchar[0], vecchar[1]);
29 *vecint++ = vec_ld(var_int[0], longp[1]);
30 *vecint++ = vec_lde(var_int[0], longp[1]);
31 *vecint++ = vec_ldl(var_int[0], longp[1]);
32 *vecint++ = vec_lvewx(var_int[0], longp[1]);
33 *vecint++ = vec_unpackh(vecshort[0]);
34 *vecint++ = vec_unpackl(vecshort[0]);
35 *vecushort++ = vec_andc(vecshort[0], vecushort[1]);
36 *vecushort++ = vec_andc(vecushort[0], vecshort[1]);
37 *vecushort++ = vec_vxor(vecshort[0], vecushort[1]);
38 *vecushort++ = vec_vxor(vecushort[0], vecshort[1]);
39 *vecuint++ = vec_ld(var_int[0], ulongp[1]);
40 *vecuint++ = vec_lvx(var_int[0], ulongp[1]);
41 *vecuint++ = vec_vmsumubm(vecuchar[0], vecuchar[1], vecuint[2]);
42 *vecuchar++ = vec_xor(vecuchar[0], vecchar[1]);
44 return 0;