muldi3.S 812 B

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