Lines Matching +full:1 +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
32 case 1: __arc_get_user_one(*(k), u, "ldb", __ret); break; \
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
48 "1: "op" %1,[%2]\n" \
51 " .align 4\n" \
52 "3: # return -EFAULT\n" \
55 " mov %1, 0\n" \
59 " .align 4\n" \
60 " .word 1b,3b\n" \
64 : "r" (src), "ir" (-EFAULT))
68 "1: ld %1,[%2]\n" \
69 "4: ld %R1,[%2, 4]\n" \
72 " .align 4\n" \
73 "3: # return -EFAULT\n" \
76 " mov %1, 0\n" \
81 " .align 4\n" \
82 " .word 1b,3b\n" \
83 " .word 4b,3b\n" \
87 : "r" (src), "ir" (-EFAULT))
93 case 1: __arc_put_user_one(*(k), u, "stb", __ret); break; \
95 case 4: __arc_put_user_one(*(k), u, "st", __ret); break; \
103 "1: "op" %1,[%2]\n" \
106 " .align 4\n" \
111 " .align 4\n" \
112 " .word 1b,3b\n" \
116 : "r" (src), "r" (dst), "ir" (-EFAULT))
120 "1: st %1,[%2]\n" \
121 "4: st %R1,[%2, 4]\n" \
124 " .align 4\n" \
129 " .align 4\n" \
130 " .word 1b,3b\n" \
131 " .word 4b,3b\n" \
135 : "r" (src), "r" (dst), "ir" (-EFAULT))
158 "1: ldb.ab %1, [%3, 1] \n" in raw_copy_from_user()
159 " stb.ab %1, [%2, 1] \n" in raw_copy_from_user()
160 " sub %0,%0,1 \n" in raw_copy_from_user()
163 " .align 4 \n" in raw_copy_from_user()
167 " .align 4 \n" in raw_copy_from_user()
168 " .word 1b, 3b \n" in raw_copy_from_user()
185 * Hand-crafted constant propagation to reduce code sz of the in raw_copy_from_user()
186 * laddered copy 16x,8,4,2,1 in raw_copy_from_user()
195 " lsr lp_count, %7,4 \n" in raw_copy_from_user()
197 "1: ld.ab %3, [%2, 4] \n" in raw_copy_from_user()
198 "11: ld.ab %4, [%2, 4] \n" in raw_copy_from_user()
199 "12: ld.ab %5, [%2, 4] \n" in raw_copy_from_user()
200 "13: ld.ab %6, [%2, 4] \n" in raw_copy_from_user()
201 " st.ab %3, [%1, 4] \n" in raw_copy_from_user()
202 " st.ab %4, [%1, 4] \n" in raw_copy_from_user()
203 " st.ab %5, [%1, 4] \n" in raw_copy_from_user()
204 " st.ab %6, [%1, 4] \n" in raw_copy_from_user()
208 " .align 4 \n" in raw_copy_from_user()
209 "4: j 3b \n" in raw_copy_from_user()
212 " .align 4 \n" in raw_copy_from_user()
213 " .word 1b, 4b \n" in raw_copy_from_user()
214 " .word 11b,4b \n" in raw_copy_from_user()
215 " .word 12b,4b \n" in raw_copy_from_user()
216 " .word 13b,4b \n" in raw_copy_from_user()
227 "14: ld.ab %3, [%2,4] \n" in raw_copy_from_user()
228 "15: ld.ab %4, [%2,4] \n" in raw_copy_from_user()
229 " st.ab %3, [%1,4] \n" in raw_copy_from_user()
230 " st.ab %4, [%1,4] \n" in raw_copy_from_user()
234 " .align 4 \n" in raw_copy_from_user()
235 "4: j 31b \n" in raw_copy_from_user()
238 " .align 4 \n" in raw_copy_from_user()
239 " .word 14b,4b \n" in raw_copy_from_user()
240 " .word 15b,4b \n" in raw_copy_from_user()
247 if (orig_n / 4) { in raw_copy_from_user()
248 orig_n = orig_n % 4; in raw_copy_from_user()
251 "16: ld.ab %3, [%2,4] \n" in raw_copy_from_user()
252 " st.ab %3, [%1,4] \n" in raw_copy_from_user()
253 " sub %0,%0,4 \n" in raw_copy_from_user()
256 " .align 4 \n" in raw_copy_from_user()
257 "4: j 32b \n" in raw_copy_from_user()
260 " .align 4 \n" in raw_copy_from_user()
261 " .word 16b,4b \n" in raw_copy_from_user()
272 " stw.ab %3, [%1,2] \n" in raw_copy_from_user()
276 " .align 4 \n" in raw_copy_from_user()
277 "4: j 33b \n" in raw_copy_from_user()
280 " .align 4 \n" in raw_copy_from_user()
281 " .word 17b,4b \n" in raw_copy_from_user()
287 if (orig_n & 1) { in raw_copy_from_user()
290 " stb.ab %3, [%1,2] \n" in raw_copy_from_user()
291 " sub %0,%0,1 \n" in raw_copy_from_user()
294 " .align 4 \n" in raw_copy_from_user()
295 "4: j 34b \n" in raw_copy_from_user()
298 " .align 4 \n" in raw_copy_from_user()
299 " .word 18b,4b \n" in raw_copy_from_user()
305 } else { /* n is NOT constant, so laddered copy of 16x,8,4,2,1 */ in raw_copy_from_user()
309 " lsr.f lp_count, %3,4 \n" /* 16x bytes */ in raw_copy_from_user()
311 "1: ld.ab %5, [%2, 4] \n" in raw_copy_from_user()
312 "11: ld.ab %6, [%2, 4] \n" in raw_copy_from_user()
313 "12: ld.ab %7, [%2, 4] \n" in raw_copy_from_user()
314 "13: ld.ab %8, [%2, 4] \n" in raw_copy_from_user()
315 " st.ab %5, [%1, 4] \n" in raw_copy_from_user()
316 " st.ab %6, [%1, 4] \n" in raw_copy_from_user()
317 " st.ab %7, [%1, 4] \n" in raw_copy_from_user()
318 " st.ab %8, [%1, 4] \n" in raw_copy_from_user()
323 "14: ld.ab %5, [%2,4] \n" in raw_copy_from_user()
324 "15: ld.ab %6, [%2,4] \n" in raw_copy_from_user()
325 " st.ab %5, [%1,4] \n" in raw_copy_from_user()
326 " st.ab %6, [%1,4] \n" in raw_copy_from_user()
328 "31: bbit0 %3,2,32f \n" /* 4 bytes left */ in raw_copy_from_user()
329 "16: ld.ab %5, [%2,4] \n" in raw_copy_from_user()
330 " st.ab %5, [%1,4] \n" in raw_copy_from_user()
331 " sub.f %0,%0,4 \n" in raw_copy_from_user()
332 "32: bbit0 %3,1,33f \n" /* 2 bytes left */ in raw_copy_from_user()
334 " stw.ab %5, [%1,2] \n" in raw_copy_from_user()
337 "18: ldb.ab %5, [%2,1] \n" /* 1 byte left */ in raw_copy_from_user()
338 " stb.ab %5, [%1,1] \n" in raw_copy_from_user()
339 " sub.f %0,%0,1 \n" in raw_copy_from_user()
342 " .align 4 \n" in raw_copy_from_user()
343 "4: j 34b \n" in raw_copy_from_user()
346 " .align 4 \n" in raw_copy_from_user()
347 " .word 1b, 4b \n" in raw_copy_from_user()
348 " .word 11b,4b \n" in raw_copy_from_user()
349 " .word 12b,4b \n" in raw_copy_from_user()
350 " .word 13b,4b \n" in raw_copy_from_user()
351 " .word 14b,4b \n" in raw_copy_from_user()
352 " .word 15b,4b \n" in raw_copy_from_user()
353 " .word 16b,4b \n" in raw_copy_from_user()
354 " .word 17b,4b \n" in raw_copy_from_user()
355 " .word 18b,4b \n" in raw_copy_from_user()
386 " ldb.ab %1, [%3, 1] \n" in raw_copy_to_user()
387 "1: stb.ab %1, [%2, 1] \n" in raw_copy_to_user()
388 " sub %0, %0, 1 \n" in raw_copy_to_user()
391 " .align 4 \n" in raw_copy_to_user()
392 "4: j 3b \n" in raw_copy_to_user()
395 " .align 4 \n" in raw_copy_to_user()
396 " .word 1b, 4b \n" in raw_copy_to_user()
418 " lsr lp_count, %7,4 \n" in raw_copy_to_user()
420 " ld.ab %3, [%2, 4] \n" in raw_copy_to_user()
421 " ld.ab %4, [%2, 4] \n" in raw_copy_to_user()
422 " ld.ab %5, [%2, 4] \n" in raw_copy_to_user()
423 " ld.ab %6, [%2, 4] \n" in raw_copy_to_user()
424 "1: st.ab %3, [%1, 4] \n" in raw_copy_to_user()
425 "11: st.ab %4, [%1, 4] \n" in raw_copy_to_user()
426 "12: st.ab %5, [%1, 4] \n" in raw_copy_to_user()
427 "13: st.ab %6, [%1, 4] \n" in raw_copy_to_user()
431 " .align 4 \n" in raw_copy_to_user()
432 "4: j 3b \n" in raw_copy_to_user()
435 " .align 4 \n" in raw_copy_to_user()
436 " .word 1b, 4b \n" in raw_copy_to_user()
437 " .word 11b,4b \n" in raw_copy_to_user()
438 " .word 12b,4b \n" in raw_copy_to_user()
439 " .word 13b,4b \n" in raw_copy_to_user()
450 " ld.ab %3, [%2,4] \n" in raw_copy_to_user()
451 " ld.ab %4, [%2,4] \n" in raw_copy_to_user()
452 "14: st.ab %3, [%1,4] \n" in raw_copy_to_user()
453 "15: st.ab %4, [%1,4] \n" in raw_copy_to_user()
457 " .align 4 \n" in raw_copy_to_user()
458 "4: j 31b \n" in raw_copy_to_user()
461 " .align 4 \n" in raw_copy_to_user()
462 " .word 14b,4b \n" in raw_copy_to_user()
463 " .word 15b,4b \n" in raw_copy_to_user()
470 if (orig_n / 4) { in raw_copy_to_user()
471 orig_n = orig_n % 4; in raw_copy_to_user()
474 " ld.ab %3, [%2,4] \n" in raw_copy_to_user()
475 "16: st.ab %3, [%1,4] \n" in raw_copy_to_user()
476 " sub %0, %0, 4 \n" in raw_copy_to_user()
479 " .align 4 \n" in raw_copy_to_user()
480 "4: j 32b \n" in raw_copy_to_user()
483 " .align 4 \n" in raw_copy_to_user()
484 " .word 16b,4b \n" in raw_copy_to_user()
495 "17: stw.ab %3, [%1,2] \n" in raw_copy_to_user()
499 " .align 4 \n" in raw_copy_to_user()
500 "4: j 33b \n" in raw_copy_to_user()
503 " .align 4 \n" in raw_copy_to_user()
504 " .word 17b,4b \n" in raw_copy_to_user()
510 if (orig_n & 1) { in raw_copy_to_user()
512 " ldb.ab %3, [%2,1] \n" in raw_copy_to_user()
513 "18: stb.ab %3, [%1,1] \n" in raw_copy_to_user()
514 " sub %0, %0, 1 \n" in raw_copy_to_user()
517 " .align 4 \n" in raw_copy_to_user()
518 "4: j 34b \n" in raw_copy_to_user()
521 " .align 4 \n" in raw_copy_to_user()
522 " .word 18b,4b \n" in raw_copy_to_user()
528 } else { /* n is NOT constant, so laddered copy of 16x,8,4,2,1 */ in raw_copy_to_user()
532 " lsr.f lp_count, %3,4 \n" /* 16x bytes */ in raw_copy_to_user()
534 " ld.ab %5, [%2, 4] \n" in raw_copy_to_user()
535 " ld.ab %6, [%2, 4] \n" in raw_copy_to_user()
536 " ld.ab %7, [%2, 4] \n" in raw_copy_to_user()
537 " ld.ab %8, [%2, 4] \n" in raw_copy_to_user()
538 "1: st.ab %5, [%1, 4] \n" in raw_copy_to_user()
539 "11: st.ab %6, [%1, 4] \n" in raw_copy_to_user()
540 "12: st.ab %7, [%1, 4] \n" in raw_copy_to_user()
541 "13: st.ab %8, [%1, 4] \n" in raw_copy_to_user()
546 " ld.ab %5, [%2,4] \n" in raw_copy_to_user()
547 " ld.ab %6, [%2,4] \n" in raw_copy_to_user()
548 "14: st.ab %5, [%1,4] \n" in raw_copy_to_user()
549 "15: st.ab %6, [%1,4] \n" in raw_copy_to_user()
551 "31: bbit0 %3,2,32f \n" /* 4 bytes left */ in raw_copy_to_user()
552 " ld.ab %5, [%2,4] \n" in raw_copy_to_user()
553 "16: st.ab %5, [%1,4] \n" in raw_copy_to_user()
554 " sub.f %0, %0, 4 \n" in raw_copy_to_user()
555 "32: bbit0 %3,1,33f \n" /* 2 bytes left */ in raw_copy_to_user()
557 "17: stw.ab %5, [%1,2] \n" in raw_copy_to_user()
560 " ldb.ab %5, [%2,1] \n" /* 1 byte left */ in raw_copy_to_user()
561 "18: stb.ab %5, [%1,1] \n" in raw_copy_to_user()
562 " sub.f %0, %0, 1 \n" in raw_copy_to_user()
565 " .align 4 \n" in raw_copy_to_user()
566 "4: j 34b \n" in raw_copy_to_user()
569 " .align 4 \n" in raw_copy_to_user()
570 " .word 1b, 4b \n" in raw_copy_to_user()
571 " .word 11b,4b \n" in raw_copy_to_user()
572 " .word 12b,4b \n" in raw_copy_to_user()
573 " .word 13b,4b \n" in raw_copy_to_user()
574 " .word 14b,4b \n" in raw_copy_to_user()
575 " .word 15b,4b \n" in raw_copy_to_user()
576 " .word 16b,4b \n" in raw_copy_to_user()
577 " .word 17b,4b \n" in raw_copy_to_user()
578 " .word 18b,4b \n" in raw_copy_to_user()
595 " bbit0 %0, 0, 1f \n" in __clear_user()
596 "75: stb.ab %2, [%0,1] \n" in __clear_user()
597 " sub %1, %1, 1 \n" in __clear_user()
598 "1: bbit0 %0, 1, 2f \n" in __clear_user()
600 " sub %1, %1, 2 \n" in __clear_user()
601 "2: asr.f lp_count, %1, 2 \n" in __clear_user()
603 "77: st.ab %2, [%0,4] \n" in __clear_user()
604 " sub %1, %1, 4 \n" in __clear_user()
605 "3: bbit0 %1, 1, 4f \n" in __clear_user()
607 " sub %1, %1, 2 \n" in __clear_user()
608 "4: bbit0 %1, 0, 5f \n" in __clear_user()
609 "79: stb.ab %2, [%0,1] \n" in __clear_user()
610 " sub %1, %1, 1 \n" in __clear_user()
613 " .align 4 \n" in __clear_user()
617 " .align 4 \n" in __clear_user()
636 #include <asm-generic/uaccess.h>