0006-lib-c-Add-udivdi3.s-for-i386-linux.patch (999B)
1 From 63b5ac1215f43bb29a74490bc1765aed3fa48439 Mon Sep 17 00:00:00 2001 2 From: zerous Naveen Narayanan <zerous@nocebo.space> 3 Date: Fri, 1 Nov 2019 15:23:58 +0100 4 Subject: [PATCH 06/11] [lib/c] Add udivdi3.s for i386/linux 5 6 --- 7 src/libc/arch/i386/linux/udivdi3.s | 24 ++++++++++++++++++++++++ 8 1 file changed, 24 insertions(+) 9 create mode 100644 src/libc/arch/i386/linux/udivdi3.s 10 11 diff --git a/src/libc/arch/i386/linux/udivdi3.s b/src/libc/arch/i386/linux/udivdi3.s 12 new file mode 100644 13 index 00000000..588d7124 14 --- /dev/null 15 +++ b/src/libc/arch/i386/linux/udivdi3.s 16 @@ -0,0 +1,24 @@ 17 + .file "umoddi3.s" 18 + .section .rodata 19 +errmsg: 20 + .string "floating point exception\n" 21 + .equ msgsz,.-errmsg-1 22 + 23 + .text 24 + .globl __udivdi3 25 + .type __udivdi3,@function 26 +__udivdi3: 27 + pushl %ebp 28 + movl %esp,%ebp 29 + addl $-16,%esp 30 + 31 + movl 8(%ebp),%ecx 32 + movl %ecx,-16(%ebp) 33 + movl 16(%ebp),%ecx 34 + movl %ecx,-8(%ebp) 35 + movl -16(%ebp),%eax 36 + xor %edx,%edx 37 + divl -8(%ebp) 38 + movl %ebp,%esp 39 + popl %ebp 40 + ret 41 -- 42 2.23.0 43