Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: src/compiler/ia32/instruction-selector-ia32.cc

Issue 505713002: [turbofan] Add backend support for signed loads. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix x64. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/ia32/instruction-codes-ia32.h ('k') | src/compiler/instruction.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ia32/instruction-selector-ia32.cc
diff --git a/src/compiler/ia32/instruction-selector-ia32.cc b/src/compiler/ia32/instruction-selector-ia32.cc
index ef7d36a085005981d1aa7305da4b4ac98fd1186c..03f35fe306a86ec27cdc4f33891338de87c03bca 100644
--- a/src/compiler/ia32/instruction-selector-ia32.cc
+++ b/src/compiler/ia32/instruction-selector-ia32.cc
@@ -42,6 +42,7 @@ class IA32OperandGenerator V8_FINAL : public OperandGenerator {
void InstructionSelector::VisitLoad(Node* node) {
MachineType rep = RepresentationOf(OpParameter<MachineType>(node));
+ MachineType typ = TypeOf(OpParameter<MachineType>(node));
IA32OperandGenerator g(this);
Node* base = node->InputAt(0);
Node* index = node->InputAt(1);
@@ -53,18 +54,18 @@ void InstructionSelector::VisitLoad(Node* node) {
// TODO(titzer): signed/unsigned small loads
switch (rep) {
case kRepFloat64:
- opcode = kSSELoad;
+ opcode = kIA32Movsd;
break;
case kRepBit: // Fall through.
case kRepWord8:
- opcode = kIA32LoadWord8;
+ opcode = typ == kTypeInt32 ? kIA32Movsxbl : kIA32Movzxbl;
break;
case kRepWord16:
- opcode = kIA32LoadWord16;
+ opcode = typ == kTypeInt32 ? kIA32Movsxwl : kIA32Movzxwl;
break;
case kRepTagged: // Fall through.
case kRepWord32:
- opcode = kIA32LoadWord32;
+ opcode = kIA32Movl;
break;
default:
UNREACHABLE();
@@ -109,13 +110,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);
@@ -126,18 +125,18 @@ void InstructionSelector::VisitStore(Node* node) {
ArchOpcode opcode;
switch (rep) {
case kRepFloat64:
- opcode = kSSEStore;
+ opcode = kIA32Movsd;
break;
case kRepBit: // Fall through.
case kRepWord8:
- opcode = is_immediate ? kIA32StoreWord8I : kIA32StoreWord8;
+ opcode = kIA32Movb;
break;
case kRepWord16:
- opcode = is_immediate ? kIA32StoreWord16I : kIA32StoreWord16;
+ opcode = kIA32Movw;
break;
case kRepTagged: // Fall through.
case kRepWord32:
- opcode = is_immediate ? kIA32StoreWord32I : kIA32StoreWord32;
+ opcode = kIA32Movl;
break;
default:
UNREACHABLE();
« no previous file with comments | « src/compiler/ia32/instruction-codes-ia32.h ('k') | src/compiler/instruction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698