summaryrefslogtreecommitdiffstats
path: root/usr/klibc/arch/i386/libgcc/__lshrdi3.S
diff options
context:
space:
mode:
Diffstat (limited to 'usr/klibc/arch/i386/libgcc/__lshrdi3.S')
-rw-r--r--usr/klibc/arch/i386/libgcc/__lshrdi3.S29
1 files changed, 29 insertions, 0 deletions
diff --git a/usr/klibc/arch/i386/libgcc/__lshrdi3.S b/usr/klibc/arch/i386/libgcc/__lshrdi3.S
new file mode 100644
index 0000000..6a63c52
--- /dev/null
+++ b/usr/klibc/arch/i386/libgcc/__lshrdi3.S
@@ -0,0 +1,29 @@
+/*
+ * arch/i386/libgcc/__lshrdi3.S
+ *
+ * 64-bit shr
+ */
+ .text
+ .align 4
+ .globl __lshrdi3
+ .type __lshrdi3,@function
+__lshrdi3:
+#ifndef _REGPARM
+ movl 4(%esp),%eax
+ movl 8(%esp),%edx
+ movb 12(%esp),%cl
+#endif
+ cmpb $32,%cl
+ jae 1f
+
+ shrdl %cl,%edx,%eax
+ shrl %cl,%edx
+ ret
+
+1:
+ shrl %cl,%edx
+ xorl %eax,%eax
+ xchgl %edx,%eax
+ ret
+
+ .size __lshrdi3,.-__lshrdi3