From: <mic...@us...> - 2007-05-02 18:23:53
|
Revision: 101 http://svn.sourceforge.net/pearcolator/?rev=101&view=rev Author: michael_baer Date: 2007-05-02 11:23:53 -0700 (Wed, 02 May 2007) Log Message: ----------- - Fixed bug in RRE - Reduced evaluation of barrel-shifter even further - Small javadoc correction Modified Paths: -------------- src/org/binarytranslator/arch/arm/decoder/ARM_Interpreter.java Modified: src/org/binarytranslator/arch/arm/decoder/ARM_Interpreter.java =================================================================== --- src/org/binarytranslator/arch/arm/decoder/ARM_Interpreter.java 2007-04-30 18:00:12 UTC (rev 100) +++ src/org/binarytranslator/arch/arm/decoder/ARM_Interpreter.java 2007-05-02 18:23:53 UTC (rev 101) @@ -166,7 +166,7 @@ if (regs.isCarrySet()) return (value >> 1) | 0x80000000; else - return value >> 1; + return value >>> 1; default: throw new RuntimeException("Unexpected shift type: " @@ -321,7 +321,7 @@ if (regs.isCarrySet()) return (value >> 1) | 0x80000000; else - return value >> 1; + return value >>> 1; default: throw new RuntimeException("Unexpected shift type: " @@ -509,11 +509,18 @@ } /** If the given OperandWrapper involves shifting a register, then this function will decoder the shift - * and set the result of the barrel shifter accordingly. */ + * and set the result of the barrel shifter accordingly. However, the shifter carry out is only calculated, when + * the condition codes are to be modified by this function (because otherwise it won't be used anyway).*/ protected int resolveOperand2() { - ResolvedOperand operand = ResolvedOperand.resolveWithShifterCarryOut(regs, operand2); - shifterCarryOut = operand.getShifterCarryOut(); - return operand.getValue(); + + if (updateConditionCodes) { + ResolvedOperand operand = ResolvedOperand.resolveWithShifterCarryOut(regs, operand2); + shifterCarryOut = operand.getShifterCarryOut(); + return operand.getValue(); + } + else { + return super.resolveOperand2(); + } } /** Sets the condition field for logical operations. */ @@ -801,7 +808,7 @@ } /** Move and negate. Moves an integer between two registers, negating it on the way. - * <code>Rd = -op2</code>.*/ + * <code>Rd = ~op2</code>.*/ private final class DataProcessing_Mvn extends DataProcessing_Logical { protected DataProcessing_Mvn(int instr) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |