Index: runtime/vm/simulator_mips.cc |
diff --git a/runtime/vm/simulator_mips.cc b/runtime/vm/simulator_mips.cc |
index 074fc8c7eb08767fc0c15e7e28f2cb713887b23d..a828752d6f87918e65f116d65887a11ad867bedb 100644 |
--- a/runtime/vm/simulator_mips.cc |
+++ b/runtime/vm/simulator_mips.cc |
@@ -1888,24 +1888,18 @@ void Simulator::DecodeCop1(Instr* instr) { |
(fs_val <= ft_val) || isnan(fs_val) || isnan(ft_val)); |
break; |
} |
- case COP1_CVT_D: { |
+ case COP1_TRUNC_W: { |
switch (instr->FormatField()) { |
- case FMT_W: { |
- int32_t fs_int = get_fregister(instr->FsField()); |
- double fs_dbl = static_cast<double>(fs_int); |
- set_fregister_double(instr->FdField(), fs_dbl); |
- break; |
- } |
- case FMT_S: { |
- float fs_flt = get_fregister_float(instr->FsField()); |
- double fs_dbl = static_cast<double>(fs_flt); |
- set_fregister_double(instr->FdField(), fs_dbl); |
- break; |
- } |
- case FMT_L: { |
- int64_t fs_int = get_fregister_long(instr->FsField()); |
- double fs_dbl = static_cast<double>(fs_int); |
- set_fregister_double(instr->FdField(), fs_dbl); |
+ case FMT_D: { |
+ double fs_dbl = get_fregister_double(instr->FsField()); |
+ int32_t fs_int; |
+ if (isnan(fs_dbl) || isinf(fs_dbl) || (fs_dbl > kMaxInt32) || |
+ (fs_dbl < kMinInt32)) { |
+ fs_int = kMaxInt32; |
+ } else { |
+ fs_int = static_cast<int32_t>(fs_dbl); |
+ } |
+ set_fregister(instr->FdField(), fs_int); |
break; |
} |
default: { |
@@ -1916,18 +1910,18 @@ void Simulator::DecodeCop1(Instr* instr) { |
} |
break; |
} |
- case COP1_CVT_W: { |
+ case COP1_CVT_D: { |
switch (instr->FormatField()) { |
- case FMT_D: { |
- double fs_dbl = get_fregister_double(instr->FsField()); |
- int32_t fs_int; |
- if (isnan(fs_dbl) || isinf(fs_dbl) || (fs_dbl > INT_MAX) || |
- (fs_dbl < INT_MIN)) { |
- fs_int = INT_MIN; |
- } else { |
- fs_int = static_cast<int32_t>(fs_dbl); |
- } |
- set_fregister(instr->FdField(), fs_int); |
+ case FMT_W: { |
+ int32_t fs_int = get_fregister(instr->FsField()); |
+ double fs_dbl = static_cast<double>(fs_int); |
+ set_fregister_double(instr->FdField(), fs_dbl); |
+ break; |
+ } |
+ case FMT_S: { |
+ float fs_flt = get_fregister_float(instr->FsField()); |
+ double fs_dbl = static_cast<double>(fs_flt); |
+ set_fregister_double(instr->FdField(), fs_dbl); |
break; |
} |
default: { |