2 * Copyright (C) 2004, 2007-2010, 2011-2014 Synopsys, Inc. All rights reserved.
4 * SPDX-License-Identifier: GPL-2.0+
8 * If dst and src are 4 byte aligned, copy 8 bytes at a time.
9 * If the src is 4, but not 8 byte aligned, we first read 4 bytes to get
10 * it 8 byte aligned. Thus, we can do a little read-ahead, without
11 * dereferencing a cache line that we should not touch.
12 * Note that short and long instructions have been scheduled to avoid
14 * The beq_s to r3z could be made unaligned & long to avoid a stall
15 * there, but it is not likely to be taken often, and it would also be likely
16 * to cost an unaligned mispredict at the next call.
24 brne.d %r2, 0, charloop
28 bbit0.d %r1, 2, loop_start
51 #ifdef __LITTLE_ENDIAN__
52 r3z: bmsk.f %r1, %r3, 7
54 #else /* __BIG_ENDIAN__ */
55 r3z: lsr.f %r1, %r3, 24
57 #endif /* _ENDIAN__ */
65 brne.d %r3, 0, charloop