diff options
Diffstat (limited to 'compiler/optimizing/intrinsics_x86.cc')
-rw-r--r-- | compiler/optimizing/intrinsics_x86.cc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/compiler/optimizing/intrinsics_x86.cc b/compiler/optimizing/intrinsics_x86.cc index b752493a0f..50ac993ac8 100644 --- a/compiler/optimizing/intrinsics_x86.cc +++ b/compiler/optimizing/intrinsics_x86.cc @@ -1887,7 +1887,12 @@ static void CreateIntIntIntIntToVoidPlusTempsLocations(ArenaAllocator* allocator locations->SetInAt(0, Location::NoLocation()); // Unused receiver. locations->SetInAt(1, Location::RequiresRegister()); locations->SetInAt(2, Location::RequiresRegister()); - locations->SetInAt(3, Location::RequiresRegister()); + if (type == DataType::Type::kInt8 || type == DataType::Type::kUint8) { + // Ensure the value is in a byte register + locations->SetInAt(3, Location::ByteRegisterOrConstant(EAX, invoke->InputAt(3))); + } else { + locations->SetInAt(3, Location::RequiresRegister()); + } if (type == DataType::Type::kReference) { // Need temp registers for card-marking. locations->AddTemp(Location::RequiresRegister()); // Possibly used for reference poisoning too. @@ -2017,7 +2022,12 @@ static void GenUnsafePut(LocationSummary* locations, __ movl(Address(base, offset, ScaleFactor::TIMES_1, 0), value_loc.AsRegister<Register>()); } else { CHECK_EQ(type, DataType::Type::kInt8) << "Unimplemented GenUnsafePut data type"; - __ movb(Address(base, offset, ScaleFactor::TIMES_1, 0), value_loc.AsRegister<ByteRegister>()); + if (value_loc.IsRegister()) { + __ movb(Address(base, offset, ScaleFactor::TIMES_1, 0), value_loc.AsRegister<ByteRegister>()); + } else { + __ movb(Address(base, offset, ScaleFactor::TIMES_1, 0), + Immediate(CodeGenerator::GetInt8ValueOf(value_loc.GetConstant()))); + } } if (is_volatile) { |