summaryrefslogtreecommitdiffstats
path: root/arch/arm/lib/ashrdi3.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-20 11:37:49 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-20 11:37:49 -0700
commit91b90475e793e84a57d956af8c52645e292badcb (patch)
tree8de670e02f99a2a2bde82384104dcb8cb09cdadf /arch/arm/lib/ashrdi3.c
parentbcc408b75b707f46da1f81058ffa3c9df6f0170f (diff)
parentf0ffeddc897a5cc5d5c6cc1b99a8799a8b34b28f (diff)
downloadlinux-91b90475e793e84a57d956af8c52645e292badcb.tar.bz2
Merge master.kernel.org:/home/rmk/linux-2.6-arm
Diffstat (limited to 'arch/arm/lib/ashrdi3.c')
-rw-r--r--arch/arm/lib/ashrdi3.c48
1 files changed, 22 insertions, 26 deletions
diff --git a/arch/arm/lib/ashrdi3.c b/arch/arm/lib/ashrdi3.c
index 71625d218f8d..9a8600a7543f 100644
--- a/arch/arm/lib/ashrdi3.c
+++ b/arch/arm/lib/ashrdi3.c
@@ -31,31 +31,27 @@ Boston, MA 02111-1307, USA. */
#include "gcclib.h"
-DItype
-__ashrdi3 (DItype u, word_type b)
+s64 __ashrdi3(s64 u, int b)
{
- DIunion w;
- word_type bm;
- DIunion uu;
-
- if (b == 0)
- return u;
-
- uu.ll = u;
-
- bm = (sizeof (SItype) * BITS_PER_UNIT) - b;
- if (bm <= 0)
- {
- /* w.s.high = 1..1 or 0..0 */
- w.s.high = uu.s.high >> (sizeof (SItype) * BITS_PER_UNIT - 1);
- w.s.low = uu.s.high >> -bm;
- }
- else
- {
- USItype carries = (USItype)uu.s.high << bm;
- w.s.high = uu.s.high >> b;
- w.s.low = ((USItype)uu.s.low >> b) | carries;
- }
-
- return w.ll;
+ DIunion w;
+ int bm;
+ DIunion uu;
+
+ if (b == 0)
+ return u;
+
+ uu.ll = u;
+
+ bm = (sizeof(s32) * BITS_PER_UNIT) - b;
+ 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 {
+ u32 carries = (u32) uu.s.high << bm;
+ w.s.high = uu.s.high >> b;
+ w.s.low = ((u32) uu.s.low >> b) | carries;
+ }
+
+ return w.ll;
}