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

Unified Diff: src/IceInstMIPS32.cpp

Issue 2316933002: [SubZero] Implement GP to/from FP moves for MIPS (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Rebase to master 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 | « no previous file | src/IceRegistersMIPS32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInstMIPS32.cpp
diff --git a/src/IceInstMIPS32.cpp b/src/IceInstMIPS32.cpp
index c25fbe1ca8a63ce1ebebf0f2ce868c7b4f11cd1f..85cf07b560ca4a2a2e2209b0937469c26ee62035 100644
--- a/src/IceInstMIPS32.cpp
+++ b/src/IceInstMIPS32.cpp
@@ -733,27 +733,39 @@ void InstMIPS32Mov::emitSingleDestSingleSource(const Cfg *Func) const {
// reg to reg
if (DestIsReg && SrcIsReg) {
- switch (Dest->getType()) {
- case IceType_f32:
- ActualOpcode = "mov.s";
- break;
- case IceType_f64:
- ActualOpcode = "mov.d";
- break;
- case IceType_i1:
- case IceType_i8:
- case IceType_i16:
- case IceType_i32:
- Str << "\t"
- << "move"
- << "\t";
- getDest()->emit(Func);
- Str << ", ";
- getSrc(0)->emit(Func);
- return;
- default:
- UnimplementedError(getFlags());
- return;
+ const Type DstType = Dest->getType();
+ const Type SrcType = Src->getType();
+
+ // move GP to/from FP
+ if (DstType != SrcType) {
+ if (isScalarFloatingType(DstType)) {
+ Str << "\t"
+ "mtc1"
+ "\t";
+ getSrc(0)->emit(Func);
+ Str << ", ";
+ getDest()->emit(Func);
+ return;
+ }
+ ActualOpcode = "mfc1";
+ } else {
+ switch (Dest->getType()) {
+ case IceType_f32:
+ ActualOpcode = "mov.s";
+ break;
+ case IceType_f64:
+ ActualOpcode = "mov.d";
+ break;
+ case IceType_i1:
+ case IceType_i8:
+ case IceType_i16:
+ case IceType_i32:
+ ActualOpcode = "move";
+ break;
+ default:
+ UnimplementedError(getFlags());
+ return;
+ }
}
assert(ActualOpcode);
« no previous file with comments | « no previous file | src/IceRegistersMIPS32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698