Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / rldimi.h
blob169428423c528c1b26cd72bd1e75b8ec48e98878
1 typedef unsigned int u32;
2 typedef unsigned long long u64;
4 static inline u64 rot_insert(u64 x, u64 y, u32 n, u32 mb, u32 me)
6 if (n)
7 x = 0
8 #ifdef SL
9 | (x << n)
10 #endif
11 #ifdef SR
12 | (x >> (64 - n))
13 #endif
16 u64 s = -1;
17 if (n)
18 s = 0
19 #ifdef SL
20 | (s << n)
21 #endif
22 #ifdef SR
23 | (s >> (64 - n))
24 #endif
27 u64 mask = 0;
28 mask += 1ULL << (63 - mb);
29 mask += 1ULL << (63 - mb);
30 mask -= 1ULL << (63 - me);
31 mask -= (mb > me);
33 if (mask & ~s)
34 return 12345*y;
36 return (x & mask) | (y & ~mask);
39 #define X2(N,B) \
40 u64 f_##N##_##B(u64 x, u64 y) { return rot_insert(x,y,N,B,63-N); } \
41 u64 g_##N##_##B(u64 x, u64 y) { return rot_insert(y,x,N,B,63-N); }
43 #define X1(N) \
44 X2(N,0) \
45 X2(N,1) \
46 X2(N,2) \
47 X2(N,7) \
48 X2(N,8) \
49 X2(N,9) \
50 X2(N,15) \
51 X2(N,16) \
52 X2(N,17) \
53 X2(N,23) \
54 X2(N,24) \
55 X2(N,25) \
56 X2(N,29) \
57 X2(N,30) \
58 X2(N,31) \
59 X2(N,32) \
60 X2(N,33) \
61 X2(N,34) \
62 X2(N,39) \
63 X2(N,40) \
64 X2(N,41) \
65 X2(N,47) \
66 X2(N,48) \
67 X2(N,49) \
68 X2(N,55) \
69 X2(N,56) \
70 X2(N,57) \
71 X2(N,61) \
72 X2(N,62) \
73 X2(N,63)
74 #define X() \
75 X1(0) \
76 X1(1) \
77 X1(2) \
78 X1(7) \
79 X1(8) \
80 X1(9) \
81 X1(15) \
82 X1(16) \
83 X1(17) \
84 X1(23) \
85 X1(24) \
86 X1(25) \
87 X1(29) \
88 X1(30) \
89 X1(31) \
90 X1(32) \
91 X1(33) \
92 X1(34) \
93 X1(39) \
94 X1(40) \
95 X1(41) \
96 X1(47) \
97 X1(48) \
98 X1(49) \
99 X1(55) \
100 X1(56) \
101 X1(57) \
102 X1(61) \
103 X1(62) \
104 X1(63)