diff options
Diffstat (limited to 'arch/arm/lib/ashldi3.c')
-rw-r--r-- | arch/arm/lib/ashldi3.c | 47 |
1 files changed, 21 insertions, 26 deletions
diff --git a/arch/arm/lib/ashldi3.c b/arch/arm/lib/ashldi3.c index 130f5a839669..b62875cfd8f8 100644 --- a/arch/arm/lib/ashldi3.c +++ b/arch/arm/lib/ashldi3.c | |||
@@ -31,31 +31,26 @@ Boston, MA 02111-1307, USA. */ | |||
31 | 31 | ||
32 | #include "gcclib.h" | 32 | #include "gcclib.h" |
33 | 33 | ||
34 | DItype | 34 | s64 __ashldi3(s64 u, int b) |
35 | __ashldi3 (DItype u, word_type b) | ||
36 | { | 35 | { |
37 | DIunion w; | 36 | DIunion w; |
38 | word_type bm; | 37 | int bm; |
39 | DIunion uu; | 38 | DIunion uu; |
40 | 39 | ||
41 | if (b == 0) | 40 | if (b == 0) |
42 | return u; | 41 | return u; |
43 | 42 | ||
44 | uu.ll = u; | 43 | uu.ll = u; |
45 | 44 | ||
46 | bm = (sizeof (SItype) * BITS_PER_UNIT) - b; | 45 | bm = (sizeof(s32) * BITS_PER_UNIT) - b; |
47 | if (bm <= 0) | 46 | if (bm <= 0) { |
48 | { | 47 | w.s.low = 0; |
49 | w.s.low = 0; | 48 | w.s.high = (u32) uu.s.low << -bm; |
50 | w.s.high = (USItype)uu.s.low << -bm; | 49 | } else { |
51 | } | 50 | u32 carries = (u32) uu.s.low >> bm; |
52 | else | 51 | w.s.low = (u32) uu.s.low << b; |
53 | { | 52 | w.s.high = ((u32) uu.s.high << b) | carries; |
54 | USItype carries = (USItype)uu.s.low >> bm; | 53 | } |
55 | w.s.low = (USItype)uu.s.low << b; | 54 | |
56 | w.s.high = ((USItype)uu.s.high << b) | carries; | 55 | return w.ll; |
57 | } | ||
58 | |||
59 | return w.ll; | ||
60 | } | 56 | } |
61 | |||