2 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 * Y: Location 0=preamble,8=loop,9=epilog
24 * Z: Location=0,handler=9
28 .type FUNCNAME, @function
32 p0 = cmp.gtu(bytes,#0)
33 if (!p0.new) jump:nt .Ldone
38 p1 = cmp.gtu(bytes,#15)
40 if (!p0.new) jump:nt .Loop_not_aligned_8
41 src_dst_sav = combine(src,dst)
45 loopcount = lsr(bytes,#3)
48 p3=sp1loop0(.Loop8,loopcount)
53 if (p3) memd(dst++#8) = d_dbuf
54 d_dbuf = memd(src++#8)
58 memd(dst++#8) = d_dbuf
59 bytes -= asl(loopcount,#3)
66 if (p0.new) jump:nt .Lalign
70 if (!p0.new) jump:nt .Loop_not_aligned_4
71 p1 = cmp.gtu(bytes,#7)
76 loopcount = lsr(bytes,#2)
78 p3=sp1loop0(.Loop4,loopcount)
83 if (p3) memw(dst++#4) = w_dbuf
84 w_dbuf = memw(src++#4)
88 memw(dst++#4) = w_dbuf
89 bytes -= asl(loopcount,#2)
96 if (!p0.new) jump:nt .Loop_not_aligned
97 p1 = cmp.gtu(bytes,#3)
101 if (!p1) jump .Lsmall
102 loopcount = lsr(bytes,#1)
104 p3=sp1loop0(.Loop2,loopcount)
109 if (p3) memh(dst++#2) = w_dbuf
110 w_dbuf = memuh(src++#2)
114 memh(dst++#2) = w_dbuf
115 bytes -= asl(loopcount,#1)
119 .Loop_not_aligned: /* Works for as small as one byte */
120 p3=sp1loop0(.Loop1,bytes)
125 if (p3) memb(dst++#1) = w_dbuf
126 w_dbuf = memub(src++#1)
138 p0 = cmp.gtu(bytes,#0)
139 if (p0.new) jump:nt .Loop_not_aligned
150 if (p0.new) w_dbuf = memub(src)
152 if (!p1) jump .Lsmall
156 if (p0) memb(dst++#1) = w_dbuf
157 if (p0) bytes = add(bytes,#-1)
158 if (p0) src = add(src,#1)
162 if (p0.new) w_dbuf = memuh(src)
164 if (!p1) jump .Lsmall
168 if (p0) memh(dst++#2) = w_dbuf
169 if (p0) bytes = add(bytes,#-2)
170 if (p0) src = add(src,#2)
174 if (p0.new) w_dbuf = memw(src)
176 if (!p1) jump .Lsmall
180 if (p0) memw(dst++#4) = w_dbuf
181 if (p0) bytes = add(bytes,#-4)
182 if (p0) src = add(src,#4)
185 .size FUNCNAME,.-FUNCNAME