1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Cloned and hacked for uClibc by Paul Mundt, December 2003 */
3 /* Modified by SuperH, Inc. September 2003 */
7 ! by Toshiyasu Morita (tm@netcom.com)
9 ! SH5 code by J"orn Rennecke (joern.rennecke@superh.com)
10 ! Copyright 2002 SuperH Ltd.
13 #if __BYTE_ORDER == __LITTLE_ENDIAN
21 .section .text..SHmedia32,"ax"
23 .type memset, @function
33 mperm.w r3, r63, r3 // Fill pattern now in every byte of r3
36 bgtu/u r23, r9, tr0 // multiquad
38 beqi/u r4, 0, tr2 // Return with size 0 - ensures no mem accesses
53 beqi/u r24, 1, tr0 // lastquad
56 andi r5, -8, r20 // calculate end address and
57 addi r20, -7*8, r8 // loop end address; This might overflow, so we need
58 // to use a different test before we start the loop
59 bge/u r24, r9, tr1 // loop
63 beqi/u r24, 1, tr0 // lastquad
66 beqi/u r24, 2, tr0 // lastquad
74 !!! alloco r25, 32 // QQQ comment out for short-term fix to SHUK #3895.
75 // QQQ commenting out is locically correct, but sub-optimal
76 // QQQ Sean McGoogan - 4th April 2003.
82 bgeu/l r8, r25, tr1 // loop