Index: src/compiler/x64/code-generator-x64.cc |
diff --git a/src/compiler/x64/code-generator-x64.cc b/src/compiler/x64/code-generator-x64.cc |
index a867f4a72c880e0211859ec7e8ac2996d64dc8d0..8a61d371bffed90e013b224aa674927407e9b63a 100644 |
--- a/src/compiler/x64/code-generator-x64.cc |
+++ b/src/compiler/x64/code-generator-x64.cc |
@@ -484,6 +484,7 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
break; |
case kX64Movsxbl: |
__ movsxbl(i.OutputRegister(), i.MemoryOperand()); |
+ __ AssertZeroExtended(i.OutputRegister()); |
break; |
case kX64Movzxbl: |
__ movzxbl(i.OutputRegister(), i.MemoryOperand()); |
@@ -499,10 +500,18 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
break; |
} |
case kX64Movsxwl: |
- __ movsxwl(i.OutputRegister(), i.MemoryOperand()); |
+ if (instr->addressing_mode() != kMode_None) { |
+ __ movsxwl(i.OutputRegister(), i.MemoryOperand()); |
+ } else if (instr->InputAt(0)->IsRegister()) { |
+ __ movsxwl(i.OutputRegister(), i.InputRegister(0)); |
+ } else { |
+ __ movsxwl(i.OutputRegister(), i.InputOperand(0)); |
+ } |
+ __ AssertZeroExtended(i.OutputRegister()); |
break; |
case kX64Movzxwl: |
__ movzxwl(i.OutputRegister(), i.MemoryOperand()); |
+ __ AssertZeroExtended(i.OutputRegister()); |
break; |
case kX64Movw: { |
int index = 0; |
@@ -525,6 +534,7 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
} else { |
__ movl(i.OutputRegister(), i.MemoryOperand()); |
} |
+ __ AssertZeroExtended(i.OutputRegister()); |
} else { |
int index = 0; |
Operand operand = i.MemoryOperand(&index); |
@@ -576,6 +586,7 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
break; |
case kX64Lea32: |
__ leal(i.OutputRegister(), i.MemoryOperand()); |
+ __ AssertZeroExtended(i.OutputRegister()); |
break; |
case kX64Lea: |
__ leaq(i.OutputRegister(), i.MemoryOperand()); |