diff options
author | Calin Juravle <calin@google.com> | 2014-11-25 20:56:51 +0000 |
---|---|---|
committer | Calin Juravle <calin@google.com> | 2014-11-26 10:59:15 +0000 |
commit | cea28ec4b9e94ec942899acf1dbf20f8999b36b4 (patch) | |
tree | 893c062f6792688671519989a78065ecc7e79de9 /compiler/optimizing/builder.cc | |
parent | f0c001465371279355eeb7633b67ffcc6f6738e5 (diff) | |
download | android_art-cea28ec4b9e94ec942899acf1dbf20f8999b36b4.tar.gz android_art-cea28ec4b9e94ec942899acf1dbf20f8999b36b4.tar.bz2 android_art-cea28ec4b9e94ec942899acf1dbf20f8999b36b4.zip |
[optimizing compiler] Add CMP{L,G}_{FLOAT,DOUBLE}
- adds float comparison for arm, x86, x86_64 backends.
- adds ucomis{s,d} assembly to x86 and x86_64.
Change-Id: Ie91e04bfb402025073054f3803a3a569e4705caa
Diffstat (limited to 'compiler/optimizing/builder.cc')
-rw-r--r-- | compiler/optimizing/builder.cc | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc index b261460690..1be6e00938 100644 --- a/compiler/optimizing/builder.cc +++ b/compiler/optimizing/builder.cc @@ -313,6 +313,15 @@ void HGraphBuilder::Binop_23x_shift(const Instruction& instruction, UpdateLocal(instruction.VRegA(), current_block_->GetLastInstruction()); } +void HGraphBuilder::Binop_23x_cmp(const Instruction& instruction, + Primitive::Type type, + HCompare::Bias bias) { + HInstruction* first = LoadLocal(instruction.VRegB(), type); + HInstruction* second = LoadLocal(instruction.VRegC(), type); + current_block_->AddInstruction(new (arena_) HCompare(type, first, second, bias)); + UpdateLocal(instruction.VRegA(), current_block_->GetLastInstruction()); +} + template<typename T> void HGraphBuilder::Binop_12x(const Instruction& instruction, Primitive::Type type) { HInstruction* first = LoadLocal(instruction.VRegA(), type); @@ -1492,7 +1501,27 @@ bool HGraphBuilder::AnalyzeDexInstruction(const Instruction& instruction, uint32 break; case Instruction::CMP_LONG: { - Binop_23x<HCompare>(instruction, Primitive::kPrimLong); + Binop_23x_cmp(instruction, Primitive::kPrimLong, HCompare::kNoBias); + break; + } + + case Instruction::CMPG_FLOAT: { + Binop_23x_cmp(instruction, Primitive::kPrimFloat, HCompare::kGtBias); + break; + } + + case Instruction::CMPG_DOUBLE: { + Binop_23x_cmp(instruction, Primitive::kPrimDouble, HCompare::kGtBias); + break; + } + + case Instruction::CMPL_FLOAT: { + Binop_23x_cmp(instruction, Primitive::kPrimFloat, HCompare::kLtBias); + break; + } + + case Instruction::CMPL_DOUBLE: { + Binop_23x_cmp(instruction, Primitive::kPrimDouble, HCompare::kLtBias); break; } |