date and time created 91/02/01 13:13:32 by donn
authorDonn Seeley <donn@ucbvax.Berkeley.EDU>
Sat, 2 Feb 1991 05:13:32 +0000 (21:13 -0800)
committerDonn Seeley <donn@ucbvax.Berkeley.EDU>
Sat, 2 Feb 1991 05:13:32 +0000 (21:13 -0800)
SCCS-vsn: lib/libc/tahoe/gen/udivsi3.s 6.1

usr/src/lib/libc/tahoe/gen/udivsi3.s [new file with mode: 0644]

diff --git a/usr/src/lib/libc/tahoe/gen/udivsi3.s b/usr/src/lib/libc/tahoe/gen/udivsi3.s
new file mode 100644 (file)
index 0000000..8231f42
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 1988 Regents of the University of California.
+ * All rights reserved.
+ *
+ * %sccs.include.redist.c%
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Computer Consoles Inc.
+ */
+
+#if defined(LIBC_SCCS) && !defined(lint)
+       .asciz "@(#)udivsi3.s   6.1 (Berkeley) %G%"
+#endif /* LIBC_SCCS and not lint */
+
+/*
+ * Unsigned divide for GCC.
+ *
+ * __udivsi3(dividend, divisor)
+ */
+#include "DEFS.h"
+
+ENTRY(__udivsi3, 0)
+       bitl    $0x80000000,8(fp)       #  if (divisor & 0x80000000){
+       jeql    1f                        
+       cmpl    8(fp),4(fp)             #  if (divisor > dividend )
+       jlequ   2f
+       clrl    r0                      #      return(0);
+       ret
+2:                                     #  else
+       movl    $1,r0                   #      return(1);}
+       ret
+1:
+       clrl    r2                      #  return(dividend/divisor);
+       movl    4(fp),r3
+       ediv    8(fp),r2,r0,r1
+       ret