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()
572 ir_emit_swap(ctx, type, to, from); in ir_parallel_copy()
573 IR_REGSET_EXCL(todo, from); in ir_parallel_copy()
574 loc[to] = from; in ir_parallel_copy()
575 loc[from] = to; 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()
587 IR_REGSET_EXCL(todo, from); in ir_parallel_copy()
588 loc[to] = from; in ir_parallel_copy()
589 loc[from] = to; in ir_parallel_copy()
601 from = pred[to]; in ir_parallel_copy()
602 r = loc[from]; in ir_parallel_copy()
603 type = types[from]; in ir_parallel_copy()
610 loc[from] = to; in ir_parallel_copy()
611 if (from == r && IR_REGSET_IN(todo, from)) { 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()
628 if (IR_IS_CONST_REF(from)) { in ir_emit_dessa_move()
629 if (-from < ctx->consts_count) { 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()
636 } else if (from < IR_REG_NUM) { 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()
643 mem_from = ir_vreg_spill_slot(ctx, from - IR_REG_NUM); in ir_emit_dessa_move()
648 if (IR_IS_CONST_REF(from)) { in ir_emit_dessa_move()
649 if (-from < ctx->consts_count) { in ir_emit_dessa_move()
653 && !IR_IS_SYM_CONST(ctx->ir_base[from].op) in ir_emit_dessa_move()
654 && (ir_type_size[type] != 8 || IR_IS_SIGNED_32BIT(ctx->ir_base[from].val.i64))) { in ir_emit_dessa_move()
655 ir_emit_store_mem_imm(ctx, type, mem_to, ctx->ir_base[from].val.i32); in ir_emit_dessa_move()
661 ir_emit_load(ctx, type, tmp, from); in ir_emit_dessa_move()
667 ir_load_local_addr(ctx, tmp_reg, -from - ctx->consts_count); in ir_emit_dessa_move()
670 } else if (from < IR_REG_NUM) { in ir_emit_dessa_move()
671 ir_emit_store_mem(ctx, type, mem_to, from); in ir_emit_dessa_move()
673 mem_from = ir_vreg_spill_slot(ctx, from - IR_REG_NUM); in ir_emit_dessa_move()
685 ir_ref from; in ir_dessa_resolve_cycle() local
691 from = pred[to]; in ir_dessa_resolve_cycle()
692 type = types[from]; in ir_dessa_resolve_cycle()
693 IR_ASSERT(!IR_IS_CONST_REF(from)); in ir_dessa_resolve_cycle()
694 IR_ASSERT(from != to); in ir_dessa_resolve_cycle()
695 IR_ASSERT(loc[from] == from); in ir_dessa_resolve_cycle()
699 if (pred[from] == to && to < IR_REG_NUM && from < IR_REG_NUM) { in ir_dessa_resolve_cycle()
704 ir_emit_swap(ctx, type, to, from); in ir_dessa_resolve_cycle()
705 ir_bitset_excl(todo, from); in ir_dessa_resolve_cycle()
707 loc[to] = from; in ir_dessa_resolve_cycle()
708 loc[from] = to; 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()
725 IR_REGSET_EXCL(todo, from); in ir_dessa_resolve_cycle()
727 loc[to] = from; in ir_dessa_resolve_cycle()
728 loc[from] = to; in ir_dessa_resolve_cycle()
745 from = pred[to]; in ir_dessa_resolve_cycle()
746 r = loc[from]; in ir_dessa_resolve_cycle()
749 if (from == r && ir_bitset_in(todo, from)) { in ir_dessa_resolve_cycle()
764 loc[from] = to; in ir_dessa_resolve_cycle()
765 to = from; 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()
777 loc[from] = to; in ir_dessa_resolve_cycle()
783 int32_t *pred, *loc, to, from; in ir_dessa_parallel_copy() local
791 from = copies[0].from; 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()
806 from = copies[i].from; in ir_dessa_parallel_copy()
808 IR_ASSERT(from != to); in ir_dessa_parallel_copy()
809 if (!IR_IS_CONST_REF(from)) { in ir_dessa_parallel_copy()
810 ir_bitset_incl(srcs, from); in ir_dessa_parallel_copy()
811 loc[from] = from; in ir_dessa_parallel_copy()
813 pred[to] = from; in ir_dessa_parallel_copy()
836 from = pred[to]; in ir_dessa_parallel_copy()
837 if (IR_IS_CONST_REF(from)) { in ir_dessa_parallel_copy()
838 ir_emit_dessa_move(ctx, type, to, from, tmp_reg, tmp_fp_reg); in ir_dessa_parallel_copy()
840 int32_t r = loc[from]; in ir_dessa_parallel_copy()
842 loc[from] = to; in ir_dessa_parallel_copy()
843 if (from == r && ir_bitset_in(todo, from) && from != tmp_reg && from != tmp_fp_reg) { in ir_dessa_parallel_copy()
844 ir_bitset_incl(ready, from); in ir_dessa_parallel_copy()
878 from = pred[to]; in ir_dessa_parallel_copy()
879 if (IR_IS_CONST_REF(from)) { in ir_dessa_parallel_copy()
880 ir_emit_dessa_move(ctx, type, to, from, tmp_reg, tmp_fp_reg); in ir_dessa_parallel_copy()
882 int32_t r = loc[from]; in ir_dessa_parallel_copy()
884 loc[from] = to; in ir_dessa_parallel_copy()
885 if (from == r && ir_bitset_in(todo, from)) { in ir_dessa_parallel_copy()
886 ir_bitset_incl(ready, from); in ir_dessa_parallel_copy()
928 ir_ref from, to; in ir_emit_dessa_moves() local
932 from = input; in ir_emit_dessa_moves()
935 from = -(ctx->consts_count + input); in ir_emit_dessa_moves()
937 from = (src != IR_REG_NONE && !IR_REG_SPILLED(src)) ? in ir_emit_dessa_moves()
942 if (to != from) { in ir_emit_dessa_moves()
944 && from >= IR_REG_NUM in ir_emit_dessa_moves()
945 && IR_MEM_VAL(ir_vreg_spill_slot(ctx, from - IR_REG_NUM)) == in ir_emit_dessa_moves()
952 copies[n].from = from; in ir_emit_dessa_moves()