Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / u-boot / arch / mips / lib / lshrdi3.c
diff --git a/qemu/roms/u-boot/arch/mips/lib/lshrdi3.c b/qemu/roms/u-boot/arch/mips/lib/lshrdi3.c
new file mode 100644 (file)
index 0000000..bb340ac
--- /dev/null
@@ -0,0 +1,25 @@
+#include "libgcc.h"
+
+long long __lshrdi3(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.high = 0;
+               w.s.low = (unsigned int) uu.s.high >> -bm;
+       } else {
+               const unsigned int carries = (unsigned int) uu.s.high << bm;
+
+               w.s.high = (unsigned int) uu.s.high >> b;
+               w.s.low = ((unsigned int) uu.s.low >> b) | carries;
+       }
+
+       return w.ll;
+}