0005-lib-c-Add-umoddi3.s-for-i386-linux.patch (1017B)
1 From 53056612a51c8f52173ad8578216f895a5ce54bd Mon Sep 17 00:00:00 2001 2 From: zerous Naveen Narayanan <zerous@nocebo.space> 3 Date: Fri, 1 Nov 2019 15:23:20 +0100 4 Subject: [PATCH 05/11] [lib/c] Add umoddi3.s for i386/linux 5 6 --- 7 src/libc/arch/i386/linux/umoddi3.s | 25 +++++++++++++++++++++++++ 8 1 file changed, 25 insertions(+) 9 create mode 100644 src/libc/arch/i386/linux/umoddi3.s 10 11 diff --git a/src/libc/arch/i386/linux/umoddi3.s b/src/libc/arch/i386/linux/umoddi3.s 12 new file mode 100644 13 index 00000000..404a4f30 14 --- /dev/null 15 +++ b/src/libc/arch/i386/linux/umoddi3.s 16 @@ -0,0 +1,25 @@ 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 __umoddi3 25 + .type __umoddi3,@function 26 +__umoddi3: 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 %edx,%eax 39 + movl %ebp,%esp 40 + popl %ebp 41 + ret 42 -- 43 2.23.0 44