diff options
author | Joern Rennecke <joern.rennecke@embecosm.com> | 2002-05-16 17:29:15 +0000 |
---|---|---|
committer | Joern Rennecke <joern.rennecke@embecosm.com> | 2002-05-16 17:29:15 +0000 |
commit | 6935231fdeaaac4db13506f6f54ffb3b3d4f7e1e (patch) | |
tree | 6fdfd9b5e73e6aeea51bbf1e95882b45d18ea88e | |
parent | d7a2f413bcbb81ce667d1131523428d286ebcfb7 (diff) | |
download | newlib-6935231fdeaaac4db13506f6f54ffb3b3d4f7e1e.zip newlib-6935231fdeaaac4db13506f6f54ffb3b3d4f7e1e.tar.gz newlib-6935231fdeaaac4db13506f6f54ffb3b3d4f7e1e.tar.bz2 |
* libc/machine/sh/strcpy.S (strcpy): make sure r0 has right value
at first loop exit point.
-rw-r--r-- | newlib/ChangeLog | 5 | ||||
-rw-r--r-- | newlib/libc/machine/sh/strcpy.S | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index a19ea6d..0bb6003 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,7 +1,8 @@ -Thu May 16 16:12:00 2002 J"orn Rennecke <joern.rennecke@superh.com> +Thu May 16 17:24:57 2002 J"orn Rennecke <joern.rennecke@superh.com> * libc/machine/sh/strcpy.S (strcpy): Replace LITTLE_ENDIAN with - __LITTLE_ENDIAN__. + __LITTLE_ENDIAN__. make sure r0 has right value at first loop + exit point. 2002-05-15 Thomas Fitzsimmons <fitzsim@redhat.com> diff --git a/newlib/libc/machine/sh/strcpy.S b/newlib/libc/machine/sh/strcpy.S index 774f542..fa41cd2 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 */ |