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

Unified Diff: src/IceAssemblerMIPS32.cpp

Issue 2619943003: [SubZero] Fix code generation issues occurred in Cross-test and PNaCL smoke-tests (Closed)
Patch Set: Addressed review comments Created 3 years, 11 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/IceInstMIPS32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceAssemblerMIPS32.cpp
diff --git a/src/IceAssemblerMIPS32.cpp b/src/IceAssemblerMIPS32.cpp
index a212457cc7f66cfa78b1cf5068c8cd0a0e5690b2..f1a656df33c128c521ec55f1ecee0c36c9fcd181 100644
--- a/src/IceAssemblerMIPS32.cpp
+++ b/src/IceAssemblerMIPS32.cpp
@@ -196,7 +196,10 @@ void AssemblerMIPS32::bind(Label *L) {
IOffsetT Dest = BoundPc - Position;
IValueT Inst = Buffer.load<IValueT>(Position);
Buffer.store<IValueT>(Position, encodeBranchOffset(Dest, Inst));
- L->setPosition(decodeBranchOffset(Inst));
+ IOffsetT NextBrPc = decodeBranchOffset(Inst);
+ if (NextBrPc != 0)
+ NextBrPc = Position - NextBrPc;
+ L->setPosition(NextBrPc);
}
L->bindTo(BoundPc);
}
@@ -428,7 +431,10 @@ void AssemblerMIPS32::b(Label *TargetLabel) {
return;
}
const IOffsetT Position = Buffer.size();
- emitBr(CondMIPS32::AL, OpRsNone, OpRtNone, TargetLabel->getEncodedPosition());
+ IOffsetT PrevPosition = TargetLabel->getEncodedPosition();
+ if (PrevPosition != 0)
+ PrevPosition = Position - PrevPosition;
+ emitBr(CondMIPS32::AL, OpRsNone, OpRtNone, PrevPosition);
TargetLabel->linkTo(*this, Position);
}
@@ -850,7 +856,7 @@ void AssemblerMIPS32::movn(const Operand *OpRd, const Operand *OpRs,
void AssemblerMIPS32::movn_d(const Operand *OpFd, const Operand *OpFs,
const Operand *OpFt) {
static constexpr IValueT Opcode = 0x44000013;
- emitCOP1FmtRtFsFd(Opcode, SinglePrecision, OpFd, OpFs, OpFt, "movn.d");
+ emitCOP1FmtRtFsFd(Opcode, DoublePrecision, OpFd, OpFs, OpFt, "movn.d");
}
void AssemblerMIPS32::movn_s(const Operand *OpFd, const Operand *OpFs,
@@ -879,7 +885,7 @@ void AssemblerMIPS32::movt(const Operand *OpRd, const Operand *OpRs,
void AssemblerMIPS32::movz_d(const Operand *OpFd, const Operand *OpFs,
const Operand *OpFt) {
static constexpr IValueT Opcode = 0x44000012;
- emitCOP1FmtFtFsFd(Opcode, SinglePrecision, OpFd, OpFs, OpFt, "movz.d");
+ emitCOP1FmtFtFsFd(Opcode, DoublePrecision, OpFd, OpFs, OpFt, "movz.d");
}
void AssemblerMIPS32::movz(const Operand *OpRd, const Operand *OpRs,
@@ -1239,7 +1245,10 @@ void AssemblerMIPS32::bcc(const CondMIPS32::Cond Cond, const Operand *OpRs,
return;
}
const IOffsetT Position = Buffer.size();
- emitBr(Cond, OpRs, OpRt, TargetLabel->getEncodedPosition());
+ IOffsetT PrevPosition = TargetLabel->getEncodedPosition();
+ if (PrevPosition != 0)
+ PrevPosition = Position - PrevPosition;
+ emitBr(Cond, OpRs, OpRt, PrevPosition);
TargetLabel->linkTo(*this, Position);
}
@@ -1252,7 +1261,10 @@ void AssemblerMIPS32::bzc(const CondMIPS32::Cond Cond, const Operand *OpRs,
return;
}
const IOffsetT Position = Buffer.size();
- emitBr(Cond, OpRs, OpRtNone, TargetLabel->getEncodedPosition());
+ IOffsetT PrevPosition = TargetLabel->getEncodedPosition();
+ if (PrevPosition)
+ PrevPosition = Position - PrevPosition;
+ emitBr(Cond, OpRs, OpRtNone, PrevPosition);
TargetLabel->linkTo(*this, Position);
}
« no previous file with comments | « no previous file | src/IceInstMIPS32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698