modsi3.S 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2021, The Linux Foundation. All rights reserved.
  4. */
  5. #include <linux/linkage.h>
  6. SYM_FUNC_START(__hexagon_modsi3)
  7. {
  8. p2 = cmp.ge(r0,#0)
  9. r2 = abs(r0)
  10. r1 = abs(r1)
  11. }
  12. {
  13. r3 = cl0(r2)
  14. r4 = cl0(r1)
  15. p0 = cmp.gtu(r1,r2)
  16. }
  17. {
  18. r3 = sub(r4,r3)
  19. if (p0) jumpr r31
  20. }
  21. {
  22. p1 = cmp.eq(r3,#0)
  23. loop0(1f,r3)
  24. r0 = r2
  25. r2 = lsl(r1,r3)
  26. }
  27. .falign
  28. 1:
  29. {
  30. p0 = cmp.gtu(r2,r0)
  31. if (!p0.new) r0 = sub(r0,r2)
  32. r2 = lsr(r2,#1)
  33. if (p1) r1 = #0
  34. }:endloop0
  35. {
  36. p0 = cmp.gtu(r2,r0)
  37. if (!p0.new) r0 = sub(r0,r1)
  38. if (p2) jumpr r31
  39. }
  40. {
  41. r0 = neg(r0)
  42. jumpr r31
  43. }
  44. SYM_FUNC_END(__hexagon_modsi3)