1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
#include <altivec.h>
typedef union
{
unsigned int i;
float f;
} U32b;
typedef union
{
unsigned long long i;
double f;
} U64b;
__attribute__ ((noipa))
vector unsigned char
test1 ()
{
vector unsigned char v = {0xd, 0xd, 0xd, 0xd, 0xd, 0xd, 0xd, 0xd,
0xd, 0xd, 0xd, 0xd, 0xd, 0xd, 0xd, 0xd};
vector unsigned char res = vec_sld (v, v, 3);
return res;
}
__attribute__ ((noipa))
vector signed short
test2 ()
{
vector signed short v
= {0x7777, 0x7777, 0x7777, 0x7777, 0x7777, 0x7777, 0x7777, 0x7777};
vector signed short res = vec_sld (v, v, 5);
return res;
}
__attribute__ ((noipa))
vector signed int
test3 ()
{
vector signed int v = {0xbbbbbbbb, 0xbbbbbbbb, 0xbbbbbbbb, 0xbbbbbbbb};
vector signed int res = vec_sld (v, v, 7);
return res;
}
__attribute__ ((noipa))
vector unsigned int
test4 ()
{
vector unsigned int v = {0x07070707, 0x07070707, 0x07070707, 0x07070707};
vector unsigned int res = vec_sld (v, v, 9);
return res;
}
__attribute__ ((noipa))
vector unsigned long long
test5 ()
{
vector unsigned long long v = {0x4545454545454545ll, 0x4545454545454545ll};
vector unsigned long long res = vec_sld (v, v, 10);
return res;
}
__attribute__ ((noipa))
vector float
test6 ()
{
U32b u;
u.i = 0x17171717;
vector float vf = {u.f, u.f, u.f, u.f};
vector float res = vec_sld (vf, vf, 11);
return res;
}
__attribute__ ((noipa))
vector double
test7 ()
{
U64b u;
u.i = 0x5454545454545454ll;
vector double vf = {u.f, u.f};
vector double res = vec_sld (vf, vf, 13);
return res;
}
|