ART: Introduce Uint8 loads in compiled code.
Some vectorization patterns are not recognized anymore.
This shall be fixed later.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: testrunner.py --target --optimizing on Nexus 5X
Test: Nexus 5X boots.
Bug: 23964345
Bug: 67935418
Change-Id: I587a328d4799529949c86fa8045c6df21e3a8617
diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc
index 39a07b8..561be1b 100644
--- a/compiler/optimizing/code_generator_x86.cc
+++ b/compiler/optimizing/code_generator_x86.cc
@@ -4756,10 +4756,11 @@
Register base = base_loc.AsRegister<Register>();
Location out = locations->Out();
bool is_volatile = field_info.IsVolatile();
- DataType::Type field_type = field_info.GetFieldType();
+ DCHECK_EQ(DataType::Size(field_info.GetFieldType()), DataType::Size(instruction->GetType()));
+ DataType::Type load_type = instruction->GetType();
uint32_t offset = field_info.GetFieldOffset().Uint32Value();
- switch (field_type) {
+ switch (load_type) {
case DataType::Type::kBool:
case DataType::Type::kUint8: {
__ movzxb(out.AsRegister<Register>(), Address(base, offset));
@@ -4837,11 +4838,11 @@
}
case DataType::Type::kVoid:
- LOG(FATAL) << "Unreachable type " << field_type;
+ LOG(FATAL) << "Unreachable type " << load_type;
UNREACHABLE();
}
- if (field_type == DataType::Type::kReference || field_type == DataType::Type::kInt64) {
+ if (load_type == DataType::Type::kReference || load_type == DataType::Type::kInt64) {
// Potential implicit null checks, in the case of reference or
// long fields, are handled in the previous switch statement.
} else {
@@ -4849,7 +4850,7 @@
}
if (is_volatile) {
- if (field_type == DataType::Type::kReference) {
+ if (load_type == DataType::Type::kReference) {
// Memory barriers, in the case of references, are also handled
// in the previous switch statement.
} else {