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

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: 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..e2aacb74fb1e09e3ffa12ae9cb24d8400ec5ce91 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,16 @@ protected:
void lowerCountZeros(bool Cttz, Type Ty, Variable *Dest, Operand *FirstVal,
Operand *SecondVal);
+ /// Check the comparison is in [Min,Max]. If not in the range, above will be
+ /// set, if in the range below equal will be set. The index into the range is
jvoung (off chromium) 2015/07/15 18:32:01 For "above will be set" and "below equal will be..
ascull 2015/07/16 19:38:45 Done.
+ /// 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.
+ void lowerCaseCluster(const CaseCluster &Case, Operand *Src0,
+ 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