aboutsummaryrefslogtreecommitdiff
path: root/arch/mips/lib/ashldi3.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2006-06-20 14:56:23 +1000
committerNathan Scott <nathans@sgi.com>2006-06-20 14:56:23 +1000
commit98174e46974323e4941c72e46345f7277755e146 (patch)
treec4644c8f38a519cfb3929d1175fc7107eefe48b9 /arch/mips/lib/ashldi3.c
parentd8ce75324135ea7100124c1fff4ec5090a350607 (diff)
parent25f42b6af09e34c3f92107b36b5aa6edc2fdba2f (diff)
Merge HEAD from ../linux-2.6
Diffstat (limited to 'arch/mips/lib/ashldi3.c')
-rw-r--r--arch/mips/lib/ashldi3.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/mips/lib/ashldi3.c b/arch/mips/lib/ashldi3.c
new file mode 100644
index 00000000000..beb80f31609
--- /dev/null
+++ b/arch/mips/lib/ashldi3.c
@@ -0,0 +1,29 @@
+#include <linux/module.h>
+
+#include "libgcc.h"
+
+long long __ashldi3(long long u, word_type b)
+{
+ DWunion uu, w;
+ word_type bm;
+
+ if (b == 0)
+ return u;
+
+ uu.ll = u;
+ bm = 32 - b;
+
+ if (bm <= 0) {
+ w.s.low = 0;
+ w.s.high = (unsigned int) uu.s.low << -bm;
+ } else {
+ const unsigned int carries = (unsigned int) uu.s.low >> bm;
+
+ w.s.low = (unsigned int) uu.s.low << b;
+ w.s.high = ((unsigned int) uu.s.high << b) | carries;
+ }
+
+ return w.ll;
+}
+
+EXPORT_SYMBOL(__ashldi3);