Commit 125d31ec authored by titzer's avatar titzer Committed by Commit bot

[turbofan] Address minor TODOs in instruction selector.

R=dcarney@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1029383002

Cr-Commit-Position: refs/heads/master@{#27410}
parent 9ac4ab79
...@@ -17,10 +17,15 @@ class IA32OperandGenerator FINAL : public OperandGenerator { ...@@ -17,10 +17,15 @@ class IA32OperandGenerator FINAL : public OperandGenerator {
: OperandGenerator(selector) {} : OperandGenerator(selector) {}
InstructionOperand UseByteRegister(Node* node) { InstructionOperand UseByteRegister(Node* node) {
// TODO(dcarney): relax constraint. // TODO(titzer): encode byte register use constraints.
return UseFixed(node, edx); return UseFixed(node, edx);
} }
InstructionOperand DefineAsByteRegister(Node* node) {
// TODO(titzer): encode byte register def constraints.
return DefineAsRegister(node);
}
bool CanBeImmediate(Node* node) { bool CanBeImmediate(Node* node) {
switch (node->opcode()) { switch (node->opcode()) {
case IrOpcode::kInt32Constant: case IrOpcode::kInt32Constant:
...@@ -132,7 +137,6 @@ void InstructionSelector::VisitLoad(Node* node) { ...@@ -132,7 +137,6 @@ void InstructionSelector::VisitLoad(Node* node) {
MachineType typ = TypeOf(OpParameter<LoadRepresentation>(node)); MachineType typ = TypeOf(OpParameter<LoadRepresentation>(node));
ArchOpcode opcode; ArchOpcode opcode;
// TODO(titzer): signed/unsigned small loads
switch (rep) { switch (rep) {
case kRepFloat32: case kRepFloat32:
opcode = kIA32Movss; opcode = kIA32Movss;
...@@ -366,8 +370,7 @@ static void VisitBinop(InstructionSelector* selector, Node* node, ...@@ -366,8 +370,7 @@ static void VisitBinop(InstructionSelector* selector, Node* node,
outputs[output_count++] = g.DefineSameAsFirst(node); outputs[output_count++] = g.DefineSameAsFirst(node);
if (cont->IsSet()) { if (cont->IsSet()) {
// TODO(turbofan): Use byte register here. outputs[output_count++] = g.DefineAsByteRegister(cont->result());
outputs[output_count++] = g.DefineAsRegister(cont->result());
} }
DCHECK_NE(0u, input_count); DCHECK_NE(0u, input_count);
...@@ -825,8 +828,7 @@ void VisitCompare(InstructionSelector* selector, InstructionCode opcode, ...@@ -825,8 +828,7 @@ void VisitCompare(InstructionSelector* selector, InstructionCode opcode,
g.Label(cont->true_block()), g.Label(cont->false_block())); g.Label(cont->true_block()), g.Label(cont->false_block()));
} else { } else {
DCHECK(cont->IsSet()); DCHECK(cont->IsSet());
// TODO(titzer): Needs byte register. selector->Emit(cont->Encode(opcode), g.DefineAsByteRegister(cont->result()),
selector->Emit(cont->Encode(opcode), g.DefineAsRegister(cont->result()),
left, right); left, right);
} }
} }
......
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