From 2e78250a7500601b2feedaf40164b7bcf8abc18a Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Fri, 4 Oct 2024 20:01:54 +0100 Subject: Address comments from aosp/3282234 Follow up to aosp/3282234 regarding comments after submission. Bug: 362916226 Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: Id572dd42e5aa877f4ae4a20cd43ad7a778e92815 --- compiler/optimizing/intrinsics_x86.cc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'compiler/optimizing/intrinsics_x86.cc') diff --git a/compiler/optimizing/intrinsics_x86.cc b/compiler/optimizing/intrinsics_x86.cc index dc88de474c..c1ec8bda82 100644 --- a/compiler/optimizing/intrinsics_x86.cc +++ b/compiler/optimizing/intrinsics_x86.cc @@ -2517,8 +2517,10 @@ void CreateUnsafeGetAndUpdateLocations(ArenaAllocator* allocator, // to take advantage of XCHG or XADD. Arbitrarily pick EAX. locations->SetInAt(3, Location::RegisterLocation(EAX)); // Only set the `out` register if it's needed. In the void case we can still use EAX in the - // same manner as it is used an as `in` register. - if (!is_void) { + // same manner as it is marked as a temp register. + if (is_void) { + locations->AddTemp(Location::RegisterLocation(EAX)); + } else { locations->SetOut(Location::RegisterLocation(EAX)); } } @@ -4296,8 +4298,10 @@ static void CreateVarHandleGetAndSetLocations(HInvoke* invoke, CodeGeneratorX86* } else { locations->SetInAt(value_index, Location::RegisterLocation(EAX)); // Only set the `out` register if it's needed. In the void case we can still use EAX in the - // same manner as it is used an as `in` register. - if (!is_void) { + // same manner as it is marked as a temp register. + if (is_void) { + locations->AddTemp(Location::RegisterLocation(EAX)); + } else { locations->SetOut(Location::RegisterLocation(EAX)); } } @@ -4680,8 +4684,10 @@ static void CreateVarHandleGetAndAddLocations(HInvoke* invoke, CodeGeneratorX86* // xadd updates the register argument with the old value. ByteRegister required for xaddb. locations->SetInAt(value_index, Location::RegisterLocation(EAX)); // Only set the `out` register if it's needed. In the void case we can still use EAX in the - // same manner as it is used an as `in` register. - if (!is_void) { + // same manner as it is marked as a temp register. + if (is_void) { + locations->AddTemp(Location::RegisterLocation(EAX)); + } else { locations->SetOut(Location::RegisterLocation(EAX)); } } -- cgit v1.2.3-59-g8ed1b