* doc/extend.texi (Loop-Specific Pragmas): Document pragma GCC unroll.
[official-gcc.git] / gcc / testsuite / g++.dg / ext / altivec-cell-1.C
blob16d311c3bef5cc5b22cf2aacca8fd402647d6867
1 /* { dg-do compile { target powerpc*-*-* } } */
2 /* { dg-require-effective-target powerpc_altivec_ok } */
3 /* { dg-options "-maltivec" } */
5 /* Basic test for the new VMX intrinsics.  */
6 #include <altivec.h>
8 int f(vector int a, int b)
10   return vec_extract (a, b);
12 short f1(vector short a, int b)
14   return vec_extract (a, b);
16 vector short f2(vector short a, int b)
18   return vec_insert (b, a, b);
20 vector float f3(vector float a, int b)
22   return vec_insert (b, a, b);
25 float g(void);
27 vector float f4(float b, int t)
29   return vec_promote (g(), t);
31 vector float f5(float b)
33   return vec_splats (g());
39 template <int> 
40 int tf(vector int a, int b)
42   return vec_extract (a, b);
44 template <int> 
45 short tf1(vector short a, int b)
47   return vec_extract (a, b);
49 template <int> 
50 vector short tf2(vector short a, int b)
52   return vec_insert (b, a, b);
54 template <int> 
55 vector float tf3(vector float a, int b)
57   return vec_insert (b, a, b);
60 template <int> 
61 vector float tf4(float b, int t)
63   return vec_promote (g(), t);
65 template <int> 
66 vector float tf5(float b)
68   return vec_splats (g());
71 int t(vector int a, int b)
73   return tf<1>(a, b);
75 short t1(vector short a, int b)
77   return tf1<1>(a, b);
79 vector short t2(vector short a, int b)
81   return tf2<1>(a, b);
83 vector float t3(vector float a, int b)
85   return tf3<1>(a, b);
87 vector float t4(float b, int t)
89   return tf4<1>(b, t);
91 vector float t5(float b)
93   return tf5<1>(b);