PPC: pass a gp scratch register to SwapSimd128

Change-Id: I5da6270dc5c3d9b561eeb6c6dd3a938e705039c4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3843088
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#82604}
This commit is contained in:
Milad Fa 2022-08-19 15:51:34 -04:00 committed by V8 LUCI CQ
parent d4a8f1a478
commit 8dc9e521fa
3 changed files with 14 additions and 13 deletions

View File

@ -3986,21 +3986,21 @@ void TurboAssembler::SwapSimd128(Simd128Register src, Simd128Register dst,
}
void TurboAssembler::SwapSimd128(Simd128Register src, MemOperand dst,
Simd128Register scratch) {
DCHECK(src != scratch);
LoadSimd128(scratch, dst, ip);
Simd128Register scratch1, Register scratch2) {
DCHECK(src != scratch1);
LoadSimd128(scratch1, dst, scratch2);
StoreSimd128(src, dst, ip);
vor(src, scratch, scratch);
vor(src, scratch1, scratch1);
}
void TurboAssembler::SwapSimd128(MemOperand src, MemOperand dst,
Simd128Register scratch1,
Simd128Register scratch2) {
LoadSimd128(scratch1, src, ip);
LoadSimd128(scratch2, dst, ip);
Simd128Register scratch2, Register scratch3) {
LoadSimd128(scratch1, src, scratch3);
LoadSimd128(scratch2, dst, scratch3);
StoreSimd128(scratch1, dst, ip);
StoreSimd128(scratch2, src, ip);
StoreSimd128(scratch1, dst, scratch3);
StoreSimd128(scratch2, src, scratch3);
}
void TurboAssembler::ByteReverseU16(Register dst, Register val,

View File

@ -615,9 +615,9 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
void SwapSimd128(Simd128Register src, Simd128Register dst,
Simd128Register scratch);
void SwapSimd128(Simd128Register src, MemOperand dst,
Simd128Register scratch);
Simd128Register scratch1, Register scratch2);
void SwapSimd128(MemOperand src, MemOperand dst, Simd128Register scratch1,
Simd128Register scratch2);
Simd128Register scratch2, Register scratch3);
void ByteReverseU16(Register dst, Register val, Register scratch);
void ByteReverseU32(Register dst, Register val, Register scratch);

View File

@ -4518,12 +4518,13 @@ void CodeGenerator::AssembleSwap(InstructionOperand* source,
__ SwapSimd128(src, g.ToSimd128Register(destination), kScratchSimd128Reg);
} else {
DCHECK(destination->IsSimd128StackSlot());
__ SwapSimd128(src, g.ToMemOperand(destination), kScratchSimd128Reg);
__ SwapSimd128(src, g.ToMemOperand(destination), kScratchSimd128Reg,
kScratchReg);
}
} else if (source->IsSimd128StackSlot()) {
DCHECK(destination->IsSimd128StackSlot());
__ SwapSimd128(g.ToMemOperand(source), g.ToMemOperand(destination),
kScratchSimd128Reg, kScratchSimd128Reg2);
kScratchSimd128Reg, kScratchSimd128Reg2, kScratchReg);
} else {
UNREACHABLE();