Index: src/mips/simulator-mips.cc |
diff --git a/src/mips/simulator-mips.cc b/src/mips/simulator-mips.cc |
index bd423996d81a87ae48f3b17df7840fe62a854727..7ff3d144e7a019ff35ccc427ebc8788789e03557 100644 |
--- a/src/mips/simulator-mips.cc |
+++ b/src/mips/simulator-mips.cc |
@@ -2537,11 +2537,11 @@ void Simulator::DecodeTypeRegisterDRsType() { |
break; |
case MADDF_D: |
DCHECK(IsMipsArchVariant(kMips32r6)); |
- set_fpu_register_double(fd_reg(), fd + (fs * ft)); |
+ set_fpu_register_double(fd_reg(), std::fma(fs, ft, fd)); |
break; |
case MSUBF_D: |
DCHECK(IsMipsArchVariant(kMips32r6)); |
- set_fpu_register_double(fd_reg(), fd - (fs * ft)); |
+ set_fpu_register_double(fd_reg(), std::fma(-fs, ft, fd)); |
break; |
case MUL_D: |
set_fpu_register_double( |
@@ -2964,11 +2964,11 @@ void Simulator::DecodeTypeRegisterSRsType() { |
break; |
case MADDF_S: |
DCHECK(IsMipsArchVariant(kMips32r6)); |
- set_fpu_register_float(fd_reg(), fd + (fs * ft)); |
+ set_fpu_register_float(fd_reg(), std::fma(fs, ft, fd)); |
break; |
case MSUBF_S: |
DCHECK(IsMipsArchVariant(kMips32r6)); |
- set_fpu_register_float(fd_reg(), fd - (fs * ft)); |
+ set_fpu_register_float(fd_reg(), std::fma(-fs, ft, fd)); |
break; |
case MUL_S: |
set_fpu_register_float( |