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/IceTargetLoweringX86Base.h

Issue 1407143002: Merge compares and branches (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 2 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/IceTargetLoweringX86BaseImpl.h » ('j') | src/IceTargetLoweringX86BaseImpl.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLoweringX86Base.h
diff --git a/src/IceTargetLoweringX86Base.h b/src/IceTargetLoweringX86Base.h
index 71972eb95e1de0df57e04d53db172e75f5af654c..6f7758d336919869d9bc4a0be85de954bcf63c05 100644
--- a/src/IceTargetLoweringX86Base.h
+++ b/src/IceTargetLoweringX86Base.h
@@ -151,18 +151,6 @@ protected:
void lowerExtractElement(const InstExtractElement *Inst) override;
void lowerFcmp(const InstFcmp *Inst) override;
void lowerIcmp(const InstIcmp *Inst) override;
- /// Complains loudly if invoked because the cpu can handle 64-bit types
- /// natively.
- template <typename T = Traits>
- typename std::enable_if<T::Is64Bit, void>::type
- lowerIcmp64(const InstIcmp *) {
- llvm::report_fatal_error(
- "Hey, yo! This is x86-64. Watcha doin'? (lowerIcmp64)");
- }
- /// x86lowerIcmp64 handles 64-bit icmp lowering.
- template <typename T = Traits>
- typename std::enable_if<!T::Is64Bit, void>::type
- lowerIcmp64(const InstIcmp *Inst);
void lowerIntrinsicCall(const InstIntrinsicCall *Inst) override;
void lowerInsertElement(const InstInsertElement *Inst) override;
@@ -722,6 +710,31 @@ private:
void lowerShift64(InstArithmetic::OpKind Op, Operand *Src0Lo, Operand *Src0Hi,
Operand *Src1Lo, Variable *DestLo, Variable *DestHi);
+
+ // Emit the code for a combined compare and branch, or sets the destination
Jim Stichnoth 2015/10/16 13:58:11 Probably use /// style for consistency?
sehr 2015/10/16 18:10:22 Done.
+ // variable of the compare if branch is nullptr.
+ void lowerIcmpAndBr(const InstIcmp *Icmp, const InstBr *Br = nullptr);
Jim Stichnoth 2015/10/16 13:58:10 You're always calling this with 2 explicit args, s
sehr 2015/10/16 18:10:22 Done.
+
+ // Emit a setcc instruction if Br == nullptr; otherwise emit a branch.
+ void setccOrBr(typename Traits::Cond::BrCond Condition, Variable *Dest,
+ const InstBr *Br);
+
+ // Emit a mov [1|0] instruction if Br == nullptr; otherwise emit a branch.
+ void movOrBr(bool IcmpResult, Variable *Dest, const InstBr *Br);
+
+ /// Complains loudly if invoked because the cpu can handle 64-bit types
+ /// natively.
+ template <typename T = Traits>
+ typename std::enable_if<T::Is64Bit, void>::type
+ lowerIcmp64(const InstIcmp *, const InstBr *) {
+ llvm::report_fatal_error(
+ "Hey, yo! This is x86-64. Watcha doin'? (lowerIcmp64)");
+ }
+ /// x86lowerIcmp64 handles 64-bit icmp lowering.
+ template <typename T = Traits>
+ typename std::enable_if<!T::Is64Bit, void>::type
+ lowerIcmp64(const InstIcmp *Icmp, const InstBr *Br);
+
BoolFolding FoldingInfo;
};
} // end of namespace X86Internal
« no previous file with comments | « no previous file | src/IceTargetLoweringX86BaseImpl.h » ('j') | src/IceTargetLoweringX86BaseImpl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698