Index: src/mips/simulator-mips.cc |
diff --git a/src/mips/simulator-mips.cc b/src/mips/simulator-mips.cc |
index f0d55d938f65552e69fa107f79a78c69f00eb4f5..4c4b1a374f449c8692241d29c0d91a1899100713 100644 |
--- a/src/mips/simulator-mips.cc |
+++ b/src/mips/simulator-mips.cc |
@@ -3406,7 +3406,11 @@ void Simulator::DecodeTypeRegisterCOP1() { |
set_register(rt_reg(), get_fpu_register_word(fs_reg())); |
break; |
case MFHC1: |
- set_register(rt_reg(), get_fpu_register_hi_word(fs_reg())); |
+ if (IsFp64Mode()) { |
+ set_register(rt_reg(), get_fpu_register_hi_word(fs_reg())); |
+ } else { |
+ set_register(rt_reg(), get_fpu_register_word(fs_reg() + 1)); |
+ } |
break; |
case CTC1: { |
// At the moment only FCSR is supported. |
@@ -3426,7 +3430,11 @@ void Simulator::DecodeTypeRegisterCOP1() { |
set_fpu_register_word(fs_reg(), registers_[rt_reg()]); |
break; |
case MTHC1: |
- set_fpu_register_hi_word(fs_reg(), registers_[rt_reg()]); |
+ if (IsFp64Mode()) { |
+ set_fpu_register_hi_word(fs_reg(), registers_[rt_reg()]); |
+ } else { |
+ set_fpu_register_word(fs_reg() + 1, registers_[rt_reg()]); |
+ } |
break; |
case S: { |
DecodeTypeRegisterSRsType(); |