diff options
| author | Vladimir Marko <vmarko@google.com> | 2017-09-21 22:50:39 +0100 |
|---|---|---|
| committer | Vladimir Marko <vmarko@google.com> | 2017-09-25 15:45:01 +0100 |
| commit | 0ebe0d83138bba1996e9c8007969b5381d972b32 (patch) | |
| tree | a5ee66ebc5b587ade97e56ac8fc7d832fbbed4af /compiler/optimizing/nodes_shared.cc | |
| parent | e1e347dace0ded83774999bb26c37527dcdb1d5a (diff) | |
| download | art-0ebe0d83138bba1996e9c8007969b5381d972b32.tar.gz art-0ebe0d83138bba1996e9c8007969b5381d972b32.tar.bz2 art-0ebe0d83138bba1996e9c8007969b5381d972b32.zip | |
ART: Introduce compiler data type.
Replace most uses of the runtime's Primitive in compiler
with a new class DataType. This prepares for introducing
new types, such as Uint8, that the runtime does not need
to know about.
Test: m test-art-host-gtest
Test: testrunner.py --host
Bug: 23964345
Change-Id: Iec2ad82454eec678fffcd8279a9746b90feb9b0c
Diffstat (limited to 'compiler/optimizing/nodes_shared.cc')
| -rw-r--r-- | compiler/optimizing/nodes_shared.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/optimizing/nodes_shared.cc b/compiler/optimizing/nodes_shared.cc index f6d33f015f..f982523634 100644 --- a/compiler/optimizing/nodes_shared.cc +++ b/compiler/optimizing/nodes_shared.cc @@ -42,20 +42,20 @@ void HDataProcWithShifterOp::GetOpInfoFromInstruction(HInstruction* instruction, *shift_amount = instruction->AsUShr()->GetRight()->AsIntConstant()->GetValue(); } else { DCHECK(instruction->IsTypeConversion()); - Primitive::Type result_type = instruction->AsTypeConversion()->GetResultType(); - Primitive::Type input_type = instruction->AsTypeConversion()->GetInputType(); - int result_size = Primitive::ComponentSize(result_type); - int input_size = Primitive::ComponentSize(input_type); + DataType::Type result_type = instruction->AsTypeConversion()->GetResultType(); + DataType::Type input_type = instruction->AsTypeConversion()->GetInputType(); + int result_size = DataType::Size(result_type); + int input_size = DataType::Size(input_type); int min_size = std::min(result_size, input_size); - if (result_type == Primitive::kPrimInt && input_type == Primitive::kPrimLong) { + if (result_type == DataType::Type::kInt32 && input_type == DataType::Type::kInt64) { // There is actually nothing to do. On ARM the high register from the // pair will be ignored. On ARM64 the register will be used as a W // register, discarding the top bits. This is represented by the // default encoding 'LSL 0'. *op_kind = kLSL; *shift_amount = 0; - } else if (result_type == Primitive::kPrimChar || - (input_type == Primitive::kPrimChar && input_size < result_size)) { + } else if (result_type == DataType::Type::kUint16 || + (input_type == DataType::Type::kUint16 && input_size < result_size)) { *op_kind = kUXTH; } else { switch (min_size) { |
