Lines Matching refs:to

51 	ir_reg  to;  member
57 int32_t to; /* [0..IR_REG_NUM) - CPU reg, [IR_REG_NUM...) - virtual reg */ member
477 ir_reg to, from; in ir_parallel_copy() local
482 to = copies[0].to; in ir_parallel_copy()
484 IR_ASSERT(from != to); in ir_parallel_copy()
487 ir_emit_mov(ctx, type, to, from); in ir_parallel_copy()
489 ir_emit_fp_mov(ctx, type, to, from); in ir_parallel_copy()
502 to = copies[i].to; in ir_parallel_copy()
503 IR_ASSERT(from != to); in ir_parallel_copy()
506 pred[to] = from; in ir_parallel_copy()
508 IR_ASSERT(!IR_REGSET_IN(todo, to)); in ir_parallel_copy()
509 IR_REGSET_INCL(todo, to); in ir_parallel_copy()
517 to = copies[i].to; in ir_parallel_copy()
518 IR_ASSERT(from != to); in ir_parallel_copy()
521 ir_emit_mov(ctx, type, to, from); in ir_parallel_copy()
523 ir_emit_fp_mov(ctx, type, to, from); in ir_parallel_copy()
537 to = ir_regset_pop_first(&ready); in ir_parallel_copy()
538 from = pred[to]; in ir_parallel_copy()
542 ir_emit_mov_ext(ctx, type, to, r); in ir_parallel_copy()
544 ir_emit_fp_mov(ctx, type, to, r); in ir_parallel_copy()
546 IR_REGSET_EXCL(todo, to); in ir_parallel_copy()
547 loc[from] = to; in ir_parallel_copy()
562 to = ir_regset_pop_first(&todo); in ir_parallel_copy()
563 from = pred[to]; in ir_parallel_copy()
564 IR_ASSERT(to != loc[from]); in ir_parallel_copy()
568 if (pred[from] == to) { in ir_parallel_copy()
569 if (ir_type_size[types[to]] > ir_type_size[type]) { in ir_parallel_copy()
570 type = types[to]; in ir_parallel_copy()
572 ir_emit_swap(ctx, type, to, from); in ir_parallel_copy()
574 loc[to] = from; in ir_parallel_copy()
575 loc[from] = to; in ir_parallel_copy()
581 ir_emit_mov(ctx, type, tmp_reg, to); in ir_parallel_copy()
582 loc[to] = tmp_reg; in ir_parallel_copy()
585 if (pred[from] == to && types[to] == type) { in ir_parallel_copy()
586 ir_emit_swap_fp(ctx, type, to, from); in ir_parallel_copy()
588 loc[to] = from; in ir_parallel_copy()
589 loc[from] = to; in ir_parallel_copy()
595 ir_emit_fp_mov(ctx, type, tmp_fp_reg, to); in ir_parallel_copy()
596 loc[to] = tmp_fp_reg; in ir_parallel_copy()
601 from = pred[to]; in ir_parallel_copy()
605 ir_emit_mov_ext(ctx, type, to, r); in ir_parallel_copy()
607 ir_emit_fp_mov(ctx, type, to, r); in ir_parallel_copy()
609 IR_REGSET_EXCL(todo, to); in ir_parallel_copy()
610 loc[from] = to; in ir_parallel_copy()
612 to = from; in ir_parallel_copy()
622 static void ir_emit_dessa_move(ir_ctx *ctx, ir_type type, ir_ref to, ir_ref from, ir_reg tmp_reg, i… in ir_emit_dessa_move() argument
626 IR_ASSERT(from != to); in ir_emit_dessa_move()
627 if (to < IR_REG_NUM) { in ir_emit_dessa_move()
631 ir_emit_load(ctx, type, to, from); in ir_emit_dessa_move()
634 ir_load_local_addr(ctx, to, -from - ctx->consts_count); in ir_emit_dessa_move()
638 ir_emit_mov(ctx, type, to, from); in ir_emit_dessa_move()
640 ir_emit_fp_mov(ctx, type, to, from); in ir_emit_dessa_move()
644 ir_emit_load_mem(ctx, type, to, mem_from); in ir_emit_dessa_move()
647 mem_to = ir_vreg_spill_slot(ctx, to - IR_REG_NUM); in ir_emit_dessa_move()
683 … *ctx, int32_t *pred, int32_t *loc, int8_t *types, ir_bitset todo, int32_t to, ir_reg tmp_reg, ir_… in ir_dessa_resolve_cycle() argument
690 IR_ASSERT(!IR_IS_CONST_REF(to)); in ir_dessa_resolve_cycle()
691 from = pred[to]; in ir_dessa_resolve_cycle()
694 IR_ASSERT(from != to); in ir_dessa_resolve_cycle()
699 if (pred[from] == to && to < IR_REG_NUM && from < IR_REG_NUM) { in ir_dessa_resolve_cycle()
701 if (ir_type_size[types[to]] > ir_type_size[type]) { in ir_dessa_resolve_cycle()
702 type = types[to]; in ir_dessa_resolve_cycle()
704 ir_emit_swap(ctx, type, to, from); in ir_dessa_resolve_cycle()
706 ir_bitset_excl(todo, to); in ir_dessa_resolve_cycle()
707 loc[to] = from; in ir_dessa_resolve_cycle()
708 loc[from] = to; in ir_dessa_resolve_cycle()
714 loc[to] = tmp_reg; in ir_dessa_resolve_cycle()
715 if (to < IR_REG_NUM) { in ir_dessa_resolve_cycle()
716 ir_emit_mov(ctx, type, tmp_reg, to); in ir_dessa_resolve_cycle()
718 ir_emit_load_mem_int(ctx, type, tmp_reg, ir_vreg_spill_slot(ctx, to - IR_REG_NUM)); in ir_dessa_resolve_cycle()
722 if (pred[from] == to && to < IR_REG_NUM && from < IR_REG_NUM && types[to] == type) { in ir_dessa_resolve_cycle()
724 ir_emit_swap_fp(ctx, type, to, from); in ir_dessa_resolve_cycle()
726 IR_REGSET_EXCL(todo, to); in ir_dessa_resolve_cycle()
727 loc[to] = from; in ir_dessa_resolve_cycle()
728 loc[from] = to; in ir_dessa_resolve_cycle()
734 loc[to] = tmp_fp_reg; in ir_dessa_resolve_cycle()
735 if (to < IR_REG_NUM) { in ir_dessa_resolve_cycle()
736 ir_emit_fp_mov(ctx, type, tmp_fp_reg, to); in ir_dessa_resolve_cycle()
738 ir_emit_load_mem_fp(ctx, type, tmp_fp_reg, ir_vreg_spill_slot(ctx, to - IR_REG_NUM)); in ir_dessa_resolve_cycle()
745 from = pred[to]; in ir_dessa_resolve_cycle()
747 type = types[to]; in ir_dessa_resolve_cycle()
751 if (to >= IR_REG_NUM && r >= IR_REG_NUM) { in ir_dessa_resolve_cycle()
759 ir_emit_dessa_move(ctx, type, to, r, tmp_reg, tmp_fp_reg); in ir_dessa_resolve_cycle()
761 ir_emit_dessa_move(ctx, type, to, r, IR_REG_NONE, IR_REG_NONE); in ir_dessa_resolve_cycle()
763 ir_bitset_excl(todo, to); in ir_dessa_resolve_cycle()
764 loc[from] = to; in ir_dessa_resolve_cycle()
765 to = from; in ir_dessa_resolve_cycle()
771 type = types[to]; in ir_dessa_resolve_cycle()
775 ir_emit_dessa_move(ctx, type, to, loc[from], IR_REG_NONE, IR_REG_NONE); in ir_dessa_resolve_cycle()
776 ir_bitset_excl(todo, to); in ir_dessa_resolve_cycle()
777 loc[from] = to; in ir_dessa_resolve_cycle()
783 int32_t *pred, *loc, to, from; in ir_dessa_parallel_copy() local
790 to = copies[0].to; in ir_dessa_parallel_copy()
792 IR_ASSERT(from != to); in ir_dessa_parallel_copy()
794 ir_emit_dessa_move(ctx, type, to, from, tmp_reg, tmp_fp_reg); in ir_dessa_parallel_copy()
807 to = copies[i].to; in ir_dessa_parallel_copy()
808 IR_ASSERT(from != to); in ir_dessa_parallel_copy()
813 pred[to] = from; in ir_dessa_parallel_copy()
814 types[to] = copies[i].type; in ir_dessa_parallel_copy()
815 IR_ASSERT(!ir_bitset_in(todo, to)); in ir_dessa_parallel_copy()
816 ir_bitset_incl(todo, to); in ir_dessa_parallel_copy()
833 while ((to = ir_bitset_pop_first(ready, ir_bitset_len(len))) >= 0) { in ir_dessa_parallel_copy()
834 ir_bitset_excl(todo, to); in ir_dessa_parallel_copy()
835 type = types[to]; in ir_dessa_parallel_copy()
836 from = pred[to]; in ir_dessa_parallel_copy()
838 ir_emit_dessa_move(ctx, type, to, from, tmp_reg, tmp_fp_reg); in ir_dessa_parallel_copy()
841 ir_emit_dessa_move(ctx, type, to, r, tmp_reg, tmp_fp_reg); in ir_dessa_parallel_copy()
842 loc[from] = to; in ir_dessa_parallel_copy()
853 while ((to = ir_bitset_first(ready, ir_bitset_len(len))) >= 0) { in ir_dessa_parallel_copy()
855 ir_bitset_incl(visited, to); in ir_dessa_parallel_copy()
856 to = pred[to]; in ir_dessa_parallel_copy()
857 while (!IR_IS_CONST_REF(to) && ir_bitset_in(ready, to)) { in ir_dessa_parallel_copy()
858 to = pred[to]; in ir_dessa_parallel_copy()
859 if (IR_IS_CONST_REF(to)) { in ir_dessa_parallel_copy()
861 } else if (ir_bitset_in(visited, to)) { in ir_dessa_parallel_copy()
863 ir_bitset_incl(visited, to); in ir_dessa_parallel_copy()
864 ir_dessa_resolve_cycle(ctx, pred, loc, types, todo, to, tmp_reg, tmp_fp_reg); in ir_dessa_parallel_copy()
867 ir_bitset_incl(visited, to); in ir_dessa_parallel_copy()
875 while ((to = ir_bitset_pop_first(ready, ir_bitset_len(len))) >= 0) { in ir_dessa_parallel_copy()
876 ir_bitset_excl(todo, to); in ir_dessa_parallel_copy()
877 type = types[to]; in ir_dessa_parallel_copy()
878 from = pred[to]; in ir_dessa_parallel_copy()
880 ir_emit_dessa_move(ctx, type, to, from, tmp_reg, tmp_fp_reg); in ir_dessa_parallel_copy()
883 ir_emit_dessa_move(ctx, type, to, r, tmp_reg, tmp_fp_reg); in ir_dessa_parallel_copy()
884 loc[from] = to; in ir_dessa_parallel_copy()
928 ir_ref from, to; in ir_emit_dessa_moves() local
940 to = (dst != IR_REG_NONE) ? in ir_emit_dessa_moves()
942 if (to != from) { in ir_emit_dessa_moves()
943 if (to >= IR_REG_NUM in ir_emit_dessa_moves()
946 IR_MEM_VAL(ir_vreg_spill_slot(ctx, to - IR_REG_NUM))) { in ir_emit_dessa_moves()
953 copies[n].to = to; in ir_emit_dessa_moves()