2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (C) 1998 Ralf Baechle
9 #include <asm/regdef.h>
11 #define ADDC(sum,reg) \
16 #define CSUM_BIGCHUNK(src, offset, sum, t0, t1, t2, t3) \
17 lw t0, (offset + 0x00)(src); \
18 lw t1, (offset + 0x04)(src); \
19 lw t2, (offset + 0x08)(src); \
20 lw t3, (offset + 0x0c)(src); \
25 lw t0, (offset + 0x10)(src); \
26 lw t1, (offset + 0x14)(src); \
27 lw t2, (offset + 0x18)(src); \
28 lw t3, (offset + 0x1c)(src); \
36 * a1: length of the area to checksum
37 * a2: partial checksum
47 /* unknown src alignment and < 8 bytes to go */
55 /* Still a full word to go */
64 /* Still a halfword to go */
88 /* odd buffer alignment? */
97 /* Add the passed partial csum. */
102 /* ------------------------------------------------------------------------- */
110 bnez t8, small_csumcpy /* < 8 bytes to copy */
114 andi t7, src, 0x1 /* odd buffer? */
140 bnez t8, do_end_words
166 beqz t8, begin_movement
186 CSUM_BIGCHUNK(src, 0x00, sum, t0, t1, t3, t4)
187 CSUM_BIGCHUNK(src, 0x20, sum, t0, t1, t3, t4)
188 CSUM_BIGCHUNK(src, 0x40, sum, t0, t1, t3, t4)
189 CSUM_BIGCHUNK(src, 0x60, sum, t0, t1, t3, t4)
191 bnez t8, move_128bytes
199 CSUM_BIGCHUNK(src, 0x00, sum, t0, t1, t3, t4)
200 CSUM_BIGCHUNK(src, 0x20, sum, t0, t1, t3, t4)
204 beqz t2, do_end_words
208 CSUM_BIGCHUNK(src, 0x00, sum, t0, t1, t3, t4)
213 beqz t8, maybe_end_cruft
227 j small_csumcpy; move a1, t2