Lines Matching +full:3 +full:- +full:4

1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
6 * -__clear_user( ) called multiple times during elf load was byte loop
10 * -Hand crafted constant propagation for "constant" copy sizes
11 * -stock kernel shrunk by 33K at -O3
14 * -Added option to (UN)inline copy_(to|from)_user to reduce code sz
15 * -kernel shrunk by 200K even at -O3 (gcc 4.2.1)
16 * -Enabled when doing -Os
34 case 4: __arc_get_user_one(*(k), u, "ld", __ret); break; \
41 * Returns 0 on success, -EFAULT if not.
42 * @ret already contains 0 - given that errors will be less likely
44 * In case of error, fixup code will make it -EFAULT
51 " .align 4\n" \
52 "3: # return -EFAULT\n" \
53 " mov %0, %3\n" \
59 " .align 4\n" \
60 " .word 1b,3b\n" \
64 : "r" (src), "ir" (-EFAULT))
69 "4: ld %R1,[%2, 4]\n" \
72 " .align 4\n" \
73 "3: # return -EFAULT\n" \
74 " mov %0, %3\n" \
81 " .align 4\n" \
82 " .word 1b,3b\n" \
83 " .word 4b,3b\n" \
87 : "r" (src), "ir" (-EFAULT))
95 case 4: __arc_put_user_one(*(k), u, "st", __ret); break; \
106 " .align 4\n" \
107 "3: mov %0, %3\n" \
111 " .align 4\n" \
112 " .word 1b,3b\n" \
116 : "r" (src), "r" (dst), "ir" (-EFAULT))
121 "4: st %R1,[%2, 4]\n" \
124 " .align 4\n" \
125 "3: mov %0, %3\n" \
129 " .align 4\n" \
130 " .word 1b,3b\n" \
131 " .word 4b,3b\n" \
135 : "r" (src), "r" (dst), "ir" (-EFAULT))
157 "1: ldb.ab %1, [%3, 1] \n" in raw_copy_from_user()
162 " .align 4 \n" in raw_copy_from_user()
163 "3: j 2b \n" in raw_copy_from_user()
166 " .align 4 \n" in raw_copy_from_user()
167 " .word 1b, 3b \n" in raw_copy_from_user()
184 * Hand-crafted constant propagation to reduce code sz of the in raw_copy_from_user()
185 * laddered copy 16x,8,4,2,1 in raw_copy_from_user()
194 " lsr lp_count, %7,4 \n" in raw_copy_from_user()
195 " lp 3f \n" in raw_copy_from_user()
196 "1: ld.ab %3, [%2, 4] \n" in raw_copy_from_user()
197 "11: ld.ab %4, [%2, 4] \n" in raw_copy_from_user()
198 "12: ld.ab %5, [%2, 4] \n" in raw_copy_from_user()
199 "13: ld.ab %6, [%2, 4] \n" in raw_copy_from_user()
200 " st.ab %3, [%1, 4] \n" in raw_copy_from_user()
201 " st.ab %4, [%1, 4] \n" in raw_copy_from_user()
202 " st.ab %5, [%1, 4] \n" in raw_copy_from_user()
203 " st.ab %6, [%1, 4] \n" in raw_copy_from_user()
205 "3: ;nop \n" in raw_copy_from_user()
207 " .align 4 \n" in raw_copy_from_user()
208 "4: j 3b \n" in raw_copy_from_user()
211 " .align 4 \n" in raw_copy_from_user()
212 " .word 1b, 4b \n" in raw_copy_from_user()
213 " .word 11b,4b \n" in raw_copy_from_user()
214 " .word 12b,4b \n" in raw_copy_from_user()
215 " .word 13b,4b \n" in raw_copy_from_user()
226 "14: ld.ab %3, [%2,4] \n" in raw_copy_from_user()
227 "15: ld.ab %4, [%2,4] \n" in raw_copy_from_user()
228 " st.ab %3, [%1,4] \n" in raw_copy_from_user()
229 " st.ab %4, [%1,4] \n" in raw_copy_from_user()
233 " .align 4 \n" in raw_copy_from_user()
234 "4: j 31b \n" in raw_copy_from_user()
237 " .align 4 \n" in raw_copy_from_user()
238 " .word 14b,4b \n" in raw_copy_from_user()
239 " .word 15b,4b \n" in raw_copy_from_user()
246 if (orig_n / 4) { in raw_copy_from_user()
247 orig_n = orig_n % 4; in raw_copy_from_user()
250 "16: ld.ab %3, [%2,4] \n" in raw_copy_from_user()
251 " st.ab %3, [%1,4] \n" in raw_copy_from_user()
252 " sub %0,%0,4 \n" in raw_copy_from_user()
255 " .align 4 \n" in raw_copy_from_user()
256 "4: j 32b \n" in raw_copy_from_user()
259 " .align 4 \n" in raw_copy_from_user()
260 " .word 16b,4b \n" in raw_copy_from_user()
270 "17: ldw.ab %3, [%2,2] \n" in raw_copy_from_user()
271 " stw.ab %3, [%1,2] \n" in raw_copy_from_user()
275 " .align 4 \n" in raw_copy_from_user()
276 "4: j 33b \n" in raw_copy_from_user()
279 " .align 4 \n" in raw_copy_from_user()
280 " .word 17b,4b \n" in raw_copy_from_user()
288 "18: ldb.ab %3, [%2,2] \n" in raw_copy_from_user()
289 " stb.ab %3, [%1,2] \n" in raw_copy_from_user()
293 " .align 4 \n" in raw_copy_from_user()
294 "4: j 34b \n" in raw_copy_from_user()
297 " .align 4 \n" in raw_copy_from_user()
298 " .word 18b,4b \n" in raw_copy_from_user()
304 } else { /* n is NOT constant, so laddered copy of 16x,8,4,2,1 */ in raw_copy_from_user()
307 " mov %0,%3 \n" in raw_copy_from_user()
308 " lsr.f lp_count, %3,4 \n" /* 16x bytes */ in raw_copy_from_user()
309 " lpnz 3f \n" in raw_copy_from_user()
310 "1: ld.ab %5, [%2, 4] \n" in raw_copy_from_user()
311 "11: ld.ab %6, [%2, 4] \n" in raw_copy_from_user()
312 "12: ld.ab %7, [%2, 4] \n" in raw_copy_from_user()
313 "13: ld.ab %8, [%2, 4] \n" in raw_copy_from_user()
314 " st.ab %5, [%1, 4] \n" in raw_copy_from_user()
315 " st.ab %6, [%1, 4] \n" in raw_copy_from_user()
316 " st.ab %7, [%1, 4] \n" in raw_copy_from_user()
317 " st.ab %8, [%1, 4] \n" in raw_copy_from_user()
319 "3: and.f %3,%3,0xf \n" /* stragglers */ in raw_copy_from_user()
321 " bbit0 %3,3,31f \n" /* 8 bytes left */ in raw_copy_from_user()
322 "14: ld.ab %5, [%2,4] \n" in raw_copy_from_user()
323 "15: ld.ab %6, [%2,4] \n" in raw_copy_from_user()
324 " st.ab %5, [%1,4] \n" in raw_copy_from_user()
325 " st.ab %6, [%1,4] \n" in raw_copy_from_user()
327 "31: bbit0 %3,2,32f \n" /* 4 bytes left */ in raw_copy_from_user()
328 "16: ld.ab %5, [%2,4] \n" in raw_copy_from_user()
329 " st.ab %5, [%1,4] \n" in raw_copy_from_user()
330 " sub.f %0,%0,4 \n" in raw_copy_from_user()
331 "32: bbit0 %3,1,33f \n" /* 2 bytes left */ in raw_copy_from_user()
335 "33: bbit0 %3,0,34f \n" in raw_copy_from_user()
341 " .align 4 \n" in raw_copy_from_user()
342 "4: j 34b \n" in raw_copy_from_user()
345 " .align 4 \n" in raw_copy_from_user()
346 " .word 1b, 4b \n" in raw_copy_from_user()
347 " .word 11b,4b \n" in raw_copy_from_user()
348 " .word 12b,4b \n" in raw_copy_from_user()
349 " .word 13b,4b \n" in raw_copy_from_user()
350 " .word 14b,4b \n" in raw_copy_from_user()
351 " .word 15b,4b \n" in raw_copy_from_user()
352 " .word 16b,4b \n" in raw_copy_from_user()
353 " .word 17b,4b \n" in raw_copy_from_user()
354 " .word 18b,4b \n" in raw_copy_from_user()
383 " lpnz 3f \n" in raw_copy_to_user()
384 " ldb.ab %1, [%3, 1] \n" in raw_copy_to_user()
387 "3: ;nop \n" in raw_copy_to_user()
389 " .align 4 \n" in raw_copy_to_user()
390 "4: j 3b \n" in raw_copy_to_user()
393 " .align 4 \n" in raw_copy_to_user()
394 " .word 1b, 4b \n" in raw_copy_to_user()
416 " lsr lp_count, %7,4 \n" in raw_copy_to_user()
417 " lp 3f \n" in raw_copy_to_user()
418 " ld.ab %3, [%2, 4] \n" in raw_copy_to_user()
419 " ld.ab %4, [%2, 4] \n" in raw_copy_to_user()
420 " ld.ab %5, [%2, 4] \n" in raw_copy_to_user()
421 " ld.ab %6, [%2, 4] \n" in raw_copy_to_user()
422 "1: st.ab %3, [%1, 4] \n" in raw_copy_to_user()
423 "11: st.ab %4, [%1, 4] \n" in raw_copy_to_user()
424 "12: st.ab %5, [%1, 4] \n" in raw_copy_to_user()
425 "13: st.ab %6, [%1, 4] \n" in raw_copy_to_user()
427 "3:;nop \n" in raw_copy_to_user()
429 " .align 4 \n" in raw_copy_to_user()
430 "4: j 3b \n" in raw_copy_to_user()
433 " .align 4 \n" in raw_copy_to_user()
434 " .word 1b, 4b \n" in raw_copy_to_user()
435 " .word 11b,4b \n" in raw_copy_to_user()
436 " .word 12b,4b \n" in raw_copy_to_user()
437 " .word 13b,4b \n" in raw_copy_to_user()
448 " ld.ab %3, [%2,4] \n" in raw_copy_to_user()
449 " ld.ab %4, [%2,4] \n" in raw_copy_to_user()
450 "14: st.ab %3, [%1,4] \n" in raw_copy_to_user()
451 "15: st.ab %4, [%1,4] \n" in raw_copy_to_user()
455 " .align 4 \n" in raw_copy_to_user()
456 "4: j 31b \n" in raw_copy_to_user()
459 " .align 4 \n" in raw_copy_to_user()
460 " .word 14b,4b \n" in raw_copy_to_user()
461 " .word 15b,4b \n" in raw_copy_to_user()
468 if (orig_n / 4) { in raw_copy_to_user()
469 orig_n = orig_n % 4; in raw_copy_to_user()
472 " ld.ab %3, [%2,4] \n" in raw_copy_to_user()
473 "16: st.ab %3, [%1,4] \n" in raw_copy_to_user()
474 " sub %0, %0, 4 \n" in raw_copy_to_user()
477 " .align 4 \n" in raw_copy_to_user()
478 "4: j 32b \n" in raw_copy_to_user()
481 " .align 4 \n" in raw_copy_to_user()
482 " .word 16b,4b \n" in raw_copy_to_user()
492 " ldw.ab %3, [%2,2] \n" in raw_copy_to_user()
493 "17: stw.ab %3, [%1,2] \n" in raw_copy_to_user()
497 " .align 4 \n" in raw_copy_to_user()
498 "4: j 33b \n" in raw_copy_to_user()
501 " .align 4 \n" in raw_copy_to_user()
502 " .word 17b,4b \n" in raw_copy_to_user()
510 " ldb.ab %3, [%2,1] \n" in raw_copy_to_user()
511 "18: stb.ab %3, [%1,1] \n" in raw_copy_to_user()
515 " .align 4 \n" in raw_copy_to_user()
516 "4: j 34b \n" in raw_copy_to_user()
519 " .align 4 \n" in raw_copy_to_user()
520 " .word 18b,4b \n" in raw_copy_to_user()
526 } else { /* n is NOT constant, so laddered copy of 16x,8,4,2,1 */ in raw_copy_to_user()
529 " mov %0,%3 \n" in raw_copy_to_user()
530 " lsr.f lp_count, %3,4 \n" /* 16x bytes */ in raw_copy_to_user()
531 " lpnz 3f \n" in raw_copy_to_user()
532 " ld.ab %5, [%2, 4] \n" in raw_copy_to_user()
533 " ld.ab %6, [%2, 4] \n" in raw_copy_to_user()
534 " ld.ab %7, [%2, 4] \n" in raw_copy_to_user()
535 " ld.ab %8, [%2, 4] \n" in raw_copy_to_user()
536 "1: st.ab %5, [%1, 4] \n" in raw_copy_to_user()
537 "11: st.ab %6, [%1, 4] \n" in raw_copy_to_user()
538 "12: st.ab %7, [%1, 4] \n" in raw_copy_to_user()
539 "13: st.ab %8, [%1, 4] \n" in raw_copy_to_user()
541 "3: and.f %3,%3,0xf \n" /* stragglers */ in raw_copy_to_user()
543 " bbit0 %3,3,31f \n" /* 8 bytes left */ in raw_copy_to_user()
544 " ld.ab %5, [%2,4] \n" in raw_copy_to_user()
545 " ld.ab %6, [%2,4] \n" in raw_copy_to_user()
546 "14: st.ab %5, [%1,4] \n" in raw_copy_to_user()
547 "15: st.ab %6, [%1,4] \n" in raw_copy_to_user()
549 "31: bbit0 %3,2,32f \n" /* 4 bytes left */ in raw_copy_to_user()
550 " ld.ab %5, [%2,4] \n" in raw_copy_to_user()
551 "16: st.ab %5, [%1,4] \n" in raw_copy_to_user()
552 " sub.f %0, %0, 4 \n" in raw_copy_to_user()
553 "32: bbit0 %3,1,33f \n" /* 2 bytes left */ in raw_copy_to_user()
557 "33: bbit0 %3,0,34f \n" in raw_copy_to_user()
563 " .align 4 \n" in raw_copy_to_user()
564 "4: j 34b \n" in raw_copy_to_user()
567 " .align 4 \n" in raw_copy_to_user()
568 " .word 1b, 4b \n" in raw_copy_to_user()
569 " .word 11b,4b \n" in raw_copy_to_user()
570 " .word 12b,4b \n" in raw_copy_to_user()
571 " .word 13b,4b \n" in raw_copy_to_user()
572 " .word 14b,4b \n" in raw_copy_to_user()
573 " .word 15b,4b \n" in raw_copy_to_user()
574 " .word 16b,4b \n" in raw_copy_to_user()
575 " .word 17b,4b \n" in raw_copy_to_user()
576 " .word 18b,4b \n" in raw_copy_to_user()
600 " lpnz 3f \n" in __arc_clear_user()
601 "77: st.ab %2, [%0,4] \n" in __arc_clear_user()
602 " sub %1, %1, 4 \n" in __arc_clear_user()
603 "3: bbit0 %1, 1, 4f \n" in __arc_clear_user()
606 "4: bbit0 %1, 0, 5f \n" in __arc_clear_user()
611 " .align 4 \n" in __arc_clear_user()
612 "3: j 5b \n" in __arc_clear_user()
615 " .align 4 \n" in __arc_clear_user()
616 " .word 75b, 3b \n" in __arc_clear_user()
617 " .word 76b, 3b \n" in __arc_clear_user()
618 " .word 77b, 3b \n" in __arc_clear_user()
619 " .word 78b, 3b \n" in __arc_clear_user()
620 " .word 79b, 3b \n" in __arc_clear_user()
641 #include <asm-generic/uaccess.h>