1 // This file is dual licensed under the MIT and the University of Illinois Open
2 // Source Licenses. See LICENSE.TXT for details.
4 #include "../assembly.h"
6 // di_int __muldi3(di_int a, di_int b);
12 DEFINE_COMPILERRT_FUNCTION(__muldi3)
14 movl 16(%esp), %eax // b.lo
15 movl 12(%esp), %ecx // a.hi
16 imull %eax, %ecx // b.lo * a.hi
18 movl 8(%esp), %edx // a.lo
19 movl 20(%esp), %ebx // b.hi
20 imull %edx, %ebx // a.lo * b.hi
22 mull %edx // EDX:EAX = a.lo * b.lo
23 addl %ecx, %ebx // EBX = (a.lo*b.hi + a.hi*b.lo)
28 END_COMPILERRT_FUNCTION(__muldi3)