Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(563)

Unified Diff: src/mips64/simulator-mips64.cc

Issue 2313623002: MIPS: Implement MADD.S, MSUB, MADDF and MSUBF. (Closed)
Patch Set: Added blocks and unreachable sections. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips64/disasm-mips64.cc ('k') | test/cctest/test-assembler-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips64/simulator-mips64.cc
diff --git a/src/mips64/simulator-mips64.cc b/src/mips64/simulator-mips64.cc
index 780c90c16b5ef87a3e3a8c92664267482cd25a02..662b873965d4d9bc5294d0cce33e8f6c0d8cb217 100644
--- a/src/mips64/simulator-mips64.cc
+++ b/src/mips64/simulator-mips64.cc
@@ -2421,6 +2421,14 @@ void Simulator::DecodeTypeRegisterSRsType() {
case SUB_S:
set_fpu_register_float(fd_reg(), fs - ft);
break;
+ case MADDF_S:
+ DCHECK(kArchVariant == kMips64r6);
+ set_fpu_register_float(fd_reg(), fd + (fs * ft));
+ break;
+ case MSUBF_S:
+ DCHECK(kArchVariant == kMips64r6);
+ set_fpu_register_float(fd_reg(), fd - (fs * ft));
+ break;
case MUL_S:
set_fpu_register_float(fd_reg(), fs * ft);
break;
@@ -2824,6 +2832,14 @@ void Simulator::DecodeTypeRegisterDRsType() {
case SUB_D:
set_fpu_register_double(fd_reg(), fs - ft);
break;
+ case MADDF_D:
+ DCHECK(kArchVariant == kMips64r6);
+ set_fpu_register_double(fd_reg(), fd + (fs * ft));
+ break;
+ case MSUBF_D:
+ DCHECK(kArchVariant == kMips64r6);
+ set_fpu_register_double(fd_reg(), fd - (fs * ft));
+ break;
case MUL_D:
set_fpu_register_double(fd_reg(), fs * ft);
break;
@@ -3305,13 +3321,42 @@ void Simulator::DecodeTypeRegisterCOP1() {
void Simulator::DecodeTypeRegisterCOP1X() {
switch (get_instr()->FunctionFieldRaw()) {
- case MADD_D:
+ case MADD_S: {
+ DCHECK(kArchVariant == kMips64r2);
+ float fr, ft, fs;
+ fr = get_fpu_register_float(fr_reg());
+ fs = get_fpu_register_float(fs_reg());
+ ft = get_fpu_register_float(ft_reg());
+ set_fpu_register_float(fd_reg(), fs * ft + fr);
+ break;
+ }
+ case MSUB_S: {
+ DCHECK(kArchVariant == kMips64r2);
+ float fr, ft, fs;
+ fr = get_fpu_register_float(fr_reg());
+ fs = get_fpu_register_float(fs_reg());
+ ft = get_fpu_register_float(ft_reg());
+ set_fpu_register_float(fd_reg(), fs * ft - fr);
+ break;
+ }
+ case MADD_D: {
+ DCHECK(kArchVariant == kMips64r2);
double fr, ft, fs;
fr = get_fpu_register_double(fr_reg());
fs = get_fpu_register_double(fs_reg());
ft = get_fpu_register_double(ft_reg());
set_fpu_register_double(fd_reg(), fs * ft + fr);
break;
+ }
+ case MSUB_D: {
+ DCHECK(kArchVariant == kMips64r2);
+ double fr, ft, fs;
+ fr = get_fpu_register_double(fr_reg());
+ fs = get_fpu_register_double(fs_reg());
+ ft = get_fpu_register_double(ft_reg());
+ set_fpu_register_double(fd_reg(), fs * ft - fr);
+ break;
+ }
default:
UNREACHABLE();
}
« no previous file with comments | « src/mips64/disasm-mips64.cc ('k') | test/cctest/test-assembler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698