muldi3.S 920 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #include <linux/linkage.h>
  13. #include <asm/assembler.h>
  14. #ifdef __ARMEB__
  15. #define xh r0
  16. #define xl r1
  17. #define yh r2
  18. #define yl r3
  19. #else
  20. #define xl r0
  21. #define xh r1
  22. #define yl r2
  23. #define yh r3
  24. #endif
  25. ENTRY(__muldi3)
  26. ENTRY(__aeabi_lmul)
  27. mul xh, yl, xh
  28. mla xh, xl, yh, xh
  29. mov ip, xl, lsr #16
  30. mov yh, yl, lsr #16
  31. bic xl, xl, ip, lsl #16
  32. bic yl, yl, yh, lsl #16
  33. mla xh, yh, ip, xh
  34. mul yh, xl, yh
  35. mul xl, yl, xl
  36. mul ip, yl, ip
  37. adds xl, xl, yh, lsl #16
  38. adc xh, xh, yh, lsr #16
  39. adds xl, xl, ip, lsl #16
  40. adc xh, xh, ip, lsr #16
  41. ret lr
  42. ENDPROC(__muldi3)
  43. ENDPROC(__aeabi_lmul)