Index: src/compiler/mips64/code-generator-mips64.cc |
diff --git a/src/compiler/mips64/code-generator-mips64.cc b/src/compiler/mips64/code-generator-mips64.cc |
index 9e88bf184ddf9e62dda1f5929a89cfd048608591..df9581078195d3d8ea70ede543859477e8eb138d 100644 |
--- a/src/compiler/mips64/code-generator-mips64.cc |
+++ b/src/compiler/mips64/code-generator-mips64.cc |
@@ -1131,18 +1131,22 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( |
break; |
case kMips64Shr: |
if (instr->InputAt(1)->IsRegister()) { |
+ __ sll(i.InputRegister(0), i.InputRegister(0), 0x0); |
__ srlv(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1)); |
} else { |
int64_t imm = i.InputOperand(1).immediate(); |
+ __ sll(i.InputRegister(0), i.InputRegister(0), 0x0); |
__ srl(i.OutputRegister(), i.InputRegister(0), |
static_cast<uint16_t>(imm)); |
} |
break; |
case kMips64Sar: |
if (instr->InputAt(1)->IsRegister()) { |
+ __ sll(i.InputRegister(0), i.InputRegister(0), 0x0); |
__ srav(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1)); |
} else { |
int64_t imm = i.InputOperand(1).immediate(); |
+ __ sll(i.InputRegister(0), i.InputRegister(0), 0x0); |
__ sra(i.OutputRegister(), i.InputRegister(0), |
static_cast<uint16_t>(imm)); |
} |