umodsi3.S 1013 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //===----------------------Hexagon builtin routine ------------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. .macro FUNCTION_BEGIN name
  9. .text
  10. .p2align 5
  11. .globl \name
  12. .type \name, @function
  13. \name:
  14. .endm
  15. .macro FUNCTION_END name
  16. .size \name, . - \name
  17. .endm
  18. FUNCTION_BEGIN __hexagon_umodsi3
  19. {
  20. r2 = cl0(r0)
  21. r3 = cl0(r1)
  22. p0 = cmp.gtu(r1,r0)
  23. }
  24. {
  25. r2 = sub(r3,r2)
  26. if (p0) jumpr r31
  27. }
  28. {
  29. loop0(1f,r2)
  30. p1 = cmp.eq(r2,#0)
  31. r2 = lsl(r1,r2)
  32. }
  33. .falign
  34. 1:
  35. {
  36. p0 = cmp.gtu(r2,r0)
  37. if (!p0.new) r0 = sub(r0,r2)
  38. r2 = lsr(r2,#1)
  39. if (p1) r1 = #0
  40. }:endloop0
  41. {
  42. p0 = cmp.gtu(r2,r0)
  43. if (!p0.new) r0 = sub(r0,r1)
  44. jumpr r31
  45. }
  46. FUNCTION_END __hexagon_umodsi3
  47. .globl __qdsp_umodsi3
  48. .set __qdsp_umodsi3, __hexagon_umodsi3