Loading arch/arm/lib/ashldi3.c +21 −26 Original line number Diff line number Diff line Loading @@ -31,8 +31,7 @@ Boston, MA 02111-1307, USA. */ #include "gcclib.h" s64 __ashldi3 (s64 u, int b) s64 __ashldi3(s64 u, int b) { DIunion w; int bm; Loading @@ -44,13 +43,10 @@ __ashldi3 (s64 u, int b) uu.ll = u; bm = (sizeof(s32) * BITS_PER_UNIT) - b; if (bm <= 0) { if (bm <= 0) { w.s.low = 0; w.s.high = (u32) uu.s.low << -bm; } else { } else { u32 carries = (u32) uu.s.low >> bm; w.s.low = (u32) uu.s.low << b; w.s.high = ((u32) uu.s.high << b) | carries; Loading @@ -58,4 +54,3 @@ __ashldi3 (s64 u, int b) return w.ll; } arch/arm/lib/ashrdi3.c +22 −26 Original line number Diff line number Diff line Loading @@ -31,8 +31,7 @@ Boston, MA 02111-1307, USA. */ #include "gcclib.h" s64 __ashrdi3 (s64 u, int b) s64 __ashrdi3(s64 u, int b) { DIunion w; int bm; Loading @@ -44,14 +43,11 @@ __ashrdi3 (s64 u, int b) uu.ll = u; bm = (sizeof(s32) * BITS_PER_UNIT) - b; if (bm <= 0) { if (bm <= 0) { /* w.s.high = 1..1 or 0..0 */ w.s.high = uu.s.high >> (sizeof(s32) * BITS_PER_UNIT - 1); w.s.low = uu.s.high >> -bm; } else { } else { u32 carries = (u32) uu.s.high << bm; w.s.high = uu.s.high >> b; w.s.low = ((u32) uu.s.low >> b) | carries; Loading arch/arm/lib/gcclib.h +11 −9 Original line number Diff line number Diff line Loading @@ -7,14 +7,16 @@ #define SI_TYPE_SIZE (sizeof(s32) * BITS_PER_UNIT) #ifdef __ARMEB__ struct DIstruct {s32 high, low;}; struct DIstruct { s32 high, low; }; #else struct DIstruct {s32 low, high;}; struct DIstruct { s32 low, high; }; #endif typedef union { typedef union { struct DIstruct s; s64 ll; } DIunion; arch/arm/lib/lshrdi3.c +21 −26 Original line number Diff line number Diff line Loading @@ -31,8 +31,7 @@ Boston, MA 02111-1307, USA. */ #include "gcclib.h" s64 __lshrdi3 (s64 u, int b) s64 __lshrdi3(s64 u, int b) { DIunion w; int bm; Loading @@ -44,13 +43,10 @@ __lshrdi3 (s64 u, int b) uu.ll = u; bm = (sizeof(s32) * BITS_PER_UNIT) - b; if (bm <= 0) { if (bm <= 0) { w.s.high = 0; w.s.low = (u32) uu.s.high >> -bm; } else { } else { u32 carries = (u32) uu.s.high << bm; w.s.high = (u32) uu.s.high >> b; w.s.low = ((u32) uu.s.low >> b) | carries; Loading @@ -58,4 +54,3 @@ __lshrdi3 (s64 u, int b) return w.ll; } arch/arm/lib/muldi3.c +8 −13 Original line number Diff line number Diff line Loading @@ -52,21 +52,17 @@ Boston, MA 02111-1307, USA. */ : "r" ((u32) (a)), \ "r" ((u32) (b)));} #define __umulsidi3(u, v) \ ({DIunion __w; \ umul_ppmm (__w.s.high, __w.s.low, u, v); \ __w.ll; }) s64 __muldi3 (s64 u, s64 v) s64 __muldi3(s64 u, s64 v) { DIunion w; DIunion uu, vv; uu.ll = u, vv.ll = v; uu.ll = u, vv.ll = v; w.ll = __umulsidi3(uu.s.low, vv.s.low); w.s.high += ((u32) uu.s.low * (u32) vv.s.high Loading @@ -74,4 +70,3 @@ __muldi3 (s64 u, s64 v) return w.ll; } Loading
arch/arm/lib/ashldi3.c +21 −26 Original line number Diff line number Diff line Loading @@ -31,8 +31,7 @@ Boston, MA 02111-1307, USA. */ #include "gcclib.h" s64 __ashldi3 (s64 u, int b) s64 __ashldi3(s64 u, int b) { DIunion w; int bm; Loading @@ -44,13 +43,10 @@ __ashldi3 (s64 u, int b) uu.ll = u; bm = (sizeof(s32) * BITS_PER_UNIT) - b; if (bm <= 0) { if (bm <= 0) { w.s.low = 0; w.s.high = (u32) uu.s.low << -bm; } else { } else { u32 carries = (u32) uu.s.low >> bm; w.s.low = (u32) uu.s.low << b; w.s.high = ((u32) uu.s.high << b) | carries; Loading @@ -58,4 +54,3 @@ __ashldi3 (s64 u, int b) return w.ll; }
arch/arm/lib/ashrdi3.c +22 −26 Original line number Diff line number Diff line Loading @@ -31,8 +31,7 @@ Boston, MA 02111-1307, USA. */ #include "gcclib.h" s64 __ashrdi3 (s64 u, int b) s64 __ashrdi3(s64 u, int b) { DIunion w; int bm; Loading @@ -44,14 +43,11 @@ __ashrdi3 (s64 u, int b) uu.ll = u; bm = (sizeof(s32) * BITS_PER_UNIT) - b; if (bm <= 0) { if (bm <= 0) { /* w.s.high = 1..1 or 0..0 */ w.s.high = uu.s.high >> (sizeof(s32) * BITS_PER_UNIT - 1); w.s.low = uu.s.high >> -bm; } else { } else { u32 carries = (u32) uu.s.high << bm; w.s.high = uu.s.high >> b; w.s.low = ((u32) uu.s.low >> b) | carries; Loading
arch/arm/lib/gcclib.h +11 −9 Original line number Diff line number Diff line Loading @@ -7,14 +7,16 @@ #define SI_TYPE_SIZE (sizeof(s32) * BITS_PER_UNIT) #ifdef __ARMEB__ struct DIstruct {s32 high, low;}; struct DIstruct { s32 high, low; }; #else struct DIstruct {s32 low, high;}; struct DIstruct { s32 low, high; }; #endif typedef union { typedef union { struct DIstruct s; s64 ll; } DIunion;
arch/arm/lib/lshrdi3.c +21 −26 Original line number Diff line number Diff line Loading @@ -31,8 +31,7 @@ Boston, MA 02111-1307, USA. */ #include "gcclib.h" s64 __lshrdi3 (s64 u, int b) s64 __lshrdi3(s64 u, int b) { DIunion w; int bm; Loading @@ -44,13 +43,10 @@ __lshrdi3 (s64 u, int b) uu.ll = u; bm = (sizeof(s32) * BITS_PER_UNIT) - b; if (bm <= 0) { if (bm <= 0) { w.s.high = 0; w.s.low = (u32) uu.s.high >> -bm; } else { } else { u32 carries = (u32) uu.s.high << bm; w.s.high = (u32) uu.s.high >> b; w.s.low = ((u32) uu.s.low >> b) | carries; Loading @@ -58,4 +54,3 @@ __lshrdi3 (s64 u, int b) return w.ll; }
arch/arm/lib/muldi3.c +8 −13 Original line number Diff line number Diff line Loading @@ -52,21 +52,17 @@ Boston, MA 02111-1307, USA. */ : "r" ((u32) (a)), \ "r" ((u32) (b)));} #define __umulsidi3(u, v) \ ({DIunion __w; \ umul_ppmm (__w.s.high, __w.s.low, u, v); \ __w.ll; }) s64 __muldi3 (s64 u, s64 v) s64 __muldi3(s64 u, s64 v) { DIunion w; DIunion uu, vv; uu.ll = u, vv.ll = v; uu.ll = u, vv.ll = v; w.ll = __umulsidi3(uu.s.low, vv.s.low); w.s.high += ((u32) uu.s.low * (u32) vv.s.high Loading @@ -74,4 +70,3 @@ __muldi3 (s64 u, s64 v) return w.ll; }