diff options
| author | 2024-07-08 13:04:06 +0000 | |
|---|---|---|
| committer | 2024-07-08 13:04:06 +0000 | |
| commit | 229296925add65215d0611e65a1b3770ff118ccb (patch) | |
| tree | 89af63372141ea397d8cba10346e4c699f0d8192 /compiler/optimizing/intrinsics_x86.cc | |
| parent | 85ad67ecb3b6c7fb5520d94adf5134763549fad5 (diff) | |
| parent | 801c4c9d8c55be2bd8ee9c3dcc6c20ab0cf4c5f7 (diff) | |
Ensure x86 uses a byte register. am: 801c4c9d8c
Original change: https://android-review.googlesource.com/c/platform/art/+/3161996
Change-Id: Ib6c44a88d6e9a0c2e4e1326b195d85de7c7e1875
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
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) { |