diff options
author | Roland Levillain <rpl@google.com> | 2014-11-13 18:44:19 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-11-13 18:44:20 +0000 |
commit | 7bdabab1b6a37248bcc0e16893e43f91b4218d29 (patch) | |
tree | 5087b4d6062deba3e105d1fd49f17bc0ea73db4c /compiler/optimizing/code_generator_arm.cc | |
parent | 346bcbde27e4620ed1e7bce91728f22069a371f0 (diff) | |
parent | 51d3fc40637fc73d4156ad617cd451b844cbb75e (diff) | |
download | art-7bdabab1b6a37248bcc0e16893e43f91b4218d29.tar.gz art-7bdabab1b6a37248bcc0e16893e43f91b4218d29.tar.bz2 art-7bdabab1b6a37248bcc0e16893e43f91b4218d29.zip |
Merge "Add support for int-to-byte in the optimizing compiler."
Diffstat (limited to 'compiler/optimizing/code_generator_arm.cc')
-rw-r--r-- | compiler/optimizing/code_generator_arm.cc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/compiler/optimizing/code_generator_arm.cc b/compiler/optimizing/code_generator_arm.cc index 56cd75f821..7444506771 100644 --- a/compiler/optimizing/code_generator_arm.cc +++ b/compiler/optimizing/code_generator_arm.cc @@ -1351,6 +1351,22 @@ void LocationsBuilderARM::VisitTypeConversion(HTypeConversion* conversion) { Primitive::Type result_type = conversion->GetResultType(); Primitive::Type input_type = conversion->GetInputType(); switch (result_type) { + case Primitive::kPrimByte: + switch (input_type) { + case Primitive::kPrimShort: + case Primitive::kPrimInt: + case Primitive::kPrimChar: + // int-to-byte conversion. + locations->SetInAt(0, Location::RequiresRegister()); + locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap); + break; + + default: + LOG(FATAL) << "Unexpected type conversion from " << input_type + << " to " << result_type; + } + break; + case Primitive::kPrimInt: switch (input_type) { case Primitive::kPrimLong: @@ -1413,6 +1429,21 @@ void InstructionCodeGeneratorARM::VisitTypeConversion(HTypeConversion* conversio Primitive::Type result_type = conversion->GetResultType(); Primitive::Type input_type = conversion->GetInputType(); switch (result_type) { + case Primitive::kPrimByte: + switch (input_type) { + case Primitive::kPrimShort: + case Primitive::kPrimInt: + case Primitive::kPrimChar: + // int-to-byte conversion. + __ sbfx(out.As<Register>(), in.As<Register>(), 0, 8); + break; + + default: + LOG(FATAL) << "Unexpected type conversion from " << input_type + << " to " << result_type; + } + break; + case Primitive::kPrimInt: switch (input_type) { case Primitive::kPrimLong: |