diff options
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r-- | compiler/optimizing/nodes.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 503f31d990..92920845c3 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -414,6 +414,7 @@ class HBasicBlock : public ArenaObject { M(ReturnVoid) \ M(StoreLocal) \ M(Sub) \ + M(Compare) \ #define FORWARD_DECLARATION(type) class H##type; @@ -986,6 +987,22 @@ class HGreaterThanOrEqual : public HCondition { }; +// Instruction to check how two inputs compare to each other. +// Result is 0 if input0 == input1, 1 if input0 > input1, or -1 if input0 < input1. +class HCompare : public HBinaryOperation { + public: + HCompare(Primitive::Type type, HInstruction* first, HInstruction* second) + : HBinaryOperation(Primitive::kPrimInt, first, second) { + DCHECK_EQ(type, first->GetType()); + DCHECK_EQ(type, second->GetType()); + } + + DECLARE_INSTRUCTION(Compare); + + private: + DISALLOW_COPY_AND_ASSIGN(HCompare); +}; + // A local in the graph. Corresponds to a Dex register. class HLocal : public HTemplateInstruction<0> { public: |