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 ir_emit_swap(ctx, type, to, from); in ir_parallel_copy()
571 loc[to] = from; in ir_parallel_copy()
572 loc[from] = to; in ir_parallel_copy()
578 ir_emit_mov(ctx, type, tmp_reg, to); in ir_parallel_copy()
579 loc[to] = tmp_reg; in ir_parallel_copy()
582 if (pred[from] == to) { in ir_parallel_copy()
583 ir_emit_swap_fp(ctx, type, to, from); in ir_parallel_copy()
585 loc[to] = from; in ir_parallel_copy()
586 loc[from] = to; in ir_parallel_copy()
592 ir_emit_fp_mov(ctx, type, tmp_fp_reg, to); in ir_parallel_copy()
593 loc[to] = tmp_fp_reg; in ir_parallel_copy()
598 from = pred[to]; in ir_parallel_copy()
602 ir_emit_mov_ext(ctx, type, to, r); in ir_parallel_copy()
604 ir_emit_fp_mov(ctx, type, to, r); in ir_parallel_copy()
606 IR_REGSET_EXCL(todo, to); in ir_parallel_copy()
607 loc[from] = to; in ir_parallel_copy()
609 to = from; in ir_parallel_copy()
619 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
623 IR_ASSERT(from != to); in ir_emit_dessa_move()
624 if (to < IR_REG_NUM) { in ir_emit_dessa_move()
628 ir_emit_load(ctx, type, to, from); in ir_emit_dessa_move()
631 ir_load_local_addr(ctx, to, -from - ctx->consts_count); in ir_emit_dessa_move()
635 ir_emit_mov(ctx, type, to, from); in ir_emit_dessa_move()
637 ir_emit_fp_mov(ctx, type, to, from); in ir_emit_dessa_move()
641 ir_emit_load_mem(ctx, type, to, mem_from); in ir_emit_dessa_move()
644 mem_to = ir_vreg_spill_slot(ctx, to - IR_REG_NUM); in ir_emit_dessa_move()
680 … *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
687 IR_ASSERT(!IR_IS_CONST_REF(to)); in ir_dessa_resolve_cycle()
688 from = pred[to]; in ir_dessa_resolve_cycle()
691 IR_ASSERT(from != to); in ir_dessa_resolve_cycle()
696 if (pred[from] == to && to < IR_REG_NUM && from < IR_REG_NUM) { in ir_dessa_resolve_cycle()
698 if (ir_type_size[types[to]] > ir_type_size[type]) { in ir_dessa_resolve_cycle()
699 type = types[to]; in ir_dessa_resolve_cycle()
701 ir_emit_swap(ctx, type, to, from); in ir_dessa_resolve_cycle()
703 ir_bitset_excl(todo, to); in ir_dessa_resolve_cycle()
704 loc[to] = from; in ir_dessa_resolve_cycle()
705 loc[from] = to; in ir_dessa_resolve_cycle()
711 loc[to] = tmp_reg; in ir_dessa_resolve_cycle()
712 if (to < IR_REG_NUM) { in ir_dessa_resolve_cycle()
713 ir_emit_mov(ctx, type, tmp_reg, to); in ir_dessa_resolve_cycle()
715 ir_emit_load_mem_int(ctx, type, tmp_reg, ir_vreg_spill_slot(ctx, to - IR_REG_NUM)); in ir_dessa_resolve_cycle()
719 if (pred[from] == to && to < IR_REG_NUM && from < IR_REG_NUM && types[to] == type) { in ir_dessa_resolve_cycle()
721 ir_emit_swap_fp(ctx, type, to, from); in ir_dessa_resolve_cycle()
723 IR_REGSET_EXCL(todo, to); in ir_dessa_resolve_cycle()
724 loc[to] = from; in ir_dessa_resolve_cycle()
725 loc[from] = to; in ir_dessa_resolve_cycle()
731 loc[to] = tmp_fp_reg; in ir_dessa_resolve_cycle()
732 if (to < IR_REG_NUM) { in ir_dessa_resolve_cycle()
733 ir_emit_fp_mov(ctx, type, tmp_fp_reg, to); in ir_dessa_resolve_cycle()
735 ir_emit_load_mem_fp(ctx, type, tmp_fp_reg, ir_vreg_spill_slot(ctx, to - IR_REG_NUM)); in ir_dessa_resolve_cycle()
742 from = pred[to]; in ir_dessa_resolve_cycle()
744 type = types[to]; in ir_dessa_resolve_cycle()
748 if (to >= IR_REG_NUM && r >= IR_REG_NUM) { in ir_dessa_resolve_cycle()
756 ir_emit_dessa_move(ctx, type, to, r, tmp_reg, tmp_fp_reg); in ir_dessa_resolve_cycle()
758 ir_emit_dessa_move(ctx, type, to, r, IR_REG_NONE, IR_REG_NONE); in ir_dessa_resolve_cycle()
760 ir_bitset_excl(todo, to); in ir_dessa_resolve_cycle()
761 loc[from] = to; in ir_dessa_resolve_cycle()
762 to = from; in ir_dessa_resolve_cycle()
768 type = types[to]; in ir_dessa_resolve_cycle()
772 ir_emit_dessa_move(ctx, type, to, loc[from], IR_REG_NONE, IR_REG_NONE); in ir_dessa_resolve_cycle()
773 ir_bitset_excl(todo, to); in ir_dessa_resolve_cycle()
774 loc[from] = to; in ir_dessa_resolve_cycle()
780 int32_t *pred, *loc, to, from; in ir_dessa_parallel_copy() local
787 to = copies[0].to; in ir_dessa_parallel_copy()
789 IR_ASSERT(from != to); in ir_dessa_parallel_copy()
791 ir_emit_dessa_move(ctx, type, to, from, tmp_reg, tmp_fp_reg); in ir_dessa_parallel_copy()
804 to = copies[i].to; in ir_dessa_parallel_copy()
805 IR_ASSERT(from != to); in ir_dessa_parallel_copy()
810 pred[to] = from; in ir_dessa_parallel_copy()
811 types[to] = copies[i].type; in ir_dessa_parallel_copy()
812 IR_ASSERT(!ir_bitset_in(todo, to)); in ir_dessa_parallel_copy()
813 ir_bitset_incl(todo, to); in ir_dessa_parallel_copy()
830 while ((to = ir_bitset_pop_first(ready, ir_bitset_len(len))) >= 0) { in ir_dessa_parallel_copy()
831 ir_bitset_excl(todo, to); in ir_dessa_parallel_copy()
832 type = types[to]; in ir_dessa_parallel_copy()
833 from = pred[to]; in ir_dessa_parallel_copy()
835 ir_emit_dessa_move(ctx, type, to, from, tmp_reg, tmp_fp_reg); in ir_dessa_parallel_copy()
838 ir_emit_dessa_move(ctx, type, to, r, tmp_reg, tmp_fp_reg); in ir_dessa_parallel_copy()
839 loc[from] = to; in ir_dessa_parallel_copy()
850 while ((to = ir_bitset_first(ready, ir_bitset_len(len))) >= 0) { in ir_dessa_parallel_copy()
852 ir_bitset_incl(visited, to); in ir_dessa_parallel_copy()
853 to = pred[to]; in ir_dessa_parallel_copy()
854 while (!IR_IS_CONST_REF(to) && ir_bitset_in(ready, to)) { in ir_dessa_parallel_copy()
855 to = pred[to]; in ir_dessa_parallel_copy()
856 if (IR_IS_CONST_REF(to)) { in ir_dessa_parallel_copy()
858 } else if (ir_bitset_in(visited, to)) { in ir_dessa_parallel_copy()
860 ir_bitset_incl(visited, to); in ir_dessa_parallel_copy()
861 ir_dessa_resolve_cycle(ctx, pred, loc, types, todo, to, tmp_reg, tmp_fp_reg); in ir_dessa_parallel_copy()
864 ir_bitset_incl(visited, to); in ir_dessa_parallel_copy()
872 while ((to = ir_bitset_pop_first(ready, ir_bitset_len(len))) >= 0) { in ir_dessa_parallel_copy()
873 ir_bitset_excl(todo, to); in ir_dessa_parallel_copy()
874 type = types[to]; in ir_dessa_parallel_copy()
875 from = pred[to]; in ir_dessa_parallel_copy()
877 ir_emit_dessa_move(ctx, type, to, from, tmp_reg, tmp_fp_reg); in ir_dessa_parallel_copy()
880 ir_emit_dessa_move(ctx, type, to, r, tmp_reg, tmp_fp_reg); in ir_dessa_parallel_copy()
881 loc[from] = to; in ir_dessa_parallel_copy()
925 ir_ref from, to; in ir_emit_dessa_moves() local
937 to = (dst != IR_REG_NONE) ? in ir_emit_dessa_moves()
939 if (to != from) { in ir_emit_dessa_moves()
940 if (to >= IR_REG_NUM in ir_emit_dessa_moves()
943 IR_MEM_VAL(ir_vreg_spill_slot(ctx, to - IR_REG_NUM))) { in ir_emit_dessa_moves()
950 copies[n].to = to; in ir_emit_dessa_moves()