Index: src/compiler/x64/instruction-selector-x64.cc |
diff --git a/src/compiler/x64/instruction-selector-x64.cc b/src/compiler/x64/instruction-selector-x64.cc |
index 1dad9ee863ae144b887f856d5bdff5afabb40d4f..138a63d7f7bdac4ece457b603a3bcbe8ecda2394 100644 |
--- a/src/compiler/x64/instruction-selector-x64.cc |
+++ b/src/compiler/x64/instruction-selector-x64.cc |
@@ -57,6 +57,7 @@ class X64OperandGenerator V8_FINAL : public OperandGenerator { |
void InstructionSelector::VisitLoad(Node* node) { |
MachineType rep = RepresentationOf(OpParameter<MachineType>(node)); |
+ MachineType typ = TypeOf(OpParameter<MachineType>(node)); |
X64OperandGenerator g(this); |
Node* base = node->InputAt(0); |
Node* index = node->InputAt(1); |
@@ -68,21 +69,21 @@ void InstructionSelector::VisitLoad(Node* node) { |
// TODO(titzer): signed/unsigned small loads |
switch (rep) { |
case kRepFloat64: |
- opcode = kSSELoad; |
+ opcode = kX64Movsd; |
break; |
case kRepBit: // Fall through. |
case kRepWord8: |
- opcode = kX64LoadWord8; |
+ opcode = typ == kTypeInt32 ? kX64Movsxbl : kX64Movzxbl; |
break; |
case kRepWord16: |
- opcode = kX64LoadWord16; |
+ opcode = typ == kTypeInt32 ? kX64Movsxwl : kX64Movzxwl; |
break; |
case kRepWord32: |
- opcode = kX64LoadWord32; |
+ opcode = kX64Movl; |
break; |
case kRepTagged: // Fall through. |
case kRepWord64: |
- opcode = kX64LoadWord64; |
+ opcode = kX64Movq; |
break; |
default: |
UNREACHABLE(); |
@@ -123,13 +124,11 @@ void InstructionSelector::VisitStore(Node* node) { |
return; |
} |
DCHECK_EQ(kNoWriteBarrier, store_rep.write_barrier_kind); |
- bool is_immediate = false; |
InstructionOperand* val; |
if (rep == kRepFloat64) { |
val = g.UseDoubleRegister(value); |
} else { |
- is_immediate = g.CanBeImmediate(value); |
- if (is_immediate) { |
+ if (g.CanBeImmediate(value)) { |
val = g.UseImmediate(value); |
} else if (rep == kRepWord8 || rep == kRepBit) { |
val = g.UseByteRegister(value); |
@@ -140,21 +139,21 @@ void InstructionSelector::VisitStore(Node* node) { |
ArchOpcode opcode; |
switch (rep) { |
case kRepFloat64: |
- opcode = kSSEStore; |
+ opcode = kX64Movsd; |
break; |
case kRepBit: // Fall through. |
case kRepWord8: |
- opcode = is_immediate ? kX64StoreWord8I : kX64StoreWord8; |
+ opcode = kX64Movb; |
break; |
case kRepWord16: |
- opcode = is_immediate ? kX64StoreWord16I : kX64StoreWord16; |
+ opcode = kX64Movw; |
break; |
case kRepWord32: |
- opcode = is_immediate ? kX64StoreWord32I : kX64StoreWord32; |
+ opcode = kX64Movl; |
break; |
case kRepTagged: // Fall through. |
case kRepWord64: |
- opcode = is_immediate ? kX64StoreWord64I : kX64StoreWord64; |
+ opcode = kX64Movq; |
break; |
default: |
UNREACHABLE(); |