You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lldivmod.S 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
  2. .text
  3. .thumb
  4. /**
  5. * Unsigned long long division
  6. *
  7. * @v r1:r0 Dividend
  8. * @v r3:r2 Divisor
  9. * @ret r1:r0 Quotient
  10. * @ret r3:r2 Remainder
  11. */
  12. .section ".text.__aeabi_uldivmod", "ax", %progbits
  13. .globl __aeabi_uldivmod
  14. .type __aeabi_uldivmod, %function
  15. __aeabi_uldivmod:
  16. /* Allocate stack space for remainder and pointer to remainder */
  17. push {r0, r1, r2, r3, r4, lr}
  18. /* Call __udivmoddi4() */
  19. add r4, sp, #8
  20. str r4, [sp]
  21. bl __udivmoddi4
  22. /* Retrieve remainder and return */
  23. add sp, sp, #8
  24. pop {r2, r3, r4, pc}
  25. .size __aeabi_uldivmod, . - __aeabi_uldivmod
  26. /**
  27. * Signed long long division
  28. *
  29. * @v r1:r0 Dividend
  30. * @v r3:r2 Divisor
  31. * @ret r1:r0 Quotient
  32. * @ret r3:r2 Remainder
  33. */
  34. .section ".text.__aeabi_ldivmod", "ax", %progbits
  35. .globl __aeabi_ldivmod
  36. .type __aeabi_ldivmod, %function
  37. __aeabi_ldivmod:
  38. /* Allocate stack space for remainder and pointer to remainder */
  39. push {r0, r1, r2, r3, r4, lr}
  40. /* Call __divmoddi4() */
  41. add r4, sp, #8
  42. str r4, [sp]
  43. bl __divmoddi4
  44. /* Retrieve remainder and return */
  45. add sp, sp, #8
  46. pop {r2, r3, r4, pc}
  47. .size __aeabi_ldivmod, . - __aeabi_ldivmod