muldi3.S 751 B

12345678910111213141516171819202122232425262728293031323334
  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
  4. #include "../assembly.h"
  5. // di_int __muldi3(di_int a, di_int b);
  6. #ifdef __i386__
  7. .text
  8. .balign 4
  9. DEFINE_COMPILERRT_FUNCTION(__muldi3)
  10. pushl %ebx
  11. movl 16(%esp), %eax // b.lo
  12. movl 12(%esp), %ecx // a.hi
  13. imull %eax, %ecx // b.lo * a.hi
  14. movl 8(%esp), %edx // a.lo
  15. movl 20(%esp), %ebx // b.hi
  16. imull %edx, %ebx // a.lo * b.hi
  17. mull %edx // EDX:EAX = a.lo * b.lo
  18. addl %ecx, %ebx // EBX = (a.lo*b.hi + a.hi*b.lo)
  19. addl %ebx, %edx
  20. popl %ebx
  21. retl
  22. END_COMPILERRT_FUNCTION(__muldi3)
  23. #endif // __i386__
  24. NO_EXEC_STACK_DIRECTIVE