[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / pr109069-2.h
blob8b03bfb65fa7263898d1a6a5e4561c4cd1595389
1 #include <altivec.h>
3 typedef union
5 unsigned int i;
6 float f;
7 } U32b;
9 typedef union
11 unsigned long long i;
12 double f;
13 } U64b;
15 __attribute__ ((noipa))
16 vector unsigned char
17 test1 ()
19 vector unsigned char v = {0xd, 0xd, 0xd, 0xd, 0xd, 0xd, 0xd, 0xd,
20 0xd, 0xd, 0xd, 0xd, 0xd, 0xd, 0xd, 0xd};
21 vector unsigned char res = vec_sld (v, v, 3);
22 return res;
25 __attribute__ ((noipa))
26 vector signed short
27 test2 ()
29 vector signed short v
30 = {0x7777, 0x7777, 0x7777, 0x7777, 0x7777, 0x7777, 0x7777, 0x7777};
31 vector signed short res = vec_sld (v, v, 5);
32 return res;
35 __attribute__ ((noipa))
36 vector signed int
37 test3 ()
39 vector signed int v = {0xbbbbbbbb, 0xbbbbbbbb, 0xbbbbbbbb, 0xbbbbbbbb};
40 vector signed int res = vec_sld (v, v, 7);
41 return res;
44 __attribute__ ((noipa))
45 vector unsigned int
46 test4 ()
48 vector unsigned int v = {0x07070707, 0x07070707, 0x07070707, 0x07070707};
49 vector unsigned int res = vec_sld (v, v, 9);
50 return res;
53 __attribute__ ((noipa))
54 vector unsigned long long
55 test5 ()
57 vector unsigned long long v = {0x4545454545454545ll, 0x4545454545454545ll};
58 vector unsigned long long res = vec_sld (v, v, 10);
59 return res;
62 __attribute__ ((noipa))
63 vector float
64 test6 ()
66 U32b u;
67 u.i = 0x17171717;
68 vector float vf = {u.f, u.f, u.f, u.f};
69 vector float res = vec_sld (vf, vf, 11);
70 return res;
73 __attribute__ ((noipa))
74 vector double
75 test7 ()
77 U64b u;
78 u.i = 0x5454545454545454ll;
79 vector double vf = {u.f, u.f};
80 vector double res = vec_sld (vf, vf, 13);
81 return res;