Lines Matching full:off
91 pg_addiu(u32 **buf, unsigned int reg1, unsigned int reg2, unsigned int off) in pg_addiu() argument
96 if (off > 0x7fff) { in pg_addiu()
97 uasm_i_lui(buf, GPR_T9, uasm_rel_hi(off)); in pg_addiu()
98 uasm_i_addiu(buf, GPR_T9, GPR_T9, uasm_rel_lo(off)); in pg_addiu()
100 uasm_i_addiu(buf, GPR_T9, GPR_ZERO, off); in pg_addiu()
103 if (off > 0x7fff) { in pg_addiu()
104 uasm_i_lui(buf, GPR_T9, uasm_rel_hi(off)); in pg_addiu()
105 uasm_i_addiu(buf, GPR_T9, GPR_T9, uasm_rel_lo(off)); in pg_addiu()
108 UASM_i_ADDIU(buf, reg1, reg2, off); in pg_addiu()
221 static void build_clear_store(u32 **buf, int off) in build_clear_store() argument
224 uasm_i_sd(buf, GPR_ZERO, off, GPR_A0); in build_clear_store()
226 uasm_i_sw(buf, GPR_ZERO, off, GPR_A0); in build_clear_store()
230 static inline void build_clear_pref(u32 **buf, int off) in build_clear_pref() argument
232 if (off & cache_line_mask()) in build_clear_pref()
236 _uasm_i_pref(buf, pref_dst_mode, pref_bias_clear_store + off, in build_clear_pref()
240 uasm_i_cache(buf, Create_Dirty_Excl_SD, off, GPR_A0); in build_clear_pref()
254 uasm_i_cache(buf, Create_Dirty_Excl_D, off, GPR_A0); in build_clear_pref()
266 int off; in build_clear_page() local
290 off = PAGE_SIZE - pref_bias_clear_store; in build_clear_page()
291 if (off > 0xffff || !pref_bias_clear_store) in build_clear_page()
292 pg_addiu(&buf, GPR_A2, GPR_A0, off); in build_clear_page()
294 uasm_i_ori(&buf, GPR_A2, GPR_A0, off); in build_clear_page()
299 off = cache_line_size ? min(8, pref_bias_clear_store / cache_line_size) in build_clear_page()
301 while (off) { in build_clear_page()
302 build_clear_pref(&buf, -off); in build_clear_page()
303 off -= cache_line_size; in build_clear_page()
307 build_clear_pref(&buf, off); in build_clear_page()
308 build_clear_store(&buf, off); in build_clear_page()
309 off += clear_word_size; in build_clear_page()
310 } while (off < half_clear_loop_size); in build_clear_page()
311 pg_addiu(&buf, GPR_A0, GPR_A0, 2 * off); in build_clear_page()
312 off = -off; in build_clear_page()
314 build_clear_pref(&buf, off); in build_clear_page()
315 if (off == -clear_word_size) in build_clear_page()
317 build_clear_store(&buf, off); in build_clear_page()
318 off += clear_word_size; in build_clear_page()
319 } while (off < 0); in build_clear_page()
324 off = 0; in build_clear_page()
326 build_clear_store(&buf, off); in build_clear_page()
327 off += clear_word_size; in build_clear_page()
328 } while (off < half_clear_loop_size); in build_clear_page()
329 pg_addiu(&buf, GPR_A0, GPR_A0, 2 * off); in build_clear_page()
330 off = -off; in build_clear_page()
332 if (off == -clear_word_size) in build_clear_page()
335 build_clear_store(&buf, off); in build_clear_page()
336 off += clear_word_size; in build_clear_page()
337 } while (off < 0); in build_clear_page()
357 static void build_copy_load(u32 **buf, int reg, int off) in build_copy_load() argument
360 uasm_i_ld(buf, reg, off, GPR_A1); in build_copy_load()
362 uasm_i_lw(buf, reg, off, GPR_A1); in build_copy_load()
366 static void build_copy_store(u32 **buf, int reg, int off) in build_copy_store() argument
369 uasm_i_sd(buf, reg, off, GPR_A0); in build_copy_store()
371 uasm_i_sw(buf, reg, off, GPR_A0); in build_copy_store()
375 static inline void build_copy_load_pref(u32 **buf, int off) in build_copy_load_pref() argument
377 if (off & cache_line_mask()) in build_copy_load_pref()
381 _uasm_i_pref(buf, pref_src_mode, pref_bias_copy_load + off, GPR_A1); in build_copy_load_pref()
384 static inline void build_copy_store_pref(u32 **buf, int off) in build_copy_store_pref() argument
386 if (off & cache_line_mask()) in build_copy_store_pref()
390 _uasm_i_pref(buf, pref_dst_mode, pref_bias_copy_store + off, in build_copy_store_pref()
394 uasm_i_cache(buf, Create_Dirty_Excl_SD, off, GPR_A0); in build_copy_store_pref()
408 uasm_i_cache(buf, Create_Dirty_Excl_D, off, GPR_A0); in build_copy_store_pref()
415 int off; in build_copy_page() local
443 off = PAGE_SIZE - pref_bias_copy_load; in build_copy_page()
444 if (off > 0xffff || !pref_bias_copy_load) in build_copy_page()
445 pg_addiu(&buf, GPR_A2, GPR_A0, off); in build_copy_page()
447 uasm_i_ori(&buf, GPR_A2, GPR_A0, off); in build_copy_page()
452 off = cache_line_size ? min(8, pref_bias_copy_load / cache_line_size) * in build_copy_page()
454 while (off) { in build_copy_page()
455 build_copy_load_pref(&buf, -off); in build_copy_page()
456 off -= cache_line_size; in build_copy_page()
458 off = cache_line_size ? min(8, pref_bias_copy_store / cache_line_size) * in build_copy_page()
460 while (off) { in build_copy_page()
461 build_copy_store_pref(&buf, -off); in build_copy_page()
462 off -= cache_line_size; in build_copy_page()
466 build_copy_load_pref(&buf, off); in build_copy_page()
467 build_copy_load(&buf, GPR_T0, off); in build_copy_page()
468 build_copy_load_pref(&buf, off + copy_word_size); in build_copy_page()
469 build_copy_load(&buf, GPR_T1, off + copy_word_size); in build_copy_page()
470 build_copy_load_pref(&buf, off + 2 * copy_word_size); in build_copy_page()
471 build_copy_load(&buf, GPR_T2, off + 2 * copy_word_size); in build_copy_page()
472 build_copy_load_pref(&buf, off + 3 * copy_word_size); in build_copy_page()
473 build_copy_load(&buf, GPR_T3, off + 3 * copy_word_size); in build_copy_page()
474 build_copy_store_pref(&buf, off); in build_copy_page()
475 build_copy_store(&buf, GPR_T0, off); in build_copy_page()
476 build_copy_store_pref(&buf, off + copy_word_size); in build_copy_page()
477 build_copy_store(&buf, GPR_T1, off + copy_word_size); in build_copy_page()
478 build_copy_store_pref(&buf, off + 2 * copy_word_size); in build_copy_page()
479 build_copy_store(&buf, GPR_T2, off + 2 * copy_word_size); in build_copy_page()
480 build_copy_store_pref(&buf, off + 3 * copy_word_size); in build_copy_page()
481 build_copy_store(&buf, GPR_T3, off + 3 * copy_word_size); in build_copy_page()
482 off += 4 * copy_word_size; in build_copy_page()
483 } while (off < half_copy_loop_size); in build_copy_page()
484 pg_addiu(&buf, GPR_A1, GPR_A1, 2 * off); in build_copy_page()
485 pg_addiu(&buf, GPR_A0, GPR_A0, 2 * off); in build_copy_page()
486 off = -off; in build_copy_page()
488 build_copy_load_pref(&buf, off); in build_copy_page()
489 build_copy_load(&buf, GPR_T0, off); in build_copy_page()
490 build_copy_load_pref(&buf, off + copy_word_size); in build_copy_page()
491 build_copy_load(&buf, GPR_T1, off + copy_word_size); in build_copy_page()
492 build_copy_load_pref(&buf, off + 2 * copy_word_size); in build_copy_page()
493 build_copy_load(&buf, GPR_T2, off + 2 * copy_word_size); in build_copy_page()
494 build_copy_load_pref(&buf, off + 3 * copy_word_size); in build_copy_page()
495 build_copy_load(&buf, GPR_T3, off + 3 * copy_word_size); in build_copy_page()
496 build_copy_store_pref(&buf, off); in build_copy_page()
497 build_copy_store(&buf, GPR_T0, off); in build_copy_page()
498 build_copy_store_pref(&buf, off + copy_word_size); in build_copy_page()
499 build_copy_store(&buf, GPR_T1, off + copy_word_size); in build_copy_page()
500 build_copy_store_pref(&buf, off + 2 * copy_word_size); in build_copy_page()
501 build_copy_store(&buf, GPR_T2, off + 2 * copy_word_size); in build_copy_page()
502 build_copy_store_pref(&buf, off + 3 * copy_word_size); in build_copy_page()
503 if (off == -(4 * copy_word_size)) in build_copy_page()
505 build_copy_store(&buf, GPR_T3, off + 3 * copy_word_size); in build_copy_page()
506 off += 4 * copy_word_size; in build_copy_page()
507 } while (off < 0); in build_copy_page()
513 off = 0; in build_copy_page()
515 build_copy_load(&buf, GPR_T0, off); in build_copy_page()
516 build_copy_load(&buf, GPR_T1, off + copy_word_size); in build_copy_page()
517 build_copy_load(&buf, GPR_T2, off + 2 * copy_word_size); in build_copy_page()
518 build_copy_load(&buf, GPR_T3, off + 3 * copy_word_size); in build_copy_page()
519 build_copy_store_pref(&buf, off); in build_copy_page()
520 build_copy_store(&buf, GPR_T0, off); in build_copy_page()
521 build_copy_store_pref(&buf, off + copy_word_size); in build_copy_page()
522 build_copy_store(&buf, GPR_T1, off + copy_word_size); in build_copy_page()
523 build_copy_store_pref(&buf, off + 2 * copy_word_size); in build_copy_page()
524 build_copy_store(&buf, GPR_T2, off + 2 * copy_word_size); in build_copy_page()
525 build_copy_store_pref(&buf, off + 3 * copy_word_size); in build_copy_page()
526 build_copy_store(&buf, GPR_T3, off + 3 * copy_word_size); in build_copy_page()
527 off += 4 * copy_word_size; in build_copy_page()
528 } while (off < half_copy_loop_size); in build_copy_page()
529 pg_addiu(&buf, GPR_A1, GPR_A1, 2 * off); in build_copy_page()
530 pg_addiu(&buf, GPR_A0, GPR_A0, 2 * off); in build_copy_page()
531 off = -off; in build_copy_page()
533 build_copy_load(&buf, GPR_T0, off); in build_copy_page()
534 build_copy_load(&buf, GPR_T1, off + copy_word_size); in build_copy_page()
535 build_copy_load(&buf, GPR_T2, off + 2 * copy_word_size); in build_copy_page()
536 build_copy_load(&buf, GPR_T3, off + 3 * copy_word_size); in build_copy_page()
537 build_copy_store_pref(&buf, off); in build_copy_page()
538 build_copy_store(&buf, GPR_T0, off); in build_copy_page()
539 build_copy_store_pref(&buf, off + copy_word_size); in build_copy_page()
540 build_copy_store(&buf, GPR_T1, off + copy_word_size); in build_copy_page()
541 build_copy_store_pref(&buf, off + 2 * copy_word_size); in build_copy_page()
542 build_copy_store(&buf, GPR_T2, off + 2 * copy_word_size); in build_copy_page()
543 build_copy_store_pref(&buf, off + 3 * copy_word_size); in build_copy_page()
544 if (off == -(4 * copy_word_size)) in build_copy_page()
547 build_copy_store(&buf, GPR_T3, off + 3 * copy_word_size); in build_copy_page()
548 off += 4 * copy_word_size; in build_copy_page()
549 } while (off < 0); in build_copy_page()
555 off = 0; in build_copy_page()
557 build_copy_load(&buf, GPR_T0, off); in build_copy_page()
558 build_copy_load(&buf, GPR_T1, off + copy_word_size); in build_copy_page()
559 build_copy_load(&buf, GPR_T2, off + 2 * copy_word_size); in build_copy_page()
560 build_copy_load(&buf, GPR_T3, off + 3 * copy_word_size); in build_copy_page()
561 build_copy_store(&buf, GPR_T0, off); in build_copy_page()
562 build_copy_store(&buf, GPR_T1, off + copy_word_size); in build_copy_page()
563 build_copy_store(&buf, GPR_T2, off + 2 * copy_word_size); in build_copy_page()
564 build_copy_store(&buf, GPR_T3, off + 3 * copy_word_size); in build_copy_page()
565 off += 4 * copy_word_size; in build_copy_page()
566 } while (off < half_copy_loop_size); in build_copy_page()
567 pg_addiu(&buf, GPR_A1, GPR_A1, 2 * off); in build_copy_page()
568 pg_addiu(&buf, GPR_A0, GPR_A0, 2 * off); in build_copy_page()
569 off = -off; in build_copy_page()
571 build_copy_load(&buf, GPR_T0, off); in build_copy_page()
572 build_copy_load(&buf, GPR_T1, off + copy_word_size); in build_copy_page()
573 build_copy_load(&buf, GPR_T2, off + 2 * copy_word_size); in build_copy_page()
574 build_copy_load(&buf, GPR_T3, off + 3 * copy_word_size); in build_copy_page()
575 build_copy_store(&buf, GPR_T0, off); in build_copy_page()
576 build_copy_store(&buf, GPR_T1, off + copy_word_size); in build_copy_page()
577 build_copy_store(&buf, GPR_T2, off + 2 * copy_word_size); in build_copy_page()
578 if (off == -(4 * copy_word_size)) in build_copy_page()
581 build_copy_store(&buf, GPR_T3, off + 3 * copy_word_size); in build_copy_page()
582 off += 4 * copy_word_size; in build_copy_page()
583 } while (off < 0); in build_copy_page()