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

Unified Diff: src/IceInstMIPS32.h

Issue 1993773004: [Subzero][MIPS32] Addition of bool folding machinery and implementation of conditional branches (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addressed review comments Created 4 years, 7 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/IceConditionCodesMIPS32.h ('k') | src/IceInstMIPS32.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInstMIPS32.h
diff --git a/src/IceInstMIPS32.h b/src/IceInstMIPS32.h
index e364f7f2ea8b5850761e2eb84b69bd0509a35d09..708c8e1478c403586e08ac0f39aa87db4045fbc8 100644
--- a/src/IceInstMIPS32.h
+++ b/src/IceInstMIPS32.h
@@ -19,6 +19,7 @@
#ifndef SUBZERO_SRC_ICEINSTMIPS32_H
#define SUBZERO_SRC_ICEINSTMIPS32_H
+#include "IceConditionCodesMIPS32.h"
#include "IceDefs.h"
#include "IceInst.h"
#include "IceInstMIPS32.def"
@@ -340,12 +341,32 @@ public:
constexpr CfgNode *NoCondTarget = nullptr;
constexpr InstMIPS32Label *NoLabel = nullptr;
return new (Func->allocate<InstMIPS32Br>())
- InstMIPS32Br(Func, NoCondTarget, Target, NoLabel);
+ InstMIPS32Br(Func, NoCondTarget, Target, NoLabel, CondMIPS32::AL);
}
+
+ /// Create a conditional branch to the false node.
Jim Stichnoth 2016/05/24 13:12:56 Sorry, I forgot to comment on this last time. Usu
sagar.thakur 2016/05/25 08:39:06 These branch instructions can be targeted to eithe
+ static InstMIPS32Br *create(Cfg *Func, CfgNode *TargetTrue,
+ CfgNode *TargetFalse, Operand *Src0,
+ Operand *Src1, CondMIPS32::Cond Cond) {
+ constexpr InstMIPS32Label *NoLabel = nullptr;
+ return new (Func->allocate<InstMIPS32Br>())
+ InstMIPS32Br(Func, TargetTrue, TargetFalse, Src0, Src1, NoLabel, Cond);
+ }
+
+ static InstMIPS32Br *create(Cfg *Func, CfgNode *TargetTrue,
+ CfgNode *TargetFalse, Operand *Src0,
+ CondMIPS32::Cond Cond) {
+ constexpr InstMIPS32Label *NoLabel = nullptr;
+ return new (Func->allocate<InstMIPS32Br>())
+ InstMIPS32Br(Func, TargetTrue, TargetFalse, Src0, NoLabel, Cond);
+ }
+
const CfgNode *getTargetTrue() const { return TargetTrue; }
const CfgNode *getTargetFalse() const { return TargetFalse; }
- bool isUnconditionalBranch() const override { return true; }
+ bool isUnconditionalBranch() const override {
+ return Predicate == CondMIPS32::AL;
+ }
bool repointEdges(CfgNode *OldNode, CfgNode *NewNode) override {
(void)OldNode;
(void)NewNode;
@@ -353,16 +374,25 @@ public:
};
void emit(const Cfg *Func) const override;
void emitIAS(const Cfg *Func) const override { (void)Func; };
- void dump(const Cfg *Func) const override { (void)Func; };
+ void dump(const Cfg *Func) const override;
static bool classof(const Inst *Instr) { return isClassof(Instr, Br); }
private:
InstMIPS32Br(Cfg *Func, const CfgNode *TargetTrue, const CfgNode *TargetFalse,
- const InstMIPS32Label *Label);
+ const InstMIPS32Label *Label, const CondMIPS32::Cond Cond);
+
+ InstMIPS32Br(Cfg *Func, const CfgNode *TargetTrue, const CfgNode *TargetFalse,
+ Operand *Src0, const InstMIPS32Label *Label,
+ const CondMIPS32::Cond Cond);
+
+ InstMIPS32Br(Cfg *Func, const CfgNode *TargetTrue, const CfgNode *TargetFalse,
+ Operand *Src0, Operand *Src1, const InstMIPS32Label *Label,
+ const CondMIPS32::Cond Cond);
const CfgNode *TargetTrue;
const CfgNode *TargetFalse;
const InstMIPS32Label *Label; // Intra-block branch target
+ const CondMIPS32::Cond Predicate;
};
class InstMIPS32Call : public InstMIPS32 {
« no previous file with comments | « src/IceConditionCodesMIPS32.h ('k') | src/IceInstMIPS32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698