stpcpy.S 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* Copyright (C) 2000-2026 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library. If not, see
  13. <https://www.gnu.org/licenses/>. */
  14. /* Copy SRC to DEST returning the address of the terminating 0 in DEST. */
  15. #include <sysdep.h>
  16. .arch ev6
  17. .set noreorder
  18. .set noat
  19. .text
  20. ENTRY(__stpcpy)
  21. ldgp gp, 0(pv)
  22. #ifdef PROF
  23. lda AT, _mcount
  24. jsr AT, (AT), _mcount
  25. #endif
  26. .prologue 1
  27. .align 4
  28. mov a0, v0
  29. nop
  30. jsr t9, __stxcpy
  31. # t8 = bitmask (with one bit set) indicating the last byte written
  32. # a0 = unaligned address of the last *word* written
  33. cttz t8, t8
  34. andnot a0, 7, a0
  35. addq a0, t8, v0
  36. ret
  37. END(__stpcpy)
  38. weak_alias (__stpcpy, stpcpy)
  39. libc_hidden_def (__stpcpy)
  40. libc_hidden_builtin_def (stpcpy)