muldi3.S 813 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * linux/arch/arm/lib/muldi3.S
  3. *
  4. * Author: Nicolas Pitre
  5. * Created: Oct 19, 2005
  6. * Copyright: Monta Vista Software, Inc.
  7. *
  8. * SPDX-License-Identifier: GPL-2.0
  9. */
  10. #include <linux/linkage.h>
  11. #include <asm/assembler.h>
  12. #ifdef __ARMEB__
  13. #define xh r0
  14. #define xl r1
  15. #define yh r2
  16. #define yl r3
  17. #else
  18. #define xl r0
  19. #define xh r1
  20. #define yl r2
  21. #define yh r3
  22. #endif
  23. .pushsection .text.__muldi3, "ax"
  24. ENTRY(__muldi3)
  25. ENTRY(__aeabi_lmul)
  26. mul xh, yl, xh
  27. mla xh, xl, yh, xh
  28. mov ip, xl, lsr #16
  29. mov yh, yl, lsr #16
  30. bic xl, xl, ip, lsl #16
  31. bic yl, yl, yh, lsl #16
  32. mla xh, yh, ip, xh
  33. mul yh, xl, yh
  34. mul xl, yl, xl
  35. mul ip, yl, ip
  36. adds xl, xl, yh, lsl #16
  37. adc xh, xh, yh, lsr #16
  38. adds xl, xl, ip, lsl #16
  39. adc xh, xh, ip, lsr #16
  40. ret lr
  41. ENDPROC(__muldi3)
  42. ENDPROC(__aeabi_lmul)
  43. .popsection