Revision b80bb016 tcg/optimize.c
b/tcg/optimize.c | ||
---|---|---|
106 | 106 |
} |
107 | 107 |
} |
108 | 108 |
|
109 |
static void tcg_opt_gen_mov(TCGArg *gen_args, TCGArg dst, TCGArg src,
|
|
110 |
int nb_temps, int nb_globals)
|
|
109 |
static void tcg_opt_gen_mov(TCGContext *s, TCGArg *gen_args,
|
|
110 |
TCGArg dst, TCGArg src)
|
|
111 | 111 |
{ |
112 |
reset_temp(dst, nb_temps, nb_globals);
|
|
112 |
reset_temp(dst, s->nb_temps, s->nb_globals);
|
|
113 | 113 |
assert(temps[src].state != TCG_TEMP_COPY); |
114 |
if (src >= nb_globals) { |
|
114 |
/* Only consider temps with the same type (width) as copies. */ |
|
115 |
if (src >= s->nb_globals && s->temps[dst].type == s->temps[src].type) { |
|
115 | 116 |
assert(temps[src].state != TCG_TEMP_CONST); |
116 | 117 |
if (temps[src].state != TCG_TEMP_HAS_COPY) { |
117 | 118 |
temps[src].state = TCG_TEMP_HAS_COPY; |
... | ... | |
461 | 462 |
gen_opc_buf[op_index] = INDEX_op_nop; |
462 | 463 |
} else { |
463 | 464 |
gen_opc_buf[op_index] = op_to_mov(op); |
464 |
tcg_opt_gen_mov(gen_args, args[0], args[1], |
|
465 |
nb_temps, nb_globals); |
|
465 |
tcg_opt_gen_mov(s, gen_args, args[0], args[1]); |
|
466 | 466 |
gen_args += 2; |
467 | 467 |
} |
468 | 468 |
args += 3; |
... | ... | |
499 | 499 |
gen_opc_buf[op_index] = INDEX_op_nop; |
500 | 500 |
} else { |
501 | 501 |
gen_opc_buf[op_index] = op_to_mov(op); |
502 |
tcg_opt_gen_mov(gen_args, args[0], args[1], nb_temps, |
|
503 |
nb_globals); |
|
502 |
tcg_opt_gen_mov(s, gen_args, args[0], args[1]); |
|
504 | 503 |
gen_args += 2; |
505 | 504 |
} |
506 | 505 |
args += 3; |
... | ... | |
524 | 523 |
break; |
525 | 524 |
} |
526 | 525 |
if (temps[args[1]].state != TCG_TEMP_CONST) { |
527 |
tcg_opt_gen_mov(gen_args, args[0], args[1], |
|
528 |
nb_temps, nb_globals); |
|
526 |
tcg_opt_gen_mov(s, gen_args, args[0], args[1]); |
|
529 | 527 |
gen_args += 2; |
530 | 528 |
args += 2; |
531 | 529 |
break; |
Also available in: Unified diff