diff options
author | Joern Rennecke <joern.rennecke@embecosm.com> | 2002-05-16 21:29:15 +0400 |
---|---|---|
committer | Joern Rennecke <joern.rennecke@embecosm.com> | 2002-05-16 21:29:15 +0400 |
commit | 6935231fdeaaac4db13506f6f54ffb3b3d4f7e1e (patch) | |
tree | 6fdfd9b5e73e6aeea51bbf1e95882b45d18ea88e /newlib/libc/machine | |
parent | d7a2f413bcbb81ce667d1131523428d286ebcfb7 (diff) |
* libc/machine/sh/strcpy.S (strcpy): make sure r0 has right value
at first loop exit point.
Diffstat (limited to 'newlib/libc/machine')
-rw-r--r-- | newlib/libc/machine/sh/strcpy.S | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/newlib/libc/machine/sh/strcpy.S b/newlib/libc/machine/sh/strcpy.S index 774f542c6..fa41cd2a5 100644 --- a/newlib/libc/machine/sh/strcpy.S +++ b/newlib/libc/machine/sh/strcpy.S @@ -14,7 +14,7 @@ ENTRY(strcpy) ldlo.q r3,0,r4 ptabs r18,tr4 shlli r3,3,r7 - add r2,r63,r0 + addi r2, 8, r0 mcmpeq.b r4,r63,r6 SHHI r6,r7,r6 bnei/u r6,0,tr1 // shortstring @@ -38,6 +38,7 @@ ENTRY(strcpy) beqi/l r6, 0, tr0 // loop add r5, r63, r4 + addi r0, 8, r0 blink tr1, r63 // shortstring no_lddst: stlo.q r2, 0, r4 @@ -46,13 +47,14 @@ no_lddst: beqi/l r6, 0, tr0 // loop add r5, r63, r4 + addi r0, 8, r0 shortstring: #ifndef __LITTLE_ENDIAN__ pta/l shortstring2,tr1 byterev r4,r4 #endif shortstring2: - st.b r0,0,r4 + st.b r0,-8,r4 andi r4,0xff,r5 shlri r4,8,r4 addi r0,1,r0 @@ -74,6 +76,7 @@ loop: beqi/l r6, 0, tr0 // loop add r5, r63, r4 + addi r0, 8, r0 blink tr1, r63 // shortstring #else /* ! __SHMEDIA__, i.e. SH 1..4 / SHcompact */ |