memcpy_likely_aligned.S 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //===------------------------- memcopy routines ---------------------------===//
  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_memcpy_likely_aligned_min32bytes_mult8bytes
  19. {
  20. p0 = bitsclr(r1,#7)
  21. p0 = bitsclr(r0,#7)
  22. if (p0.new) r5:4 = memd(r1)
  23. r3 = #-3
  24. }
  25. {
  26. if (!p0) jump .Lmemcpy_call
  27. if (p0) memd(r0++#8) = r5:4
  28. if (p0) r5:4 = memd(r1+#8)
  29. r3 += lsr(r2,#3)
  30. }
  31. {
  32. memd(r0++#8) = r5:4
  33. r5:4 = memd(r1+#16)
  34. r1 = add(r1,#24)
  35. loop0(1f,r3)
  36. }
  37. .falign
  38. 1:
  39. {
  40. memd(r0++#8) = r5:4
  41. r5:4 = memd(r1++#8)
  42. }:endloop0
  43. {
  44. memd(r0) = r5:4
  45. r0 -= add(r2,#-8)
  46. jumpr r31
  47. }
  48. FUNCTION_END __hexagon_memcpy_likely_aligned_min32bytes_mult8bytes
  49. .Lmemcpy_call:
  50. #ifdef __PIC__
  51. jump memcpy@PLT
  52. #else
  53. jump memcpy
  54. #endif
  55. .globl __qdsp_memcpy_likely_aligned_min32bytes_mult8bytes
  56. .set __qdsp_memcpy_likely_aligned_min32bytes_mult8bytes, \
  57. __hexagon_memcpy_likely_aligned_min32bytes_mult8bytes