Просмотр исходного кода

Merge pull request #476 from lioncash/asr

dyncom: Fix 32-bit ASR shifts for immediates
bunnei 11 лет назад
Родитель
Сommit
86e8ff85c9
1 измененных файлов с 3 добавлено и 5 удалено
  1. 3 5
      src/core/arm/dyncom/arm_dyncom_interpreter.cpp

+ 3 - 5
src/core/arm/dyncom/arm_dyncom_interpreter.cpp

@@ -176,13 +176,11 @@ unsigned int DPO(ArithmeticShiftRightByImmediate)(arm_processor *cpu, unsigned i
     unsigned int shifter_operand;
     unsigned int shifter_operand;
     int shift_imm = BITS(sht_oper, 7, 11);
     int shift_imm = BITS(sht_oper, 7, 11);
     if (shift_imm == 0) {
     if (shift_imm == 0) {
-        if (BIT(rm, 31)) {
+        if (BIT(rm, 31) == 0)
             shifter_operand = 0;
             shifter_operand = 0;
-            cpu->shifter_carry_out = BIT(rm, 31);
-        } else {
+        else
             shifter_operand = 0xFFFFFFFF;
             shifter_operand = 0xFFFFFFFF;
-            cpu->shifter_carry_out = BIT(rm, 31);
-        }
+        cpu->shifter_carry_out = BIT(rm, 31);
     } else {
     } else {
         shifter_operand = static_cast<int>(rm) >> shift_imm;
         shifter_operand = static_cast<int>(rm) >> shift_imm;
         cpu->shifter_carry_out = BIT(rm, shift_imm - 1);
         cpu->shifter_carry_out = BIT(rm, shift_imm - 1);