muldi3.S 837 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. #ifdef __ARMEB__
  14. #define xh r0
  15. #define xl r1
  16. #define yh r2
  17. #define yl r3
  18. #else
  19. #define xl r0
  20. #define xh r1
  21. #define yl r2
  22. #define yh r3
  23. #endif
  24. ENTRY(__muldi3)
  25. mul xh, yl, xh
  26. mla xh, xl, yh, xh
  27. mov ip, xl, asr #16
  28. mov yh, yl, asr #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. mov pc, lr