| 1 |
/* PR target/117930 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2" } */ |
| 4 |
/* { dg-final { scan-assembler-not "sub\[bwlq\]\t" } } */ |
| 5 |
/* { dg-final { scan-assembler-not "add\[bwlq\]\t" } } */ |
| 6 |
/* { dg-final { scan-assembler-not "lea\[lq\]\t" } } */ |
| 7 |
|
| 8 |
static inline |
| 9 |
unsigned lrotate (unsigned x, int t) |
| 10 |
{ |
| 11 |
unsigned tl = x << t; |
| 12 |
unsigned th = x >> (-t & 31); |
| 13 |
return tl | th; |
| 14 |
} |
| 15 |
|
| 16 |
static inline |
| 17 |
unsigned rrotate (unsigned x, int t) |
| 18 |
{ |
| 19 |
unsigned tl = x >> t; |
| 20 |
unsigned th = x << (-t & 31); |
| 21 |
return tl | th; |
| 22 |
} |
| 23 |
|
| 24 |
unsigned |
| 25 |
f1 (unsigned x, int t) |
| 26 |
{ |
| 27 |
return lrotate (x, 32 - t); |
| 28 |
} |
| 29 |
|
| 30 |
unsigned |
| 31 |
f2 (unsigned x, int t) |
| 32 |
{ |
| 33 |
return lrotate (x, 64 - t); |
| 34 |
} |
| 35 |
|
| 36 |
unsigned |
| 37 |
f3 (unsigned x, int t) |
| 38 |
{ |
| 39 |
return lrotate (x, 32 + t); |
| 40 |
} |
| 41 |
|
| 42 |
unsigned |
| 43 |
f4 (unsigned x, int t) |
| 44 |
{ |
| 45 |
return lrotate (x, 64 + t); |
| 46 |
} |
| 47 |
|
| 48 |
unsigned |
| 49 |
f5 (unsigned x, int t) |
| 50 |
{ |
| 51 |
return rrotate (x, 32 - t); |
| 52 |
} |
| 53 |
|
| 54 |
unsigned |
| 55 |
f6 (unsigned x, int t) |
| 56 |
{ |
| 57 |
return rrotate (x, 64 - t); |
| 58 |
} |
| 59 |
|
| 60 |
unsigned |
| 61 |
f7 (unsigned x, int t) |
| 62 |
{ |
| 63 |
return rrotate (x, 32 + t); |
| 64 |
} |
| 65 |
|
| 66 |
unsigned |
| 67 |
f8 (unsigned x, int t) |
| 68 |
{ |
| 69 |
return rrotate (x, 64 + t); |
| 70 |
} |
| 71 |
|
| 72 |
unsigned |
| 73 |
f9 (int t) |
| 74 |
{ |
| 75 |
return lrotate (0xdeadbeefU, 32 - t); |
| 76 |
} |
| 77 |
|
| 78 |
unsigned |
| 79 |
f10 (int t) |
| 80 |
{ |
| 81 |
return lrotate (0xdeadbeefU, 64 - t); |
| 82 |
} |
| 83 |
|
| 84 |
unsigned |
| 85 |
f11 (int t) |
| 86 |
{ |
| 87 |
return lrotate (0xdeadbeefU, 32 + t); |
| 88 |
} |
| 89 |
|
| 90 |
unsigned |
| 91 |
f12 (int t) |
| 92 |
{ |
| 93 |
return lrotate (0xdeadbeefU, 64 + t); |
| 94 |
} |
| 95 |
|
| 96 |
unsigned |
| 97 |
f13 (int t) |
| 98 |
{ |
| 99 |
return rrotate (0xdeadbeefU, 32 - t); |
| 100 |
} |
| 101 |
|
| 102 |
unsigned |
| 103 |
f14 (int t) |
| 104 |
{ |
| 105 |
return rrotate (0xdeadbeefU, 64 - t); |
| 106 |
} |
| 107 |
|
| 108 |
unsigned |
| 109 |
f15 (int t) |
| 110 |
{ |
| 111 |
return rrotate (0xdeadbeefU, 32 + t); |
| 112 |
} |
| 113 |
|
| 114 |
unsigned |
| 115 |
f16 (int t) |
| 116 |
{ |
| 117 |
return rrotate (0xdeadbeefU, 64 + t); |
| 118 |
} |