Lines Matching refs:op

1312     int op, total_args, n, i;  in tcg_context_init()  local
1323 for(op = 0; op < NB_OPS; op++) { in tcg_context_init()
1324 def = &tcg_op_defs[op]; in tcg_context_init()
1331 for(op = 0; op < NB_OPS; op++) { in tcg_context_init()
1332 def = &tcg_op_defs[op]; in tcg_context_init()
1947 bool tcg_op_supported(TCGOpcode op) in tcg_op_supported() argument
1952 switch (op) { in tcg_op_supported()
2245 tcg_debug_assert(op > INDEX_op_last_generic && op < NB_OPS); in tcg_op_supported()
2256 TCGOp *op; in tcg_gen_callN() local
2265 op = tcg_op_alloc(INDEX_op_call, total_args); in tcg_gen_callN()
2276 TCGOP_CALLO(op) = n = info->nr_out; in tcg_gen_callN()
2283 op->args[pi++] = temp_arg(ret); in tcg_gen_callN()
2291 op->args[pi++] = temp_arg(ret + i); in tcg_gen_callN()
2298 TCGOP_CALLI(op) = n = info->nr_in; in tcg_gen_callN()
2307 op->args[pi++] = temp_arg(ts); in tcg_gen_callN()
2321 op->args[pi++] = tcgv_i64_arg(temp); in tcg_gen_callN()
2330 op->args[pi++] = (uintptr_t)info->func; in tcg_gen_callN()
2331 op->args[pi++] = (uintptr_t)info; in tcg_gen_callN()
2334 QTAILQ_INSERT_TAIL(&tcg_ctx->ops, op, link); in tcg_gen_callN()
2555 TCGOp *op; in tcg_dump_ops() local
2557 QTAILQ_FOREACH(op, &s->ops, link) { in tcg_dump_ops()
2563 c = op->opc; in tcg_dump_ops()
2572 tcg_get_insn_start_param(op, i)); in tcg_dump_ops()
2575 const TCGHelperInfo *info = tcg_call_info(op); in tcg_dump_ops()
2576 void *func = tcg_call_func(op); in tcg_dump_ops()
2579 nb_oargs = TCGOP_CALLO(op); in tcg_dump_ops()
2580 nb_iargs = TCGOP_CALLI(op); in tcg_dump_ops()
2599 op->args[i])); in tcg_dump_ops()
2602 TCGArg arg = op->args[nb_oargs + i]; in tcg_dump_ops()
2614 col += ne_fprintf(f, "v%d,e%d,", 64 << TCGOP_VECL(op), in tcg_dump_ops()
2615 8 << TCGOP_VECE(op)); in tcg_dump_ops()
2623 op->args[k++])); in tcg_dump_ops()
2629 op->args[k++])); in tcg_dump_ops()
2644 if (op->args[k] < ARRAY_SIZE(cond_name) in tcg_dump_ops()
2645 && cond_name[op->args[k]]) { in tcg_dump_ops()
2646 col += ne_fprintf(f, ",%s", cond_name[op->args[k++]]); in tcg_dump_ops()
2648 col += ne_fprintf(f, ",$0x%" TCG_PRIlx, op->args[k++]); in tcg_dump_ops()
2668 MemOpIdx oi = op->args[k++]; in tcg_dump_ops()
2694 TCGArg flags = op->args[k]; in tcg_dump_ops()
2719 arg_label(op->args[k])->id); in tcg_dump_ops()
2724 TCGBar membar = op->args[k]; in tcg_dump_ops()
2806 op->args[k]); in tcg_dump_ops()
2810 if (have_prefs || op->life) { in tcg_dump_ops()
2816 if (op->life) { in tcg_dump_ops()
2817 unsigned life = op->life; in tcg_dump_ops()
2840 TCGRegSet set = output_pref(op, i); in tcg_dump_ops()
2927 TCGOpcode op; in process_op_defs() local
2929 for (op = 0; op < NB_OPS; op++) { in process_op_defs()
2930 TCGOpDef *def = &tcg_op_defs[op]; in process_op_defs()
2949 unsigned con_set = tcg_target_op_def(op); in process_op_defs()
3132 static void remove_label_use(TCGOp *op, int idx) in remove_label_use() argument
3134 TCGLabel *label = arg_label(op->args[idx]); in remove_label_use()
3138 if (use->op == op) { in remove_label_use()
3146 void tcg_op_remove(TCGContext *s, TCGOp *op) in tcg_op_remove() argument
3148 switch (op->opc) { in tcg_op_remove()
3150 remove_label_use(op, 0); in tcg_op_remove()
3154 remove_label_use(op, 3); in tcg_op_remove()
3157 remove_label_use(op, 5); in tcg_op_remove()
3163 QTAILQ_REMOVE(&s->ops, op, link); in tcg_op_remove()
3164 QTAILQ_INSERT_TAIL(&s->free_ops, op, link); in tcg_op_remove()
3168 void tcg_remove_ops_after(TCGOp *op) in tcg_remove_ops_after() argument
3174 if (last == op) { in tcg_remove_ops_after()
3184 TCGOp *op = NULL; in tcg_op_alloc() local
3187 QTAILQ_FOREACH(op, &s->free_ops, link) { in tcg_op_alloc()
3188 if (nargs <= op->nargs) { in tcg_op_alloc()
3189 QTAILQ_REMOVE(&s->free_ops, op, link); in tcg_op_alloc()
3190 nargs = op->nargs; in tcg_op_alloc()
3198 op = tcg_malloc(sizeof(TCGOp) + sizeof(TCGArg) * nargs); in tcg_op_alloc()
3201 memset(op, 0, offsetof(TCGOp, link)); in tcg_op_alloc()
3202 op->opc = opc; in tcg_op_alloc()
3203 op->nargs = nargs; in tcg_op_alloc()
3206 tcg_debug_assert(op->nargs == nargs); in tcg_op_alloc()
3209 return op; in tcg_op_alloc()
3214 TCGOp *op = tcg_op_alloc(opc, nargs); in tcg_emit_op() local
3215 QTAILQ_INSERT_TAIL(&tcg_ctx->ops, op, link); in tcg_emit_op()
3216 return op; in tcg_emit_op()
3240 TCGOp *op = u->op; in move_label_uses() local
3241 switch (op->opc) { in move_label_uses()
3243 op->args[0] = label_arg(to); in move_label_uses()
3247 op->args[3] = label_arg(to); in move_label_uses()
3250 op->args[5] = label_arg(to); in move_label_uses()
3264 TCGOp *op, *op_next, *op_prev; in reachable_code_pass() local
3267 QTAILQ_FOREACH_SAFE(op, &s->ops, link, op_next) { in reachable_code_pass()
3271 switch (op->opc) { in reachable_code_pass()
3273 label = arg_label(op->args[0]); in reachable_code_pass()
3279 op_prev = QTAILQ_PREV(op, link); in reachable_code_pass()
3290 op_prev = QTAILQ_PREV(op, link); in reachable_code_pass()
3332 if (tcg_call_flags(op) & TCG_CALL_NO_RETURN) { in reachable_code_pass()
3347 tcg_op_remove(s, op); in reachable_code_pass()
3505 TCGOp *op, *ebb; in liveness_pass_0() local
3518 QTAILQ_FOREACH(op, &s->ops, link) { in liveness_pass_0()
3522 switch (op->opc) { in liveness_pass_0()
3524 ebb = op; in liveness_pass_0()
3529 nb_oargs = TCGOP_CALLO(op); in liveness_pass_0()
3530 nb_iargs = TCGOP_CALLI(op); in liveness_pass_0()
3533 def = &tcg_op_defs[op->opc]; in liveness_pass_0()
3540 TCGTemp *ts = arg_temp(op->args[i]); in liveness_pass_0()
3573 TCGOp *op, *op_prev; in liveness_pass_1() local
3585 QTAILQ_FOREACH_REVERSE_SAFE(op, &s->ops, link, op_prev) { in liveness_pass_1()
3591 TCGOpcode opc = op->opc; in liveness_pass_1()
3597 const TCGHelperInfo *info = tcg_call_info(op); in liveness_pass_1()
3598 int call_flags = tcg_call_flags(op); in liveness_pass_1()
3600 nb_oargs = TCGOP_CALLO(op); in liveness_pass_1()
3601 nb_iargs = TCGOP_CALLI(op); in liveness_pass_1()
3606 ts = arg_temp(op->args[i]); in liveness_pass_1()
3617 ts = arg_temp(op->args[i]); in liveness_pass_1()
3629 memset(op->output_pref, 0, sizeof(op->output_pref)); in liveness_pass_1()
3640 ts = arg_temp(op->args[i]); in liveness_pass_1()
3661 ts = arg_temp(op->args[nb_oargs + i]); in liveness_pass_1()
3689 ts = arg_temp(op->args[nb_oargs + i]); in liveness_pass_1()
3710 ts = arg_temp(op->args[0]); in liveness_pass_1()
3733 if (arg_temp(op->args[1])->state == TS_DEAD) { in liveness_pass_1()
3734 if (arg_temp(op->args[0])->state == TS_DEAD) { in liveness_pass_1()
3739 op->opc = opc = opc_new; in liveness_pass_1()
3740 op->args[1] = op->args[2]; in liveness_pass_1()
3741 op->args[2] = op->args[4]; in liveness_pass_1()
3771 if (arg_temp(op->args[1])->state == TS_DEAD) { in liveness_pass_1()
3772 if (arg_temp(op->args[0])->state == TS_DEAD) { in liveness_pass_1()
3777 op->opc = opc = opc_new; in liveness_pass_1()
3778 op->args[1] = op->args[2]; in liveness_pass_1()
3779 op->args[2] = op->args[3]; in liveness_pass_1()
3780 } else if (arg_temp(op->args[0])->state == TS_DEAD && have_opc_new2) { in liveness_pass_1()
3782 op->opc = opc = opc_new2; in liveness_pass_1()
3783 op->args[0] = op->args[1]; in liveness_pass_1()
3784 op->args[1] = op->args[2]; in liveness_pass_1()
3785 op->args[2] = op->args[3]; in liveness_pass_1()
3803 if (arg_temp(op->args[i])->state != TS_DEAD) { in liveness_pass_1()
3812 tcg_op_remove(s, op); in liveness_pass_1()
3817 ts = arg_temp(op->args[i]); in liveness_pass_1()
3820 if (i < ARRAY_SIZE(op->output_pref)) { in liveness_pass_1()
3821 op->output_pref[i] = *la_temp_pref(ts); in liveness_pass_1()
3851 ts = arg_temp(op->args[i]); in liveness_pass_1()
3859 ts = arg_temp(op->args[i]); in liveness_pass_1()
3876 *la_temp_pref(arg_temp(op->args[0])) in liveness_pass_1()
3877 = *la_temp_pref(arg_temp(op->args[1])); in liveness_pass_1()
3886 ts = arg_temp(op->args[i]); in liveness_pass_1()
3892 set &= output_pref(op, ct->alias_index); in liveness_pass_1()
3904 op->life = arg_life; in liveness_pass_1()
3915 TCGOp *op, *op_next; in liveness_pass_2() local
3939 QTAILQ_FOREACH_SAFE(op, &s->ops, link, op_next) { in liveness_pass_2()
3940 TCGOpcode opc = op->opc; in liveness_pass_2()
3942 TCGLifeData arg_life = op->life; in liveness_pass_2()
3947 nb_oargs = TCGOP_CALLO(op); in liveness_pass_2()
3948 nb_iargs = TCGOP_CALLI(op); in liveness_pass_2()
3949 call_flags = tcg_call_flags(op); in liveness_pass_2()
3973 arg_ts = arg_temp(op->args[i]); in liveness_pass_2()
3979 TCGOp *lop = tcg_op_insert_before(s, op, lopc, 3); in liveness_pass_2()
3994 arg_ts = arg_temp(op->args[i]); in liveness_pass_2()
3997 op->args[i] = temp_arg(dir_ts); in liveness_pass_2()
4029 arg_ts = arg_temp(op->args[0]); in liveness_pass_2()
4032 op->args[0] = temp_arg(dir_ts); in liveness_pass_2()
4042 TCGOp *sop = tcg_op_insert_after(s, op, sopc, 3); in liveness_pass_2()
4046 out_ts = arg_temp(op->args[1]); in liveness_pass_2()
4048 tcg_op_remove(s, op); in liveness_pass_2()
4062 arg_ts = arg_temp(op->args[i]); in liveness_pass_2()
4067 op->args[i] = temp_arg(dir_ts); in liveness_pass_2()
4078 TCGOp *sop = tcg_op_insert_after(s, op, sopc, 3); in liveness_pass_2()
4566 static void tcg_reg_alloc_mov(TCGContext *s, const TCGOp *op) in tcg_reg_alloc_mov() argument
4568 const TCGLifeData arg_life = op->life; in tcg_reg_alloc_mov()
4575 preferred_regs = output_pref(op, 0); in tcg_reg_alloc_mov()
4576 ots = arg_temp(op->args[0]); in tcg_reg_alloc_mov()
4577 ts = arg_temp(op->args[1]); in tcg_reg_alloc_mov()
4666 static void tcg_reg_alloc_dup(TCGContext *s, const TCGOp *op) in tcg_reg_alloc_dup() argument
4668 const TCGLifeData arg_life = op->life; in tcg_reg_alloc_dup()
4676 ots = arg_temp(op->args[0]); in tcg_reg_alloc_dup()
4677 its = arg_temp(op->args[1]); in tcg_reg_alloc_dup()
4683 vece = TCGOP_VECE(op); in tcg_reg_alloc_dup()
4684 vtype = TCGOP_VECL(op) + TCG_TYPE_V64; in tcg_reg_alloc_dup()
4692 tcg_reg_alloc_do_movi(s, ots, val, arg_life, output_pref(op, 0)); in tcg_reg_alloc_dup()
4709 output_pref(op, 0), ots->indirect_base); in tcg_reg_alloc_dup()
4774 static void tcg_reg_alloc_op(TCGContext *s, const TCGOp *op) in tcg_reg_alloc_op() argument
4776 const TCGLifeData arg_life = op->life; in tcg_reg_alloc_op()
4777 const TCGOpDef * const def = &tcg_op_defs[op->opc]; in tcg_reg_alloc_op()
4793 op->args + nb_oargs + nb_iargs, in tcg_reg_alloc_op()
4807 arg = op->args[i]; in tcg_reg_alloc_op()
4812 && tcg_target_const_match(ts->val, ts->type, arg_ct->ct, TCGOP_VECE(op))) { in tcg_reg_alloc_op()
4828 i_preferred_regs = output_pref(op, arg_ct->alias_index); in tcg_reg_alloc_op()
4871 ts2 = i1 != i2 ? arg_temp(op->args[i2]) : NULL; in tcg_reg_alloc_op()
4878 i_preferred_regs = output_pref(op, arg_ct->alias_index); in tcg_reg_alloc_op()
4914 i_preferred_regs = output_pref(op, arg_ct->alias_index); in tcg_reg_alloc_op()
4998 temp_dead(s, arg_temp(op->args[i])); in tcg_reg_alloc_op()
5024 arg = op->args[i]; in tcg_reg_alloc_op()
5038 output_pref(op, k), ts->indirect_base); in tcg_reg_alloc_op()
5041 output_pref(op, k), ts->indirect_base); in tcg_reg_alloc_op()
5051 output_pref(op, k), in tcg_reg_alloc_op()
5055 output_pref(op, k), in tcg_reg_alloc_op()
5084 switch (op->opc) { in tcg_reg_alloc_op()
5122 tcg_out_vec_op(s, op->opc, TCGOP_VECL(op), TCGOP_VECE(op), in tcg_reg_alloc_op()
5125 tcg_out_op(s, op->opc, new_args, const_args); in tcg_reg_alloc_op()
5132 ts = arg_temp(op->args[i]); in tcg_reg_alloc_op()
5145 static bool tcg_reg_alloc_dup2(TCGContext *s, const TCGOp *op) in tcg_reg_alloc_dup2() argument
5147 const TCGLifeData arg_life = op->life; in tcg_reg_alloc_dup2()
5149 TCGType vtype = TCGOP_VECL(op) + TCG_TYPE_V64; in tcg_reg_alloc_dup2()
5153 tcg_debug_assert(TCGOP_VECE(op) == MO_64); in tcg_reg_alloc_dup2()
5155 ots = arg_temp(op->args[0]); in tcg_reg_alloc_dup2()
5156 itsl = arg_temp(op->args[1]); in tcg_reg_alloc_dup2()
5157 itsh = arg_temp(op->args[2]); in tcg_reg_alloc_dup2()
5178 output_pref(op, 0), ots->indirect_base); in tcg_reg_alloc_dup2()
5302 static void tcg_reg_alloc_call(TCGContext *s, TCGOp *op) in tcg_reg_alloc_call() argument
5304 const int nb_oargs = TCGOP_CALLO(op); in tcg_reg_alloc_call()
5305 const int nb_iargs = TCGOP_CALLI(op); in tcg_reg_alloc_call()
5306 const TCGLifeData arg_life = op->life; in tcg_reg_alloc_call()
5307 const TCGHelperInfo *info = tcg_call_info(op); in tcg_reg_alloc_call()
5317 TCGTemp *ts = arg_temp(op->args[nb_oargs + i]); in tcg_reg_alloc_call()
5342 temp_dead(s, arg_temp(op->args[i])); in tcg_reg_alloc_call()
5370 TCGTemp *ts = arg_temp(op->args[0]); in tcg_reg_alloc_call()
5378 tcg_out_call(s, tcg_call_func(op), info); in tcg_reg_alloc_call()
5384 TCGTemp *ts = arg_temp(op->args[i]); in tcg_reg_alloc_call()
5397 TCGTemp *ts = arg_temp(op->args[0]); in tcg_reg_alloc_call()
5413 TCGTemp *ts = arg_temp(op->args[i]); in tcg_reg_alloc_call()
5424 TCGTemp *ts = arg_temp(op->args[i]); in tcg_reg_alloc_call()
6036 TCGOp *op; in tcg_gen_code() local
6132 QTAILQ_FOREACH(op, &s->ops, link) { in tcg_gen_code()
6133 TCGOpcode opc = op->opc; in tcg_gen_code()
6139 tcg_reg_alloc_mov(s, op); in tcg_gen_code()
6142 tcg_reg_alloc_dup(s, op); in tcg_gen_code()
6154 tcg_get_insn_start_param(op, i); in tcg_gen_code()
6158 temp_dead(s, arg_temp(op->args[0])); in tcg_gen_code()
6162 tcg_out_label(s, arg_label(op->args[0])); in tcg_gen_code()
6165 tcg_reg_alloc_call(s, op); in tcg_gen_code()
6168 tcg_out_exit_tb(s, op->args[0]); in tcg_gen_code()
6171 tcg_out_goto_tb(s, op->args[0]); in tcg_gen_code()
6174 if (tcg_reg_alloc_dup2(s, op)) { in tcg_gen_code()
6184 tcg_reg_alloc_op(s, op); in tcg_gen_code()