Lines Matching refs:from
50 ir_reg from; member
56 …int32_t from; /* negative - constant ref, [0..IR_REG_NUM) - CPU reg, [IR_REG_NUM...) - virtual reg… member
477 ir_reg to, from; in ir_parallel_copy() local
483 from = copies[0].from; 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()
501 from = copies[i].from; in ir_parallel_copy()
503 IR_ASSERT(from != to); in ir_parallel_copy()
504 IR_REGSET_INCL(srcs, from); in ir_parallel_copy()
505 loc[from] = from; in ir_parallel_copy()
506 pred[to] = from; in ir_parallel_copy()
507 types[from] = copies[i].type; in ir_parallel_copy()
516 from = copies[i].from; 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()
538 from = pred[to]; in ir_parallel_copy()
539 r = loc[from]; in ir_parallel_copy()
540 type = types[from]; in ir_parallel_copy()
547 loc[from] = to; in ir_parallel_copy()
548 if (from == r && IR_REGSET_IN(todo, from)) { in ir_parallel_copy()
549 IR_REGSET_INCL(ready, from); in ir_parallel_copy()
563 from = pred[to]; in ir_parallel_copy()
564 IR_ASSERT(to != loc[from]); in ir_parallel_copy()
565 type = types[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()
570 IR_REGSET_EXCL(todo, from); in ir_parallel_copy()
571 loc[to] = from; in ir_parallel_copy()
572 loc[from] = to; 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()
584 IR_REGSET_EXCL(todo, from); in ir_parallel_copy()
585 loc[to] = from; in ir_parallel_copy()
586 loc[from] = to; in ir_parallel_copy()
598 from = pred[to]; in ir_parallel_copy()
599 r = loc[from]; in ir_parallel_copy()
600 type = types[from]; in ir_parallel_copy()
607 loc[from] = to; in ir_parallel_copy()
608 if (from == r && IR_REGSET_IN(todo, from)) { 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()
625 if (IR_IS_CONST_REF(from)) { in ir_emit_dessa_move()
626 if (-from < ctx->consts_count) { 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()
633 } else if (from < IR_REG_NUM) { 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()
640 mem_from = ir_vreg_spill_slot(ctx, from - IR_REG_NUM); in ir_emit_dessa_move()
645 if (IR_IS_CONST_REF(from)) { in ir_emit_dessa_move()
646 if (-from < ctx->consts_count) { in ir_emit_dessa_move()
650 && !IR_IS_SYM_CONST(ctx->ir_base[from].op) in ir_emit_dessa_move()
651 && (ir_type_size[type] != 8 || IR_IS_SIGNED_32BIT(ctx->ir_base[from].val.i64))) { in ir_emit_dessa_move()
652 ir_emit_store_mem_imm(ctx, type, mem_to, ctx->ir_base[from].val.i32); in ir_emit_dessa_move()
658 ir_emit_load(ctx, type, tmp, from); in ir_emit_dessa_move()
664 ir_load_local_addr(ctx, tmp_reg, -from - ctx->consts_count); in ir_emit_dessa_move()
667 } else if (from < IR_REG_NUM) { in ir_emit_dessa_move()
668 ir_emit_store_mem(ctx, type, mem_to, from); in ir_emit_dessa_move()
670 mem_from = ir_vreg_spill_slot(ctx, from - IR_REG_NUM); in ir_emit_dessa_move()
682 ir_ref from; in ir_dessa_resolve_cycle() local
688 from = pred[to]; in ir_dessa_resolve_cycle()
689 type = types[from]; in ir_dessa_resolve_cycle()
690 IR_ASSERT(!IR_IS_CONST_REF(from)); in ir_dessa_resolve_cycle()
691 IR_ASSERT(from != to); in ir_dessa_resolve_cycle()
692 IR_ASSERT(loc[from] == from); in ir_dessa_resolve_cycle()
696 if (pred[from] == to && to < IR_REG_NUM && from < IR_REG_NUM) { in ir_dessa_resolve_cycle()
701 ir_emit_swap(ctx, type, to, from); in ir_dessa_resolve_cycle()
702 ir_bitset_excl(todo, from); in ir_dessa_resolve_cycle()
704 loc[to] = from; in ir_dessa_resolve_cycle()
705 loc[from] = to; 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()
722 IR_REGSET_EXCL(todo, from); in ir_dessa_resolve_cycle()
724 loc[to] = from; in ir_dessa_resolve_cycle()
725 loc[from] = to; in ir_dessa_resolve_cycle()
742 from = pred[to]; in ir_dessa_resolve_cycle()
743 r = loc[from]; in ir_dessa_resolve_cycle()
746 if (from == r && ir_bitset_in(todo, from)) { in ir_dessa_resolve_cycle()
761 loc[from] = to; in ir_dessa_resolve_cycle()
762 to = from; 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()
774 loc[from] = to; in ir_dessa_resolve_cycle()
780 int32_t *pred, *loc, to, from; in ir_dessa_parallel_copy() local
788 from = copies[0].from; 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()
803 from = copies[i].from; in ir_dessa_parallel_copy()
805 IR_ASSERT(from != to); in ir_dessa_parallel_copy()
806 if (!IR_IS_CONST_REF(from)) { in ir_dessa_parallel_copy()
807 ir_bitset_incl(srcs, from); in ir_dessa_parallel_copy()
808 loc[from] = from; in ir_dessa_parallel_copy()
810 pred[to] = from; in ir_dessa_parallel_copy()
833 from = pred[to]; in ir_dessa_parallel_copy()
834 if (IR_IS_CONST_REF(from)) { in ir_dessa_parallel_copy()
835 ir_emit_dessa_move(ctx, type, to, from, tmp_reg, tmp_fp_reg); in ir_dessa_parallel_copy()
837 int32_t r = loc[from]; in ir_dessa_parallel_copy()
839 loc[from] = to; in ir_dessa_parallel_copy()
840 if (from == r && ir_bitset_in(todo, from) && from != tmp_reg && from != tmp_fp_reg) { in ir_dessa_parallel_copy()
841 ir_bitset_incl(ready, from); in ir_dessa_parallel_copy()
875 from = pred[to]; in ir_dessa_parallel_copy()
876 if (IR_IS_CONST_REF(from)) { in ir_dessa_parallel_copy()
877 ir_emit_dessa_move(ctx, type, to, from, tmp_reg, tmp_fp_reg); in ir_dessa_parallel_copy()
879 int32_t r = loc[from]; in ir_dessa_parallel_copy()
881 loc[from] = to; in ir_dessa_parallel_copy()
882 if (from == r && ir_bitset_in(todo, from)) { in ir_dessa_parallel_copy()
883 ir_bitset_incl(ready, from); in ir_dessa_parallel_copy()
925 ir_ref from, to; in ir_emit_dessa_moves() local
929 from = input; in ir_emit_dessa_moves()
932 from = -(ctx->consts_count + input); in ir_emit_dessa_moves()
934 from = (src != IR_REG_NONE && !IR_REG_SPILLED(src)) ? in ir_emit_dessa_moves()
939 if (to != from) { in ir_emit_dessa_moves()
941 && from >= IR_REG_NUM in ir_emit_dessa_moves()
942 && IR_MEM_VAL(ir_vreg_spill_slot(ctx, from - IR_REG_NUM)) == in ir_emit_dessa_moves()
949 copies[n].from = from; in ir_emit_dessa_moves()