Commit eb5ecd83 authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

X87: [turbofan] Exhaustive switches for MachineRepresentation.

  port 739c0187 (r33011)

  original commit message:

BUG=

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

Cr-Commit-Position: refs/heads/master@{#33018}
parent a1c2e402
......@@ -132,7 +132,7 @@ class X87OperandGenerator final : public OperandGenerator {
void InstructionSelector::VisitLoad(Node* node) {
LoadRepresentation load_rep = LoadRepresentationOf(node->op());
ArchOpcode opcode;
ArchOpcode opcode = kArchNop;
switch (load_rep.representation()) {
case MachineRepresentation::kFloat32:
opcode = kX87Movss;
......@@ -151,7 +151,8 @@ void InstructionSelector::VisitLoad(Node* node) {
case MachineRepresentation::kWord32:
opcode = kX87Movl;
break;
default:
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE();
return;
}
......@@ -216,7 +217,7 @@ void InstructionSelector::VisitStore(Node* node) {
code |= MiscField::encode(static_cast<int>(record_write_mode));
Emit(code, 0, nullptr, input_count, inputs, temp_count, temps);
} else {
ArchOpcode opcode;
ArchOpcode opcode = kArchNop;
switch (rep) {
case MachineRepresentation::kFloat32:
opcode = kX87Movss;
......@@ -235,7 +236,8 @@ void InstructionSelector::VisitStore(Node* node) {
case MachineRepresentation::kWord32:
opcode = kX87Movl;
break;
default:
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE();
return;
}
......@@ -268,7 +270,7 @@ void InstructionSelector::VisitCheckedLoad(Node* node) {
Node* const buffer = node->InputAt(0);
Node* const offset = node->InputAt(1);
Node* const length = node->InputAt(2);
ArchOpcode opcode;
ArchOpcode opcode = kArchNop;
switch (load_rep.representation()) {
case MachineRepresentation::kWord8:
opcode = load_rep.IsSigned() ? kCheckedLoadInt8 : kCheckedLoadUint8;
......@@ -285,7 +287,10 @@ void InstructionSelector::VisitCheckedLoad(Node* node) {
case MachineRepresentation::kFloat64:
opcode = kCheckedLoadFloat64;
break;
default:
case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kTagged: // Fall through.
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE();
return;
}
......@@ -311,7 +316,7 @@ void InstructionSelector::VisitCheckedStore(Node* node) {
Node* const offset = node->InputAt(1);
Node* const length = node->InputAt(2);
Node* const value = node->InputAt(3);
ArchOpcode opcode;
ArchOpcode opcode = kArchNop;
switch (rep) {
case MachineRepresentation::kWord8:
opcode = kCheckedStoreWord8;
......@@ -328,7 +333,10 @@ void InstructionSelector::VisitCheckedStore(Node* node) {
case MachineRepresentation::kFloat64:
opcode = kCheckedStoreFloat64;
break;
default:
case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kTagged: // Fall through.
case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kNone:
UNREACHABLE();
return;
}
......
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