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

Unified Diff: src/IceInstMIPS32.cpp

Issue 2367743004: Subzero, MIPS32: Binding intrablock labels, unconditional branch (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addressing comments 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/IceAssemblerMIPS32.h ('k') | no next file » | 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 bca00ba147dc98eae7caa73d9d7d2fb1ae7d74d6..1efc6e8e705c77fe266fd0086e77410b70f37c8c 100644
--- a/src/IceInstMIPS32.cpp
+++ b/src/IceInstMIPS32.cpp
@@ -273,8 +273,8 @@ void InstMIPS32Label::emit(const Cfg *Func) const {
}
void InstMIPS32Label::emitIAS(const Cfg *Func) const {
- (void)Func;
- llvm_unreachable("Not yet implemented");
+ auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>();
+ Asm->bindLocalLabel(this, Number);
}
InstMIPS32Call::InstMIPS32Call(Cfg *Func, Variable *Dest, Operand *CallTarget)
@@ -419,7 +419,11 @@ void InstMIPS32Ret::emit(const Cfg *Func) const {
void InstMIPS32Br::emitIAS(const Cfg *Func) const {
auto *Asm = Func->getAssembler<MIPS32::AssemblerMIPS32>();
- if (isUnconditionalBranch()) {
+ if (Label != nullptr) {
+ // Intra-block branches are of kind bcc
+ Asm->bcc(Predicate, getSrc(0), getSrc(1),
+ Asm->getOrCreateLocalLabel(Label->getNumber()));
+ } else if (isUnconditionalBranch()) {
Asm->b(Asm->getOrCreateCfgNodeLabel(getTargetFalse()->getIndex()));
} else {
switch (Predicate) {
@@ -440,6 +444,9 @@ void InstMIPS32Br::emitIAS(const Cfg *Func) const {
Asm->getOrCreateCfgNodeLabel(getTargetFalse()->getIndex()));
break;
}
+ if (getTargetTrue()) {
+ Asm->b(Asm->getOrCreateCfgNodeLabel(getTargetTrue()->getIndex()));
+ }
}
}
« no previous file with comments | « src/IceAssemblerMIPS32.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698