Skip to content

Commit

Permalink
imcc codegen - reuse temp register
Browse files Browse the repository at this point in the history
* a user opcode <op> Nx, Iy, Iy created two temps for the I registers
  now reuse the temporary Nz (1 less ins and 1 less temp)


git-svn-id: https://svn.parrot.org/parrot/trunk@11670 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
Leopold Toetsch committed Feb 19, 2006
1 parent a6e2bd3 commit cb2ae56
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions compilers/imcc/parser_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,12 @@ try_find_op(Parrot_Interp interpreter, IMC_Unit * unit, char *name,
}
if (n == 3 && r[0]->set == 'N') {
if (r[1]->set == 'I') {
SymReg *r1 = r[1];
changed |= change_op(interpreter, unit, r, 1, emit);
/* op Nx, Iy, Iy: reuse generated temp Nz */
if (r[2]->set == 'I' && r[2]->type != VTADDRESS &&
r[2] == r1)
r[2] = r[1];
}
if (r[2]->set == 'I' && r[2]->type != VTADDRESS) {
changed |= change_op(interpreter, unit, r, 2, emit);
Expand Down

0 comments on commit cb2ae56

Please sign in to comment.