ref: 074d2d430db947164948e6778259504aed29778c
parent: f55a034c33fd1a5b6b35f78abeef23741cb6f65f
author: zerous Naveen Narayanan <zerous@nocebo.space>
date: Sat Nov 16 08:43:46 EST 2019
Add umoddi3 and udivdi3
--- a/src/libcrt/i386/Makefile
+++ b/src/libcrt/i386/Makefile
@@ -2,7 +2,10 @@
PROJECTDIR=../../..
include $(PROJECTDIR)/scripts/rules.mk
-OBJS = dummy.o
+OBJS = dummy.o \
+ umoddi3.o \
+ udivdi3.o \
+
TARGET = $(LIBCDIR)/libcrt.a
all: $(TARGET)
--- /dev/null
+++ b/src/libcrt/i386/udivdi3.s
@@ -1,0 +1,19 @@
+ .file "udivdi3.s"
+
+ .text
+ .globl __udivdi3
+__udivdi3:
+ pushl %ebp
+ movl %esp,%ebp
+ addl $-16,%esp
+
+ movl 8(%ebp),%ecx
+ movl %ecx,-16(%ebp)
+ movl 16(%ebp),%ecx
+ movl %ecx,-8(%ebp)
+ movl -16(%ebp),%eax
+ xor %edx,%edx
+ divl -8(%ebp)
+ movl %ebp,%esp
+ popl %ebp
+ ret
--- /dev/null
+++ b/src/libcrt/i386/umoddi3.s
@@ -1,0 +1,20 @@
+ .file "umoddi3.s"
+
+ .text
+ .globl __umoddi3
+__umoddi3:
+ pushl %ebp
+ movl %esp,%ebp
+ addl $-16,%esp
+
+ movl 8(%ebp),%ecx
+ movl %ecx,-16(%ebp)
+ movl 16(%ebp),%ecx
+ movl %ecx,-8(%ebp)
+ movl -16(%ebp),%eax
+ xor %edx,%edx
+ divl -8(%ebp)
+ movl %edx,%eax
+ movl %ebp,%esp
+ popl %ebp
+ ret