From 296c93a04c02c2000352de297d7cf0c0464c10b3 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Wed, 4 Mar 2009 17:54:47 -0700 Subject: [PATCH] fix backwards logic in longCompare; correct unsupported use of JumpIfLessOrEqualC in shiftRightR; add multiply, divide, and remainder operations to table --- src/powerpc.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/powerpc.cpp b/src/powerpc.cpp index 92446d4fc7..daeb2e6c88 100644 --- a/src/powerpc.cpp +++ b/src/powerpc.cpp @@ -431,8 +431,6 @@ void shiftLeftC(Context* con, unsigned size, Const* a, Reg* b, Reg* t) issue(con, slwi(R(t), R(b), sh)); } -void jumpIfLessOrEqualC(Context* c, unsigned size UNUSED, Assembler::Constant* target); - void shiftRightR(Context* con, unsigned size, Reg* a, Reg* b, Reg* t) { if(size == 8) { @@ -443,9 +441,7 @@ void shiftRightR(Context* con, unsigned size, Reg* a, Reg* b, Reg* t) issue(con, or_(R(t), R(t), R(tmp))); issue(con, addic(H(tmp), R(a), -32)); issue(con, sraw(R(tmp), H(b), H(tmp))); - ResolvedPromise prom(8); - Const offset(&prom); - jumpIfLessOrEqualC(con, 0, &offset); + issue(con, ble(8)); issue(con, ori(R(t), R(tmp), 0)); issue(con, sraw(H(t), H(b), R(a))); freeTemp(con, H(tmp)); freeTemp(con, R(tmp)); @@ -1277,7 +1273,7 @@ longCompare(Context* c, Assembler::Operand* al, Assembler::Operand* ah, (c->code.data + c->code.length())); updateOffset - (c->s, c->code.data + above, true, reinterpret_cast + (c->s, c->code.data + below, true, reinterpret_cast (c->code.data + c->code.length())); moveCR(c, 4, &negative, 4, dst); @@ -1290,7 +1286,7 @@ longCompare(Context* c, Assembler::Operand* al, Assembler::Operand* ah, (c->code.data + c->code.length())); updateOffset - (c->s, c->code.data + below, true, reinterpret_cast + (c->s, c->code.data + above, true, reinterpret_cast (c->code.data + c->code.length())); moveCR(c, 4, &positive, 4, dst); @@ -1566,6 +1562,13 @@ populateTables(ArchitectureContext* c) to[index(Subtract, R)] = CAST3(subR); to[index(Subtract, C)] = CAST3(subC); + to[index(Multiply, R)] = CAST3(multiplyR); + to[index(Multiply, C)] = CAST3(multiplyC); + + to[index(Divide, R)] = CAST3(divideR); + + to[index(Remainder, R)] = CAST3(remainderR); + to[index(ShiftLeft, R)] = CAST3(shiftLeftR); to[index(ShiftLeft, C)] = CAST3(shiftLeftC);