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

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

Issue 1445603002: PPC: Fix simulation of floating point <-> integer conversion. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ppc/simulator-ppc.cc
diff --git a/src/ppc/simulator-ppc.cc b/src/ppc/simulator-ppc.cc
index ce0c77af3ed17813c5a62879938e60b616f23258..2707343ed5a8fee78551457ddad62be71201dddf 100644
--- a/src/ppc/simulator-ppc.cc
+++ b/src/ppc/simulator-ppc.cc
@@ -2702,9 +2702,8 @@ void Simulator::ExecuteExt3(Instruction* instr) {
// fcfids
int frt = instr->RTValue();
int frb = instr->RBValue();
- double t_val = get_double_from_d_register(frb);
- int64_t* frb_val_p = reinterpret_cast<int64_t*>(&t_val);
- double frt_val = static_cast<float>(*frb_val_p);
+ int64_t frb_val = get_d_register(frb);
+ double frt_val = static_cast<float>(frb_val);
set_d_register_from_double(frt, frt_val);
return;
}
@@ -2886,18 +2885,16 @@ void Simulator::ExecuteExt4(Instruction* instr) {
case FCFID: {
int frt = instr->RTValue();
int frb = instr->RBValue();
- double t_val = get_double_from_d_register(frb);
- int64_t* frb_val_p = reinterpret_cast<int64_t*>(&t_val);
- double frt_val = static_cast<double>(*frb_val_p);
+ int64_t frb_val = get_d_register(frb);
+ double frt_val = static_cast<double>(frb_val);
set_d_register_from_double(frt, frt_val);
return;
}
case FCFIDU: {
int frt = instr->RTValue();
int frb = instr->RBValue();
- double t_val = get_double_from_d_register(frb);
- uint64_t* frb_val_p = reinterpret_cast<uint64_t*>(&t_val);
- double frt_val = static_cast<double>(*frb_val_p);
+ uint64_t frb_val = get_d_register(frb);
+ double frt_val = static_cast<double>(frb_val);
set_d_register_from_double(frt, frt_val);
return;
}
@@ -2931,8 +2928,7 @@ void Simulator::ExecuteExt4(Instruction* instr) {
break;
}
}
- double* p = reinterpret_cast<double*>(&frt_val);
- set_d_register_from_double(frt, *p);
+ set_d_register(frt, frt_val);
return;
}
case FCTIDZ: {
@@ -2951,8 +2947,7 @@ void Simulator::ExecuteExt4(Instruction* instr) {
} else {
frt_val = (int64_t)frb_val;
}
- double* p = reinterpret_cast<double*>(&frt_val);
- set_d_register_from_double(frt, *p);
+ set_d_register(frt, frt_val);
return;
}
case FCTIW:
@@ -2996,8 +2991,7 @@ void Simulator::ExecuteExt4(Instruction* instr) {
}
}
}
- double* p = reinterpret_cast<double*>(&frt_val);
- set_d_register_from_double(frt, *p);
+ set_d_register(frt, frt_val);
return;
}
case FNEG: {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698