Index: src/mips64/simulator-mips64.cc |
diff --git a/src/mips64/simulator-mips64.cc b/src/mips64/simulator-mips64.cc |
index 4a8e0076d9d3094cc5524fb50d06f7b79541579d..591ddaf3a107b7dd537e5e6527cf47b7121c738c 100644 |
--- a/src/mips64/simulator-mips64.cc |
+++ b/src/mips64/simulator-mips64.cc |
@@ -2475,11 +2475,11 @@ void Simulator::DecodeTypeRegisterSRsType() { |
break; |
case MADDF_S: |
DCHECK(kArchVariant == kMips64r6); |
- 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(kArchVariant == kMips64r6); |
- 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( |
@@ -2901,11 +2901,11 @@ void Simulator::DecodeTypeRegisterDRsType() { |
break; |
case MADDF_D: |
DCHECK(kArchVariant == kMips64r6); |
- 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(kArchVariant == kMips64r6); |
- 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( |