handle b == dst case in andC

This commit is contained in:
Joel Dice 2009-03-14 14:34:44 -06:00
parent 8d9409112c
commit 12640219e6

View File

@ -1091,8 +1091,18 @@ andC(Context* c, unsigned size, Assembler::Constant* a,
} else if ((v32 & 0xFFFF) == 0) {
issue(c, andis(dst->low, b->low, v32 >> 16));
} else {
moveCR(c, 4, a, 4, dst);
andR(c, 4, b, dst, dst);
bool useTemporary = b->low == dst->low;
Assembler::Register tmp(dst->low);
if (useTemporary) {
tmp.low = c->client->acquireTemporary();
}
moveCR(c, 4, a, 4, &tmp);
andR(c, 4, b, &tmp, dst);
if (useTemporary) {
c->client->releaseTemporary(tmp.low);
}
}
return;
}