diff options
Diffstat (limited to 'newlib')
-rw-r--r-- | newlib/ChangeLog | 20 | ||||
-rw-r--r-- | newlib/libc/machine/sh/memset.S | 20 |
2 files changed, 24 insertions, 16 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 2824434..e240513 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,9 @@ +Wed May 8 17:47:35 2002 J"orn Rennecke <joern.rennecke@superh.com> + + * libc/machine/sh/memset.S (memset, __SHMEDIA__ code): + Also handle as single quad word when destination ends at last + byte of first quad word. Fix byte selection in single quad code. + 2002-05-07 Thomas Fitzsimmons <fitzsim@redhat.com> * libc/include/sys/stdio.h: New file. @@ -685,14 +691,14 @@ Tue Mar 26 17:17:10 2002 J"orn Rennecke <joern.rennecke@superh.com> Wed Mar 6 10:24:26 2002 J"orn Rennecke <joern.rennecke@superh.com> - * Makefile.am (lib_a_SOURCES, SH64 case): Add memcpy.S, memset.S - and strcpy.S. - * Makefile.in: Regenerate. - * asm.h (_ENTRY): Set SH5 alignment to 8 bytes. + * libc/machine/sh/Makefile.am (lib_a_SOURCES, SH64 case): + Add memcpy.S, memset.S and strcpy.S. + * libc/machine/sh/Makefile.in: Regenerate. + * libc/machine/sh/asm.h (_ENTRY): Set SH5 alignment to 8 bytes. (SHHI, SHLO): Define. - * memcpy.S: Add code for SH5. - * memset.S: Likewise. - * strcpy.S: Likewise. + * libc/machine/sh/memset.S: Add code for SH5. + * libc/machine/sh/memset.S: Likewise. + * libc/machine/sh/strcpy.S: Likewise. 2002-02-27 Jeff Johnston <jjohnstn@redhat.com> diff --git a/newlib/libc/machine/sh/memset.S b/newlib/libc/machine/sh/memset.S index 6f1f396..3d6f8ef 100644 --- a/newlib/libc/machine/sh/memset.S +++ b/newlib/libc/machine/sh/memset.S @@ -12,33 +12,35 @@ ENTRY(memset) #if __SHMEDIA__ pta/l multiquad, tr0 + andi r2, 7, r22 ptabs r18, tr2 mshflo.b r3,r3,r3 - mperm.w r3, r63, r3 - - andi r2, 7, r22 add r4, r22, r23 - shlri r23, 3, r24 - bnei/u r24, 0, tr0 + mperm.w r3, r63, r3 // Fill pattern now in every byte of r3 + + movi 8, r9 + bgtu/u r23, r9, tr0 ldlo.q r2, 0, r7 - shlli r4, 3, r4 + shlli r4, 2, r4 movi -1, r8 SHHI r8, r4, r8 - mcmv r7, r8, r22 - stlo.q r2, 0, r22 + SHHI r8, r4, r8 + mcmv r7, r8, r3 + stlo.q r2, 0, r3 blink tr2, r63 multiquad: pta/l lastquad, tr0 stlo.q r2, 0, r3 + shlri r23, 3, r24 add r2, r4, r5 beqi/u r24, 1, tr0 // lastquad pta/l loop, tr1 sub r2, r22, r25 andi r5, -8, r20 // calculate end address and addi r20, -7*8, r8 // loop end address; This might overflow, so we need - movi 8, r9 // to use a different test before we start the loop + // to use a different test before we start the loop bge/u r24, r9, tr1 // loop st.q r25, 8, r3 st.q r20, -8, r3 |