muldi3.S 996 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. #include <asm/export.h>
  15. #ifdef __ARMEB__
  16. #define xh r0
  17. #define xl r1
  18. #define yh r2
  19. #define yl r3
  20. #else
  21. #define xl r0
  22. #define xh r1
  23. #define yl r2
  24. #define yh r3
  25. #endif
  26. ENTRY(__muldi3)
  27. ENTRY(__aeabi_lmul)
  28. mul xh, yl, xh
  29. mla xh, xl, yh, xh
  30. mov ip, xl, lsr #16
  31. mov yh, yl, lsr #16
  32. bic xl, xl, ip, lsl #16
  33. bic yl, yl, yh, lsl #16
  34. mla xh, yh, ip, xh
  35. mul yh, xl, yh
  36. mul xl, yl, xl
  37. mul ip, yl, ip
  38. adds xl, xl, yh, lsl #16
  39. adc xh, xh, yh, lsr #16
  40. adds xl, xl, ip, lsl #16
  41. adc xh, xh, ip, lsr #16
  42. ret lr
  43. ENDPROC(__muldi3)
  44. ENDPROC(__aeabi_lmul)
  45. EXPORT_SYMBOL(__muldi3)
  46. EXPORT_SYMBOL(__aeabi_lmul)