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

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

diff --git a/usr/src/lib/libc/tahoe/gen/umodsi3.s b/usr/src/lib/libc/tahoe/gen/umodsi3.s
new file mode 100644 (file)
index 0000000..98dd5fb
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * 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 "@(#)umodsi3.s   6.1 (Berkeley) %G%"
+#endif /* LIBC_SCCS and not lint */
+
+/*
+ * Unsigned remainder for GCC.
+ *
+ * __umodsi3(dividend, divisor)
+ */
+#include "DEFS.h"
+
+ENTRY(__umodsi3, 0)
+       bitl    $0x80000000,8(fp)       #  if (divisor & 0x80000000){
+       jeql    1f                        
+       movl    4(fp),r0
+       cmpl    8(fp),r0                #  if (divisor <= dividend )
+       jgtru   2f
+       subl2   8(fp),r0                #       return(dividend-divisor);
+2:                                     #  else return(dividend);}
+       ret
+1:
+       clrl    r2                      #  return(dividend%divisor);
+       movl    4(fp),r3
+       ediv    8(fp),r2,r1,r0
+       ret