memcpy-700.S 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #include <linux/linkage.h>
  9. ENTRY_CFI(memcpy)
  10. or r3,r0,r1
  11. asl_s r3,r3,30
  12. mov_s r5,r0
  13. brls.d r2,r3,.Lcopy_bytewise
  14. sub.f r3,r2,1
  15. ld_s r12,[r1,0]
  16. asr.f lp_count,r3,3
  17. bbit0.d r3,2,.Lnox4
  18. bmsk_s r2,r2,1
  19. st.ab r12,[r5,4]
  20. ld.a r12,[r1,4]
  21. .Lnox4:
  22. lppnz .Lendloop
  23. ld_s r3,[r1,4]
  24. st.ab r12,[r5,4]
  25. ld.a r12,[r1,8]
  26. st.ab r3,[r5,4]
  27. .Lendloop:
  28. breq r2,0,.Last_store
  29. ld r3,[r5,0]
  30. #ifdef __LITTLE_ENDIAN__
  31. add3 r2,-1,r2
  32. ; uses long immediate
  33. xor_s r12,r12,r3
  34. bmsk r12,r12,r2
  35. xor_s r12,r12,r3
  36. #else /* BIG ENDIAN */
  37. sub3 r2,31,r2
  38. ; uses long immediate
  39. xor_s r3,r3,r12
  40. bmsk r3,r3,r2
  41. xor_s r12,r12,r3
  42. #endif /* ENDIAN */
  43. .Last_store:
  44. j_s.d [blink]
  45. st r12,[r5,0]
  46. .balign 4
  47. .Lcopy_bytewise:
  48. jcs [blink]
  49. ldb_s r12,[r1,0]
  50. lsr.f lp_count,r3
  51. bhs_s .Lnox1
  52. stb.ab r12,[r5,1]
  53. ldb.a r12,[r1,1]
  54. .Lnox1:
  55. lppnz .Lendbloop
  56. ldb_s r3,[r1,1]
  57. stb.ab r12,[r5,1]
  58. ldb.a r12,[r1,2]
  59. stb.ab r3,[r5,1]
  60. .Lendbloop:
  61. j_s.d [blink]
  62. stb r12,[r5,0]
  63. END_CFI(memcpy)