[maglev][arm64] Fix some typed array arch issues

- When doing a 64 bit add, we should not pass a W register
- We should use MemOperand to load from memory

Bug: v8:7700
Change-Id: I2dfca1f558c58a12f836942155cafb60cc72915a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4161753
Auto-Submit: Victor Gomes <victorgomes@chromium.org>
Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Commit-Queue: Darius Mercadier <dmercadier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85245}
This commit is contained in:
Victor Gomes 2023-01-12 10:52:54 +01:00 committed by V8 LUCI CQ
parent c48cc5bab5
commit e82b88192e
2 changed files with 5 additions and 5 deletions

View File

@ -327,9 +327,9 @@ inline void MaglevAssembler::BuildTypedArrayDataPointer(Register data_pointer,
FieldMemOperand(object, JSTypedArray::kExternalPointerOffset));
if (JSTypedArray::kMaxSizeInHeap == 0) return;
UseScratchRegisterScope scope(this);
Register base = scope.AcquireW();
ldr(base, FieldMemOperand(object, JSTypedArray::kBasePointerOffset));
add(data_pointer, data_pointer, base);
Register base = scope.AcquireX();
Ldr(base.W(), FieldMemOperand(object, JSTypedArray::kBasePointerOffset));
Add(data_pointer, data_pointer, base);
}
inline void MaglevAssembler::LoadBoundedSizeFromObject(Register result,

View File

@ -1898,12 +1898,12 @@ void GenerateTypedArrayLoad(MaglevAssembler* masm, NodeT* node, Register object,
switch (kind) {
case FLOAT32_ELEMENTS:
__ Add(data_pointer, data_pointer, Operand(index, LSL, 2));
__ Ldr(result_reg.S(), Operand(data_pointer));
__ Ldr(result_reg.S(), MemOperand(data_pointer));
__ Fcvt(result_reg, result_reg.S());
break;
case FLOAT64_ELEMENTS:
__ Add(data_pointer, data_pointer, Operand(index, LSL, 3));
__ Ldr(result_reg, Operand(data_pointer));
__ Ldr(result_reg, MemOperand(data_pointer));
break;
default:
UNREACHABLE();