Commit f7364222 authored by mbrandy's avatar mbrandy Committed by Commit bot

PPC: [turbofan] Exhaustive switches for MachineRepresentation.

Port 739c0187

R=jarin@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=

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

Cr-Commit-Position: refs/heads/master@{#33015}
parent d95511c5
...@@ -165,7 +165,7 @@ void InstructionSelector::VisitLoad(Node* node) { ...@@ -165,7 +165,7 @@ void InstructionSelector::VisitLoad(Node* node) {
PPCOperandGenerator g(this); PPCOperandGenerator g(this);
Node* base = node->InputAt(0); Node* base = node->InputAt(0);
Node* offset = node->InputAt(1); Node* offset = node->InputAt(1);
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
ImmediateMode mode = kInt16Imm; ImmediateMode mode = kInt16Imm;
switch (load_rep.representation()) { switch (load_rep.representation()) {
case MachineRepresentation::kFloat32: case MachineRepresentation::kFloat32:
...@@ -197,9 +197,8 @@ void InstructionSelector::VisitLoad(Node* node) { ...@@ -197,9 +197,8 @@ void InstructionSelector::VisitLoad(Node* node) {
opcode = kPPC_LoadWord64; opcode = kPPC_LoadWord64;
mode = kInt16Imm_4ByteAligned; mode = kInt16Imm_4ByteAligned;
break; break;
#endif #else
#if !V8_TARGET_ARCH_PPC64 case MachineRepresentation::kWord64: // Fall through.
case MachineRepresentation::kWord64:
#endif #endif
case MachineRepresentation::kNone: case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
...@@ -259,7 +258,7 @@ void InstructionSelector::VisitStore(Node* node) { ...@@ -259,7 +258,7 @@ void InstructionSelector::VisitStore(Node* node) {
code |= MiscField::encode(static_cast<int>(record_write_mode)); code |= MiscField::encode(static_cast<int>(record_write_mode));
Emit(code, 0, nullptr, input_count, inputs, temp_count, temps); Emit(code, 0, nullptr, input_count, inputs, temp_count, temps);
} else { } else {
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
ImmediateMode mode = kInt16Imm; ImmediateMode mode = kInt16Imm;
switch (rep) { switch (rep) {
case MachineRepresentation::kFloat32: case MachineRepresentation::kFloat32:
...@@ -287,8 +286,10 @@ void InstructionSelector::VisitStore(Node* node) { ...@@ -287,8 +286,10 @@ void InstructionSelector::VisitStore(Node* node) {
opcode = kPPC_StoreWord64; opcode = kPPC_StoreWord64;
mode = kInt16Imm_4ByteAligned; mode = kInt16Imm_4ByteAligned;
break; break;
#else
case MachineRepresentation::kWord64: // Fall through.
#endif #endif
default: case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
...@@ -312,7 +313,7 @@ void InstructionSelector::VisitCheckedLoad(Node* node) { ...@@ -312,7 +313,7 @@ void InstructionSelector::VisitCheckedLoad(Node* node) {
Node* const base = node->InputAt(0); Node* const base = node->InputAt(0);
Node* const offset = node->InputAt(1); Node* const offset = node->InputAt(1);
Node* const length = node->InputAt(2); Node* const length = node->InputAt(2);
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
switch (load_rep.representation()) { switch (load_rep.representation()) {
case MachineRepresentation::kWord8: case MachineRepresentation::kWord8:
opcode = load_rep.IsSigned() ? kCheckedLoadInt8 : kCheckedLoadUint8; opcode = load_rep.IsSigned() ? kCheckedLoadInt8 : kCheckedLoadUint8;
...@@ -323,16 +324,23 @@ void InstructionSelector::VisitCheckedLoad(Node* node) { ...@@ -323,16 +324,23 @@ void InstructionSelector::VisitCheckedLoad(Node* node) {
case MachineRepresentation::kWord32: case MachineRepresentation::kWord32:
opcode = kCheckedLoadWord32; opcode = kCheckedLoadWord32;
break; break;
#if V8_TARGET_ARCH_PPC64
case MachineRepresentation::kWord64: case MachineRepresentation::kWord64:
opcode = kCheckedLoadWord64; opcode = kCheckedLoadWord64;
break; break;
#endif
case MachineRepresentation::kFloat32: case MachineRepresentation::kFloat32:
opcode = kCheckedLoadFloat32; opcode = kCheckedLoadFloat32;
break; break;
case MachineRepresentation::kFloat64: case MachineRepresentation::kFloat64:
opcode = kCheckedLoadFloat64; opcode = kCheckedLoadFloat64;
break; break;
default: case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kTagged: // Fall through.
#if !V8_TARGET_ARCH_PPC64
case MachineRepresentation::kWord64: // Fall through.
#endif
case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; return;
} }
...@@ -350,7 +358,7 @@ void InstructionSelector::VisitCheckedStore(Node* node) { ...@@ -350,7 +358,7 @@ void InstructionSelector::VisitCheckedStore(Node* node) {
Node* const offset = node->InputAt(1); Node* const offset = node->InputAt(1);
Node* const length = node->InputAt(2); Node* const length = node->InputAt(2);
Node* const value = node->InputAt(3); Node* const value = node->InputAt(3);
ArchOpcode opcode; ArchOpcode opcode = kArchNop;
switch (rep) { switch (rep) {
case MachineRepresentation::kWord8: case MachineRepresentation::kWord8:
opcode = kCheckedStoreWord8; opcode = kCheckedStoreWord8;
...@@ -361,16 +369,23 @@ void InstructionSelector::VisitCheckedStore(Node* node) { ...@@ -361,16 +369,23 @@ void InstructionSelector::VisitCheckedStore(Node* node) {
case MachineRepresentation::kWord32: case MachineRepresentation::kWord32:
opcode = kCheckedStoreWord32; opcode = kCheckedStoreWord32;
break; break;
#if V8_TARGET_ARCH_PPC64
case MachineRepresentation::kWord64: case MachineRepresentation::kWord64:
opcode = kCheckedStoreWord64; opcode = kCheckedStoreWord64;
break; break;
#endif
case MachineRepresentation::kFloat32: case MachineRepresentation::kFloat32:
opcode = kCheckedStoreFloat32; opcode = kCheckedStoreFloat32;
break; break;
case MachineRepresentation::kFloat64: case MachineRepresentation::kFloat64:
opcode = kCheckedStoreFloat64; opcode = kCheckedStoreFloat64;
break; break;
default: case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kTagged: // Fall through.
#if !V8_TARGET_ARCH_PPC64
case MachineRepresentation::kWord64: // Fall through.
#endif
case MachineRepresentation::kNone:
UNREACHABLE(); UNREACHABLE();
return; 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