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

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: 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') | src/IceTargetLoweringMIPS32.cpp » ('J')
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 e7485b915457732924a7a0ed388ee088e7fef2f8..65c831d0ddfdd8d6f6a53e027a7eb92c954d10ef 100644
--- a/src/IceInstMIPS32.cpp
+++ b/src/IceInstMIPS32.cpp
@@ -713,27 +713,40 @@ 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) == true) {
Jim Stichnoth 2016/09/07 15:39:31 remove the redundant "== true"
jaydeep.patil 2016/09/13 06:18:36 Done.
+ Str << "\t"
+ "mtc1"
+ "\t";
+ getSrc(0)->emit(Func);
+ Str << ", ";
+ getDest()->emit(Func);
+ return;
+ } else {
Jim Stichnoth 2016/09/07 15:39:31 http://llvm.org/docs/CodingStandards.html#don-t-us
jaydeep.patil 2016/09/13 06:18:36 Done.
+ 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";
obucinac 2016/09/08 09:52:01 As adviced earlier by Simon Dardis, we should use
jaydeep.patil 2016/09/13 06:18:36 This change should be done in AssemblerMIPS32::mov
+ break;
+ default:
+ UnimplementedError(getFlags());
+ return;
+ }
}
assert(ActualOpcode);
« no previous file with comments | « no previous file | src/IceRegistersMIPS32.h » ('j') | src/IceTargetLoweringMIPS32.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698