2 * Copyright (C) 2002 Paul Mackerras, IBM Corp.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
9 #include <asm/processor.h>
10 #include <asm/ppc_asm.h>
11 #include <asm/export.h>
16 #ifdef __LITTLE_ENDIAN__
19 std r3,-STACKFRAMESIZE+STK_REG(R31)(r1) /* save destination pointer for return value */
25 ALT_FTR_SECTION_END_IFCLR(CPU_FTR_VMX_COPY)
26 #ifdef __LITTLE_ENDIAN__
27 /* dumb little-endian memcpy that will get replaced at runtime */
39 neg r6,r3 # LS 3 bits = # bytes to 8-byte dest bdry
43 /* Below we want to nop out the bne if we're on a CPU that has the
44 CPU_FTR_UNALIGNED_LD_STD bit set and the CPU_FTR_CP_USE_DCBTZ bit
46 At the time of writing the only CPU that has this combination of bits
52 ALT_FTR_SECTION_END(CPU_FTR_UNALIGNED_LD_STD | CPU_FTR_CP_USE_DCBTZ, \
53 CPU_FTR_UNALIGNED_LD_STD)
59 END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_LD_STD)
92 3: ld r3,-STACKFRAMESIZE+STK_REG(R31)(r1) /* return dest pointer */
109 ld r9,0(r4) # 3+2n loads, 2+2n stores
118 # s1<< in r8, d0=(s0<<|s1>>) in r7, s3 in r0, s2 in r9, nix in r6 & r12
121 0: ld r0,0(r4) # 4+2n loads, 3+2n stores
136 # d0=(s0<<|s1>>) in r12, s1<< in r6, s2>> in r7, s2<< in r8, s3 in r9
175 3: ld r3,-STACKFRAMESIZE+STK_REG(R31)(r1) /* return dest pointer */
179 PPC_MTOCRF(0x01,r6) # put #bytes to 8B bdry into cr7
194 3: PPC_MTOCRF(0x01,r5)
220 4: ld r3,-STACKFRAMESIZE+STK_REG(R31)(r1) /* return dest pointer */
223 EXPORT_SYMBOL(memcpy)