1 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2 // See https://llvm.org/LICENSE.txt for license information.
3 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5 #include "../assembly.h"
7 // di_int __muldi3(di_int a, di_int b);
13 DEFINE_COMPILERRT_FUNCTION(__muldi3)
15 movl 16(%esp), %eax // b.lo
16 movl 12(%esp), %ecx // a.hi
17 imull %eax, %ecx // b.lo * a.hi
19 movl 8(%esp), %edx // a.lo
20 movl 20(%esp), %ebx // b.hi
21 imull %edx, %ebx // a.lo * b.hi
23 mull %edx // EDX:EAX = a.lo * b.lo
24 addl %ecx, %ebx // EBX = (a.lo*b.hi + a.hi*b.lo)
29 END_COMPILERRT_FUNCTION(__muldi3)
33 NO_EXEC_STACK_DIRECTIVE