diff options
Diffstat (limited to 'arch/arm/lib/muldi3.c')
-rw-r--r-- | arch/arm/lib/muldi3.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/arch/arm/lib/muldi3.c b/arch/arm/lib/muldi3.c index 44d611b1cfdb..0a3b93313f18 100644 --- a/arch/arm/lib/muldi3.c +++ b/arch/arm/lib/muldi3.c | |||
@@ -32,7 +32,7 @@ Boston, MA 02111-1307, USA. */ | |||
32 | #include "gcclib.h" | 32 | #include "gcclib.h" |
33 | 33 | ||
34 | #define umul_ppmm(xh, xl, a, b) \ | 34 | #define umul_ppmm(xh, xl, a, b) \ |
35 | {register USItype __t0, __t1, __t2; \ | 35 | {register u32 __t0, __t1, __t2; \ |
36 | __asm__ ("%@ Inlined umul_ppmm \n\ | 36 | __asm__ ("%@ Inlined umul_ppmm \n\ |
37 | mov %2, %5, lsr #16 \n\ | 37 | mov %2, %5, lsr #16 \n\ |
38 | mov %0, %6, lsr #16 \n\ | 38 | mov %0, %6, lsr #16 \n\ |
@@ -46,32 +46,27 @@ Boston, MA 02111-1307, USA. */ | |||
46 | addcs %0, %0, #65536 \n\ | 46 | addcs %0, %0, #65536 \n\ |
47 | adds %1, %1, %3, lsl #16 \n\ | 47 | adds %1, %1, %3, lsl #16 \n\ |
48 | adc %0, %0, %3, lsr #16" \ | 48 | adc %0, %0, %3, lsr #16" \ |
49 | : "=&r" ((USItype) (xh)), \ | 49 | : "=&r" ((u32) (xh)), \ |
50 | "=r" ((USItype) (xl)), \ | 50 | "=r" ((u32) (xl)), \ |
51 | "=&r" (__t0), "=&r" (__t1), "=r" (__t2) \ | 51 | "=&r" (__t0), "=&r" (__t1), "=r" (__t2) \ |
52 | : "r" ((USItype) (a)), \ | 52 | : "r" ((u32) (a)), \ |
53 | "r" ((USItype) (b)));} | 53 | "r" ((u32) (b)));} |
54 | |||
55 | 54 | ||
56 | #define __umulsidi3(u, v) \ | 55 | #define __umulsidi3(u, v) \ |
57 | ({DIunion __w; \ | 56 | ({DIunion __w; \ |
58 | umul_ppmm (__w.s.high, __w.s.low, u, v); \ | 57 | umul_ppmm (__w.s.high, __w.s.low, u, v); \ |
59 | __w.ll; }) | 58 | __w.ll; }) |
60 | 59 | ||
61 | 60 | s64 __muldi3(s64 u, s64 v) | |
62 | DItype | ||
63 | __muldi3 (DItype u, DItype v) | ||
64 | { | 61 | { |
65 | DIunion w; | 62 | DIunion w; |
66 | DIunion uu, vv; | 63 | DIunion uu, vv; |
67 | 64 | ||
68 | uu.ll = u, | 65 | uu.ll = u, vv.ll = v; |
69 | vv.ll = v; | ||
70 | 66 | ||
71 | w.ll = __umulsidi3 (uu.s.low, vv.s.low); | 67 | w.ll = __umulsidi3(uu.s.low, vv.s.low); |
72 | w.s.high += ((USItype) uu.s.low * (USItype) vv.s.high | 68 | w.s.high += ((u32) uu.s.low * (u32) vv.s.high |
73 | + (USItype) uu.s.high * (USItype) vv.s.low); | 69 | + (u32) uu.s.high * (u32) vv.s.low); |
74 | 70 | ||
75 | return w.ll; | 71 | return w.ll; |
76 | } | 72 | } |
77 | |||