From: <dgr...@us...> - 2008-05-06 19:22:38
|
Revision: 14195 http://jikesrvm.svn.sourceforge.net/jikesrvm/?rev=14195&view=rev Author: dgrove-oss Date: 2008-05-06 12:22:06 -0700 (Tue, 06 May 2008) Log Message: ----------- missing case for REF_NEG operator. Showed up as a missing BURS rule when building bootimage at O0. Modified Paths: -------------- rvmroot/trunk/rvm/src/org/jikesrvm/compilers/opt/Simplifier.java Modified: rvmroot/trunk/rvm/src/org/jikesrvm/compilers/opt/Simplifier.java =================================================================== --- rvmroot/trunk/rvm/src/org/jikesrvm/compilers/opt/Simplifier.java 2008-05-06 17:49:47 UTC (rev 14194) +++ rvmroot/trunk/rvm/src/org/jikesrvm/compilers/opt/Simplifier.java 2008-05-06 19:22:06 UTC (rev 14195) @@ -312,6 +312,9 @@ case REF_SHR_opcode: result = refShr(s); break; + case REF_NEG_opcode: + result = refNeg(s); + break; case REF_NOT_opcode: result = refNot(s); break; @@ -1807,6 +1810,20 @@ return DefUseEffect.UNCHANGED; } + private static DefUseEffect refNeg(Instruction s) { + if (CF_ADDR) { + Operand op = Unary.getVal(s); + if (op.isConstant() && !op.isMovableObjectConstant()) { + // CONSTANT: FOLD + Word val = getAddressValue(op).toWord(); + Word negVal = Word.zero().minus(val); + Move.mutate(s, REF_MOVE, Unary.getClearResult(s), AC(negVal.toAddress())); + return DefUseEffect.MOVE_FOLDED; + } + } + return DefUseEffect.UNCHANGED; + } + private static DefUseEffect refNot(Instruction s) { if (CF_ADDR) { Operand op = Unary.getVal(s); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |