diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-03-28 15:43:40 +0000 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-03-31 11:41:39 +0100 |
commit | d8ee737fdbf380c5bb90c9270c8d1087ac23e76c (patch) | |
tree | becdbf2b4e2a3c84952bd7b1db60a2daccd47206 /compiler/optimizing/builder.cc | |
parent | 7f466c08888129a9923cb973a4dc73ee4a71574e (diff) | |
download | art-d8ee737fdbf380c5bb90c9270c8d1087ac23e76c.zip art-d8ee737fdbf380c5bb90c9270c8d1087ac23e76c.tar.gz art-d8ee737fdbf380c5bb90c9270c8d1087ac23e76c.tar.bz2 |
Add support for adding two integers in optimizing compiler.
Change-Id: I5524e193cd07f2692a57c6b4f8069904471b2928
Diffstat (limited to 'compiler/optimizing/builder.cc')
-rw-r--r-- | compiler/optimizing/builder.cc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc index db77fee..64ecdb5 100644 --- a/compiler/optimizing/builder.cc +++ b/compiler/optimizing/builder.cc @@ -211,6 +211,38 @@ bool HGraphBuilder::AnalyzeDexInstruction(const Instruction& instruction, int32_ break; } + case Instruction::ADD_INT: { + HInstruction* first = LoadLocal(instruction.VRegB()); + HInstruction* second = LoadLocal(instruction.VRegC()); + current_block_->AddInstruction(new (arena_) HAdd(Primitive::kPrimInt, first, second)); + UpdateLocal(instruction.VRegA(), current_block_->GetLastInstruction()); + break; + } + + case Instruction::ADD_INT_2ADDR: { + HInstruction* first = LoadLocal(instruction.VRegA()); + HInstruction* second = LoadLocal(instruction.VRegB()); + current_block_->AddInstruction(new (arena_) HAdd(Primitive::kPrimInt, first, second)); + UpdateLocal(instruction.VRegA(), current_block_->GetLastInstruction()); + break; + } + + case Instruction::ADD_INT_LIT16: { + HInstruction* first = LoadLocal(instruction.VRegB()); + HInstruction* second = GetConstant(instruction.VRegC_22s()); + current_block_->AddInstruction(new (arena_) HAdd(Primitive::kPrimInt, first, second)); + UpdateLocal(instruction.VRegA(), current_block_->GetLastInstruction()); + break; + } + + case Instruction::ADD_INT_LIT8: { + HInstruction* first = LoadLocal(instruction.VRegB()); + HInstruction* second = GetConstant(instruction.VRegC_22b()); + current_block_->AddInstruction(new (arena_) HAdd(Primitive::kPrimInt, first, second)); + UpdateLocal(instruction.VRegA(), current_block_->GetLastInstruction()); + break; + } + case Instruction::NOP: break; |