35 lines · plain
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-exception4 5#include "../assembly.h"6 7// di_int __muldi3(di_int a, di_int b);8 9#ifdef __i386__10 11.text12.balign 413DEFINE_COMPILERRT_FUNCTION(__muldi3)14 pushl %ebx15 movl 16(%esp), %eax // b.lo16 movl 12(%esp), %ecx // a.hi17 imull %eax, %ecx // b.lo * a.hi18 19 movl 8(%esp), %edx // a.lo20 movl 20(%esp), %ebx // b.hi21 imull %edx, %ebx // a.lo * b.hi22 23 mull %edx // EDX:EAX = a.lo * b.lo24 addl %ecx, %ebx // EBX = (a.lo*b.hi + a.hi*b.lo)25 addl %ebx, %edx26 27 popl %ebx28 retl29END_COMPILERRT_FUNCTION(__muldi3)30 31#endif // __i386__32 33NO_EXEC_STACK_DIRECTIVE34 35