|
Lines 2-8
Link Here
|
| 2 |
|
2 |
|
| 3 |
#include "libgcc.h" |
3 |
#include "libgcc.h" |
| 4 |
|
4 |
|
| 5 |
long long __ashrdi3(long long u, word_type b) |
5 |
#ifdef CONFIG_64BIT |
|
|
6 |
DWtype __ashrti3(DWtype u, word_type b) |
| 7 |
#else |
| 8 |
DWtype __ashrdi3(DWtype u, word_type b) |
| 9 |
#endif |
| 6 |
{ |
10 |
{ |
| 7 |
DWunion uu, w; |
11 |
DWunion uu, w; |
| 8 |
word_type bm; |
12 |
word_type bm; |
|
Lines 11-31
long long __ashrdi3(long long u, word_ty
Link Here
|
| 11 |
return u; |
15 |
return u; |
| 12 |
|
16 |
|
| 13 |
uu.ll = u; |
17 |
uu.ll = u; |
| 14 |
bm = 32 - b; |
18 |
bm = BITS_PER_LONG - b; |
| 15 |
|
19 |
|
| 16 |
if (bm <= 0) { |
20 |
if (bm <= 0) { |
| 17 |
/* w.s.high = 1..1 or 0..0 */ |
21 |
/* w.s.high = 1..1 or 0..0 */ |
| 18 |
w.s.high = |
22 |
w.s.high = |
| 19 |
uu.s.high >> 31; |
23 |
uu.s.high >> (BITS_PER_LONG - 1); |
| 20 |
w.s.low = uu.s.high >> -bm; |
24 |
w.s.low = uu.s.high >> -bm; |
| 21 |
} else { |
25 |
} else { |
| 22 |
const unsigned int carries = (unsigned int) uu.s.high << bm; |
26 |
const unsigned long carries = (unsigned long) uu.s.high << bm; |
| 23 |
|
27 |
|
| 24 |
w.s.high = uu.s.high >> b; |
28 |
w.s.high = uu.s.high >> b; |
| 25 |
w.s.low = ((unsigned int) uu.s.low >> b) | carries; |
29 |
w.s.low = ((unsigned long) uu.s.low >> b) | carries; |
| 26 |
} |
30 |
} |
| 27 |
|
31 |
|
| 28 |
return w.ll; |
32 |
return w.ll; |
| 29 |
} |
33 |
} |
| 30 |
|
34 |
#ifdef CONFIG_64BIT |
|
|
35 |
EXPORT_SYMBOL(__ashrti3); |
| 36 |
#else |
| 31 |
EXPORT_SYMBOL(__ashrdi3); |
37 |
EXPORT_SYMBOL(__ashrdi3); |
|
|
38 |
#endif |