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

Unified Diff: src/IceTargetLoweringX86Base.h

Issue 1234803007: Introduction of improved switch lowering. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Formatting tweaks. Created 5 years, 5 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
Index: src/IceTargetLoweringX86Base.h
diff --git a/src/IceTargetLoweringX86Base.h b/src/IceTargetLoweringX86Base.h
index c00f0b0e5524207dec9ccf1275de84f6ced074e4..e17cf078bae30bf97f9d5a47ddfabc617bfb8bbd 100644
--- a/src/IceTargetLoweringX86Base.h
+++ b/src/IceTargetLoweringX86Base.h
@@ -19,6 +19,7 @@
#include "IceDefs.h"
#include "IceInst.h"
+#include "IceSwitchLowering.h"
#include "IceTargetLowering.h"
#include <type_traits>
@@ -130,6 +131,8 @@ public:
return (typeWidthInBytes(Ty) + 3) & ~3;
}
+ SizeT getMinJumpTableSize() const override { return 4; }
+
void emitVariable(const Variable *Var) const override;
const char *getConstantPrefix() const final { return "$"; }
@@ -203,6 +206,19 @@ protected:
void lowerCountZeros(bool Cttz, Type Ty, Variable *Dest, Operand *FirstVal,
Operand *SecondVal);
+ /// Check the comparison is in [Min,Max]. The flags register will be modified
+ /// with:
+ /// - below equal, if in range
+ /// - above, set if not in range
+ /// The index into the range is returned.
+ Operand *lowerCmpRange(Operand *Comparison, uint64_t Min, uint64_t Max);
+ /// Lowering of a cluster of switch cases. If the case is not matched control
+ /// will pass to the default label provided. If the default label is nullptr
+ /// then control will fall through to the next instruction. DoneCmp should be
+ /// true if the flags contain the result of a comparison with the Comparison.
+ void lowerCaseCluster(const CaseCluster &Case, Operand *Src0, bool DoneCmp,
+ CfgNode *DefaultLabel = nullptr);
+
typedef void (TargetX86Base::*LowerBinOp)(Variable *, Operand *);
void expandAtomicRMWAsCmpxchg(LowerBinOp op_lo, LowerBinOp op_hi,
Variable *Dest, Operand *Ptr, Operand *Val);

Powered by Google App Engine
This is Rietveld 408576698