diff options
| author | 2014-03-31 10:44:46 +0000 | |
|---|---|---|
| committer | 2014-03-31 10:44:47 +0000 | |
| commit | 7414375acad6170606903013d331f653173c299f (patch) | |
| tree | eb09d8f2e17811b2a8e9bbb34087ce0538439e58 /compiler/optimizing/builder.cc | |
| parent | 8732bf96433bbc177de509390d285b2d5477c83d (diff) | |
| parent | d8ee737fdbf380c5bb90c9270c8d1087ac23e76c (diff) | |
Merge "Add support for adding two integers in optimizing compiler."
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 db77feef63..64ecdb5c24 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; |