[mips] Support unaligned loading and storing kWord8 value

Change-Id: Ib5728e22815339096dec72cc3a6d8732da436062
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2437514
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#70211}
This commit is contained in:
Zhao Jiazhong 2020-09-29 08:26:07 -04:00 committed by Commit Bot
parent d8a36591ed
commit 656a687902
2 changed files with 12 additions and 8 deletions

View File

@ -1388,9 +1388,9 @@ void InstructionSelector::VisitUnalignedLoad(Node* node) {
ArchOpcode opcode = kArchNop;
switch (load_rep.representation()) {
case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kWord8:
UNREACHABLE();
opcode = load_rep.IsUnsigned() ? kMipsLbu : kMipsLb;
break;
case MachineRepresentation::kWord16:
opcode = load_rep.IsUnsigned() ? kMipsUlhu : kMipsUlh;
break;
@ -1409,6 +1409,7 @@ void InstructionSelector::VisitUnalignedLoad(Node* node) {
case MachineRepresentation::kSimd128:
opcode = kMipsMsaLd;
break;
case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kWord64: // Fall through.
@ -1446,9 +1447,9 @@ void InstructionSelector::VisitUnalignedStore(Node* node) {
case MachineRepresentation::kFloat64:
opcode = kMipsUsdc1;
break;
case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kWord8:
UNREACHABLE();
opcode = kMipsSb;
break;
case MachineRepresentation::kWord16:
opcode = kMipsUsh;
break;
@ -1461,6 +1462,7 @@ void InstructionSelector::VisitUnalignedStore(Node* node) {
case MachineRepresentation::kSimd128:
opcode = kMipsMsaSt;
break;
case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kWord64: // Fall through.

View File

@ -1754,9 +1754,9 @@ void InstructionSelector::VisitUnalignedLoad(Node* node) {
case MachineRepresentation::kFloat64:
opcode = kMips64Uldc1;
break;
case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kWord8:
UNREACHABLE();
opcode = load_rep.IsUnsigned() ? kMips64Lbu : kMips64Lb;
break;
case MachineRepresentation::kWord16:
opcode = load_rep.IsUnsigned() ? kMips64Ulhu : kMips64Ulh;
break;
@ -1772,6 +1772,7 @@ void InstructionSelector::VisitUnalignedLoad(Node* node) {
case MachineRepresentation::kSimd128:
opcode = kMips64MsaLd;
break;
case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kNone:
@ -1806,9 +1807,9 @@ void InstructionSelector::VisitUnalignedStore(Node* node) {
case MachineRepresentation::kFloat64:
opcode = kMips64Usdc1;
break;
case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kWord8:
UNREACHABLE();
opcode = kMips64Sb;
break;
case MachineRepresentation::kWord16:
opcode = kMips64Ush;
break;
@ -1824,6 +1825,7 @@ void InstructionSelector::VisitUnalignedStore(Node* node) {
case MachineRepresentation::kSimd128:
opcode = kMips64MsaSt;
break;
case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kNone: