diff options
author | 2017-09-21 22:50:39 +0100 | |
---|---|---|
committer | 2017-09-25 15:45:01 +0100 | |
commit | 0ebe0d83138bba1996e9c8007969b5381d972b32 (patch) | |
tree | a5ee66ebc5b587ade97e56ac8fc7d832fbbed4af /compiler/optimizing/common_arm.h | |
parent | e1e347dace0ded83774999bb26c37527dcdb1d5a (diff) |
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/common_arm.h')
-rw-r--r-- | compiler/optimizing/common_arm.h | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/compiler/optimizing/common_arm.h b/compiler/optimizing/common_arm.h index e354654ee8..356ff9f41f 100644 --- a/compiler/optimizing/common_arm.h +++ b/compiler/optimizing/common_arm.h @@ -76,8 +76,8 @@ inline vixl::aarch32::Register RegisterFrom(Location location) { return vixl::aarch32::Register(location.reg()); } -inline vixl::aarch32::Register RegisterFrom(Location location, Primitive::Type type) { - DCHECK(type != Primitive::kPrimVoid && !Primitive::IsFloatingPointType(type)) << type; +inline vixl::aarch32::Register RegisterFrom(Location location, DataType::Type type) { + DCHECK(type != DataType::Type::kVoid && !DataType::IsFloatingPointType(type)) << type; return RegisterFrom(location); } @@ -94,20 +94,20 @@ inline vixl::aarch32::SRegister SRegisterFrom(Location location) { } inline vixl::aarch32::SRegister OutputSRegister(HInstruction* instr) { - Primitive::Type type = instr->GetType(); - DCHECK_EQ(type, Primitive::kPrimFloat) << type; + DataType::Type type = instr->GetType(); + DCHECK_EQ(type, DataType::Type::kFloat32) << type; return SRegisterFrom(instr->GetLocations()->Out()); } inline vixl::aarch32::DRegister OutputDRegister(HInstruction* instr) { - Primitive::Type type = instr->GetType(); - DCHECK_EQ(type, Primitive::kPrimDouble) << type; + DataType::Type type = instr->GetType(); + DCHECK_EQ(type, DataType::Type::kFloat64) << type; return DRegisterFrom(instr->GetLocations()->Out()); } inline vixl::aarch32::VRegister OutputVRegister(HInstruction* instr) { - Primitive::Type type = instr->GetType(); - if (type == Primitive::kPrimFloat) { + DataType::Type type = instr->GetType(); + if (type == DataType::Type::kFloat32) { return OutputSRegister(instr); } else { return OutputDRegister(instr); @@ -115,23 +115,23 @@ inline vixl::aarch32::VRegister OutputVRegister(HInstruction* instr) { } inline vixl::aarch32::SRegister InputSRegisterAt(HInstruction* instr, int input_index) { - Primitive::Type type = instr->InputAt(input_index)->GetType(); - DCHECK_EQ(type, Primitive::kPrimFloat) << type; + DataType::Type type = instr->InputAt(input_index)->GetType(); + DCHECK_EQ(type, DataType::Type::kFloat32) << type; return SRegisterFrom(instr->GetLocations()->InAt(input_index)); } inline vixl::aarch32::DRegister InputDRegisterAt(HInstruction* instr, int input_index) { - Primitive::Type type = instr->InputAt(input_index)->GetType(); - DCHECK_EQ(type, Primitive::kPrimDouble) << type; + DataType::Type type = instr->InputAt(input_index)->GetType(); + DCHECK_EQ(type, DataType::Type::kFloat64) << type; return DRegisterFrom(instr->GetLocations()->InAt(input_index)); } inline vixl::aarch32::VRegister InputVRegisterAt(HInstruction* instr, int input_index) { - Primitive::Type type = instr->InputAt(input_index)->GetType(); - if (type == Primitive::kPrimFloat) { + DataType::Type type = instr->InputAt(input_index)->GetType(); + if (type == DataType::Type::kFloat32) { return InputSRegisterAt(instr, input_index); } else { - DCHECK_EQ(type, Primitive::kPrimDouble); + DCHECK_EQ(type, DataType::Type::kFloat64); return InputDRegisterAt(instr, input_index); } } @@ -196,7 +196,7 @@ inline uint64_t Uint64ConstantFrom(HInstruction* instr) { return instr->AsConstant()->GetValueAsUint64(); } -inline vixl::aarch32::Operand OperandFrom(Location location, Primitive::Type type) { +inline vixl::aarch32::Operand OperandFrom(Location location, DataType::Type type) { if (location.IsRegister()) { return vixl::aarch32::Operand(RegisterFrom(location, type)); } else { |