summaryrefslogtreecommitdiffstats
path: root/arch/arm/lib/ashrdi3.c
diff options
context:
space:
mode:
authorJeff Garzik2005-06-22 19:10:49 +0200
committerJeff Garzik2005-06-22 19:10:49 +0200
commit80bd6d7f5e0d872a0f5a151473d2a39d95d210a8 (patch)
treeb3a36048d6b7de88f7e906624ecb4b98816bb736 /arch/arm/lib/ashrdi3.c
parentAutomatic merge of rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds... (diff)
parentMerge rsync://oss.sgi.com/git/xfs-2.6 (diff)
downloadkernel-qcow2-linux-80bd6d7f5e0d872a0f5a151473d2a39d95d210a8.tar.gz
kernel-qcow2-linux-80bd6d7f5e0d872a0f5a151473d2a39d95d210a8.tar.xz
kernel-qcow2-linux-80bd6d7f5e0d872a0f5a151473d2a39d95d210a8.zip
Merge /spare/repo/linux-2.6/
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;
}