1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
10 * Y: Location 0=preamble,8=loop,9=epilog
11 * Z: Location=0,handler=9
15 .type FUNCNAME, @function
19 p0 = cmp.gtu(bytes,#0)
20 if (!p0.new) jump:nt .Ldone
25 p1 = cmp.gtu(bytes,#15)
27 if (!p0.new) jump:nt .Loop_not_aligned_8
28 src_dst_sav = combine(src,dst)
32 loopcount = lsr(bytes,#3)
35 p3=sp1loop0(.Loop8,loopcount)
40 if (p3) memd(dst++#8) = d_dbuf
41 d_dbuf = memd(src++#8)
45 memd(dst++#8) = d_dbuf
46 bytes -= asl(loopcount,#3)
53 if (p0.new) jump:nt .Lalign
57 if (!p0.new) jump:nt .Loop_not_aligned_4
58 p1 = cmp.gtu(bytes,#7)
63 loopcount = lsr(bytes,#2)
65 p3=sp1loop0(.Loop4,loopcount)
70 if (p3) memw(dst++#4) = w_dbuf
71 w_dbuf = memw(src++#4)
75 memw(dst++#4) = w_dbuf
76 bytes -= asl(loopcount,#2)
83 if (!p0.new) jump:nt .Loop_not_aligned
84 p1 = cmp.gtu(bytes,#3)
89 loopcount = lsr(bytes,#1)
91 p3=sp1loop0(.Loop2,loopcount)
96 if (p3) memh(dst++#2) = w_dbuf
97 w_dbuf = memuh(src++#2)
101 memh(dst++#2) = w_dbuf
102 bytes -= asl(loopcount,#1)
106 .Loop_not_aligned: /* Works for as small as one byte */
107 p3=sp1loop0(.Loop1,bytes)
112 if (p3) memb(dst++#1) = w_dbuf
113 w_dbuf = memub(src++#1)
125 p0 = cmp.gtu(bytes,#0)
126 if (p0.new) jump:nt .Loop_not_aligned
137 if (p0.new) w_dbuf = memub(src)
139 if (!p1) jump .Lsmall
143 if (p0) memb(dst++#1) = w_dbuf
144 if (p0) bytes = add(bytes,#-1)
145 if (p0) src = add(src,#1)
149 if (p0.new) w_dbuf = memuh(src)
151 if (!p1) jump .Lsmall
155 if (p0) memh(dst++#2) = w_dbuf
156 if (p0) bytes = add(bytes,#-2)
157 if (p0) src = add(src,#2)
161 if (p0.new) w_dbuf = memw(src)
163 if (!p1) jump .Lsmall
167 if (p0) memw(dst++#4) = w_dbuf
168 if (p0) bytes = add(bytes,#-4)
169 if (p0) src = add(src,#4)
172 .size FUNCNAME,.-FUNCNAME