Commit 656a6879 authored by Zhao Jiazhong's avatar Zhao Jiazhong Committed by Commit Bot

[mips] Support unaligned loading and storing kWord8 value

Change-Id: Ib5728e22815339096dec72cc3a6d8732da436062
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2437514Reviewed-by: 's avatarZhi An Ng <zhin@chromium.org>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#70211}
parent d8a36591
...@@ -1388,9 +1388,9 @@ void InstructionSelector::VisitUnalignedLoad(Node* node) { ...@@ -1388,9 +1388,9 @@ void InstructionSelector::VisitUnalignedLoad(Node* node) {
ArchOpcode opcode = kArchNop; ArchOpcode opcode = kArchNop;
switch (load_rep.representation()) { switch (load_rep.representation()) {
case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kWord8: case MachineRepresentation::kWord8:
UNREACHABLE(); opcode = load_rep.IsUnsigned() ? kMipsLbu : kMipsLb;
break;
case MachineRepresentation::kWord16: case MachineRepresentation::kWord16:
opcode = load_rep.IsUnsigned() ? kMipsUlhu : kMipsUlh; opcode = load_rep.IsUnsigned() ? kMipsUlhu : kMipsUlh;
break; break;
...@@ -1409,6 +1409,7 @@ void InstructionSelector::VisitUnalignedLoad(Node* node) { ...@@ -1409,6 +1409,7 @@ void InstructionSelector::VisitUnalignedLoad(Node* node) {
case MachineRepresentation::kSimd128: case MachineRepresentation::kSimd128:
opcode = kMipsMsaLd; opcode = kMipsMsaLd;
break; break;
case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through. case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through. case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kWord64: // Fall through. case MachineRepresentation::kWord64: // Fall through.
...@@ -1446,9 +1447,9 @@ void InstructionSelector::VisitUnalignedStore(Node* node) { ...@@ -1446,9 +1447,9 @@ void InstructionSelector::VisitUnalignedStore(Node* node) {
case MachineRepresentation::kFloat64: case MachineRepresentation::kFloat64:
opcode = kMipsUsdc1; opcode = kMipsUsdc1;
break; break;
case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kWord8: case MachineRepresentation::kWord8:
UNREACHABLE(); opcode = kMipsSb;
break;
case MachineRepresentation::kWord16: case MachineRepresentation::kWord16:
opcode = kMipsUsh; opcode = kMipsUsh;
break; break;
...@@ -1461,6 +1462,7 @@ void InstructionSelector::VisitUnalignedStore(Node* node) { ...@@ -1461,6 +1462,7 @@ void InstructionSelector::VisitUnalignedStore(Node* node) {
case MachineRepresentation::kSimd128: case MachineRepresentation::kSimd128:
opcode = kMipsMsaSt; opcode = kMipsMsaSt;
break; break;
case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through. case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through. case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kWord64: // Fall through. case MachineRepresentation::kWord64: // Fall through.
......
...@@ -1754,9 +1754,9 @@ void InstructionSelector::VisitUnalignedLoad(Node* node) { ...@@ -1754,9 +1754,9 @@ void InstructionSelector::VisitUnalignedLoad(Node* node) {
case MachineRepresentation::kFloat64: case MachineRepresentation::kFloat64:
opcode = kMips64Uldc1; opcode = kMips64Uldc1;
break; break;
case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kWord8: case MachineRepresentation::kWord8:
UNREACHABLE(); opcode = load_rep.IsUnsigned() ? kMips64Lbu : kMips64Lb;
break;
case MachineRepresentation::kWord16: case MachineRepresentation::kWord16:
opcode = load_rep.IsUnsigned() ? kMips64Ulhu : kMips64Ulh; opcode = load_rep.IsUnsigned() ? kMips64Ulhu : kMips64Ulh;
break; break;
...@@ -1772,6 +1772,7 @@ void InstructionSelector::VisitUnalignedLoad(Node* node) { ...@@ -1772,6 +1772,7 @@ void InstructionSelector::VisitUnalignedLoad(Node* node) {
case MachineRepresentation::kSimd128: case MachineRepresentation::kSimd128:
opcode = kMips64MsaLd; opcode = kMips64MsaLd;
break; break;
case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through. case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through. case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kNone: case MachineRepresentation::kNone:
...@@ -1806,9 +1807,9 @@ void InstructionSelector::VisitUnalignedStore(Node* node) { ...@@ -1806,9 +1807,9 @@ void InstructionSelector::VisitUnalignedStore(Node* node) {
case MachineRepresentation::kFloat64: case MachineRepresentation::kFloat64:
opcode = kMips64Usdc1; opcode = kMips64Usdc1;
break; break;
case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kWord8: case MachineRepresentation::kWord8:
UNREACHABLE(); opcode = kMips64Sb;
break;
case MachineRepresentation::kWord16: case MachineRepresentation::kWord16:
opcode = kMips64Ush; opcode = kMips64Ush;
break; break;
...@@ -1824,6 +1825,7 @@ void InstructionSelector::VisitUnalignedStore(Node* node) { ...@@ -1824,6 +1825,7 @@ void InstructionSelector::VisitUnalignedStore(Node* node) {
case MachineRepresentation::kSimd128: case MachineRepresentation::kSimd128:
opcode = kMips64MsaSt; opcode = kMips64MsaSt;
break; break;
case MachineRepresentation::kBit: // Fall through.
case MachineRepresentation::kCompressedPointer: // Fall through. case MachineRepresentation::kCompressedPointer: // Fall through.
case MachineRepresentation::kCompressed: // Fall through. case MachineRepresentation::kCompressed: // Fall through.
case MachineRepresentation::kNone: case MachineRepresentation::kNone:
......
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