Commit 8ca7bd39 authored by Ivica Bogosavljevic's avatar Ivica Bogosavljevic Committed by Commit Bot

MIPS: Fix byteswap operation on mipsr1

We are not allowed to use t0 and t1 as temporary registers in
macro assembler as they are allocatable. This CL fixes the
issue.

Change-Id: I328532e669b081e5215887b725b0b645a86d98b1
Reviewed-on: https://chromium-review.googlesource.com/951488
Commit-Queue: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Reviewed-by: 's avatarSreten Kovacevic <sreten.kovacevic@mips.com>
Cr-Commit-Position: refs/heads/master@{#51773}
parent c75ff739
......@@ -674,7 +674,7 @@ void InstructionSelector::VisitWord64ReverseBytes(Node* node) { UNREACHABLE(); }
void InstructionSelector::VisitWord32ReverseBytes(Node* node) {
MipsOperandGenerator g(this);
Emit(kMipsByteSwap32, g.DefineAsRegister(node),
g.UseRegister(node->InputAt(0)));
g.UseUniqueRegister(node->InputAt(0)));
}
void InstructionSelector::VisitWord32Ctz(Node* node) {
......
......@@ -912,8 +912,11 @@ void TurboAssembler::ByteSwapSigned(Register dest, Register src,
wsbh(dest, src);
rotr(dest, dest, 16);
} else if (IsMipsArchVariant(kMips32r1) || IsMipsArchVariant(kLoongson)) {
Register tmp = t0;
Register tmp2 = t1;
Register tmp = at;
Register tmp2 = t8;
DCHECK(dest != src);
DCHECK(dest != tmp && dest != tmp2);
DCHECK(src != tmp && src != tmp2);
andi(tmp2, src, 0xFF);
sll(tmp2, tmp2, 24);
......@@ -953,7 +956,7 @@ void TurboAssembler::ByteSwapUnsigned(Register dest, Register src,
if (operand_size == 1) {
sll(src, src, 24);
} else {
Register tmp = t0;
Register tmp = at;
andi(tmp, src, 0xFF00);
sll(src, src, 24);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment