Commit 67113424 authored by Nico Weber's avatar Nico Weber Committed by V8 LUCI CQ

Fix -Wunreachable-code-aggressive warnings in arm and arm64 code

Like https://chromium-review.googlesource.com/c/v8/v8/+/2994804, but
for arm and arm64.

Bug: chromium:1066980
Change-Id: I5f3ac0d64a5031a62d4923d55a89f1d4e88cbc8b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3103905
Auto-Submit: Nico Weber <thakis@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76374}
parent a9561d16
...@@ -676,7 +676,6 @@ int Decoder::FormatOption(Instruction* instr, const char* format) { ...@@ -676,7 +676,6 @@ int Decoder::FormatOption(Instruction* instr, const char* format) {
} }
default: { default: {
UNREACHABLE(); UNREACHABLE();
return -1;
} }
} }
out_buffer_pos_ += out_buffer_pos_ +=
...@@ -787,7 +786,6 @@ void Decoder::DecodeType01(Instruction* instr) { ...@@ -787,7 +786,6 @@ void Decoder::DecodeType01(Instruction* instr) {
break; break;
default: default:
UNREACHABLE(); UNREACHABLE();
break;
} }
} else { } else {
// strex // strex
...@@ -808,7 +806,6 @@ void Decoder::DecodeType01(Instruction* instr) { ...@@ -808,7 +806,6 @@ void Decoder::DecodeType01(Instruction* instr) {
break; break;
default: default:
UNREACHABLE(); UNREACHABLE();
break;
} }
} }
} else { } else {
...@@ -853,7 +850,6 @@ void Decoder::DecodeType01(Instruction* instr) { ...@@ -853,7 +850,6 @@ void Decoder::DecodeType01(Instruction* instr) {
default: { default: {
// The PU field is a 2-bit field. // The PU field is a 2-bit field.
UNREACHABLE(); UNREACHABLE();
break;
} }
} }
} else { } else {
...@@ -894,7 +890,6 @@ void Decoder::DecodeType01(Instruction* instr) { ...@@ -894,7 +890,6 @@ void Decoder::DecodeType01(Instruction* instr) {
default: { default: {
// The PU field is a 2-bit field. // The PU field is a 2-bit field.
UNREACHABLE(); UNREACHABLE();
break;
} }
} }
return; return;
...@@ -1030,7 +1025,6 @@ void Decoder::DecodeType01(Instruction* instr) { ...@@ -1030,7 +1025,6 @@ void Decoder::DecodeType01(Instruction* instr) {
default: { default: {
// The Opcode field is a 4-bit field. // The Opcode field is a 4-bit field.
UNREACHABLE(); UNREACHABLE();
break;
} }
} }
} }
...@@ -1107,10 +1101,8 @@ void Decoder::DecodeType3(Instruction* instr) { ...@@ -1107,10 +1101,8 @@ void Decoder::DecodeType3(Instruction* instr) {
break; break;
case 1: case 1:
UNREACHABLE(); UNREACHABLE();
break;
case 2: case 2:
UNREACHABLE(); UNREACHABLE();
break;
case 3: case 3:
Format(instr, "usat 'rd, #'imm05@16, 'rm'shift_sat"); Format(instr, "usat 'rd, #'imm05@16, 'rm'shift_sat");
break; break;
...@@ -1119,7 +1111,6 @@ void Decoder::DecodeType3(Instruction* instr) { ...@@ -1119,7 +1111,6 @@ void Decoder::DecodeType3(Instruction* instr) {
switch (instr->Bits(22, 21)) { switch (instr->Bits(22, 21)) {
case 0: case 0:
UNREACHABLE(); UNREACHABLE();
break;
case 1: case 1:
if (instr->Bits(9, 6) == 1) { if (instr->Bits(9, 6) == 1) {
if (instr->Bit(20) == 0) { if (instr->Bit(20) == 0) {
...@@ -1948,7 +1939,6 @@ void Decoder::DecodeFloatingPointDataProcessing(Instruction* instr) { ...@@ -1948,7 +1939,6 @@ void Decoder::DecodeFloatingPointDataProcessing(Instruction* instr) {
break; break;
default: default:
UNREACHABLE(); // Case analysis is exhaustive. UNREACHABLE(); // Case analysis is exhaustive.
break;
} }
} else if (instr->Opc1Value() == 0x4 && op2) { } else if (instr->Opc1Value() == 0x4 && op2) {
// Floating-point minNum/maxNum. // Floating-point minNum/maxNum.
...@@ -2002,7 +1992,6 @@ void Decoder::DecodeFloatingPointDataProcessing(Instruction* instr) { ...@@ -2002,7 +1992,6 @@ void Decoder::DecodeFloatingPointDataProcessing(Instruction* instr) {
break; break;
default: default:
UNREACHABLE(); // Case analysis is exhaustive. UNREACHABLE(); // Case analysis is exhaustive.
break;
} }
} else { } else {
Unknown(instr); Unknown(instr);
...@@ -2617,12 +2606,10 @@ const char* NameConverter::NameOfCPURegister(int reg) const { ...@@ -2617,12 +2606,10 @@ const char* NameConverter::NameOfCPURegister(int reg) const {
const char* NameConverter::NameOfByteCPURegister(int reg) const { const char* NameConverter::NameOfByteCPURegister(int reg) const {
UNREACHABLE(); // ARM does not have the concept of a byte register UNREACHABLE(); // ARM does not have the concept of a byte register
return "nobytereg";
} }
const char* NameConverter::NameOfXMMRegister(int reg) const { const char* NameConverter::NameOfXMMRegister(int reg) const {
UNREACHABLE(); // ARM does not have any XMM registers UNREACHABLE(); // ARM does not have any XMM registers
return "noxmmreg";
} }
const char* NameConverter::NameInCode(byte* addr) const { const char* NameConverter::NameInCode(byte* addr) const {
......
...@@ -37,7 +37,6 @@ int EhFrameWriter::RegisterToDwarfCode(Register name) { ...@@ -37,7 +37,6 @@ int EhFrameWriter::RegisterToDwarfCode(Register name) {
return kR0DwarfCode; return kR0DwarfCode;
default: default:
UNIMPLEMENTED(); UNIMPLEMENTED();
return -1;
} }
} }
...@@ -54,7 +53,6 @@ const char* EhFrameDisassembler::DwarfRegisterCodeToString(int code) { ...@@ -54,7 +53,6 @@ const char* EhFrameDisassembler::DwarfRegisterCodeToString(int code) {
return "lr"; return "lr";
default: default:
UNIMPLEMENTED(); UNIMPLEMENTED();
return nullptr;
} }
} }
......
...@@ -3954,7 +3954,6 @@ int DisassemblingDecoder::SubstituteImmediateField(Instruction* instr, ...@@ -3954,7 +3954,6 @@ int DisassemblingDecoder::SubstituteImmediateField(Instruction* instr,
} }
default: { default: {
UNIMPLEMENTED(); UNIMPLEMENTED();
return 0;
} }
} }
} }
...@@ -3997,7 +3996,6 @@ int DisassemblingDecoder::SubstituteImmediateField(Instruction* instr, ...@@ -3997,7 +3996,6 @@ int DisassemblingDecoder::SubstituteImmediateField(Instruction* instr,
return 0; return 0;
} }
UNIMPLEMENTED(); UNIMPLEMENTED();
return 0;
} }
case 'L': { // IVLSLane[0123] - suffix indicates access size shift. case 'L': { // IVLSLane[0123] - suffix indicates access size shift.
AppendToOutput("%d", instr->NEONLSIndex(format[8] - '0')); AppendToOutput("%d", instr->NEONLSIndex(format[8] - '0'));
...@@ -4042,12 +4040,10 @@ int DisassemblingDecoder::SubstituteImmediateField(Instruction* instr, ...@@ -4042,12 +4040,10 @@ int DisassemblingDecoder::SubstituteImmediateField(Instruction* instr,
return static_cast<int>(strlen("IVMIShiftAmt2")); return static_cast<int>(strlen("IVMIShiftAmt2"));
} else { } else {
UNIMPLEMENTED(); UNIMPLEMENTED();
return 0;
} }
} }
default: { default: {
UNIMPLEMENTED(); UNIMPLEMENTED();
return 0;
} }
} }
} }
...@@ -4342,12 +4338,10 @@ const char* NameConverter::NameOfCPURegister(int reg) const { ...@@ -4342,12 +4338,10 @@ const char* NameConverter::NameOfCPURegister(int reg) const {
const char* NameConverter::NameOfByteCPURegister(int reg) const { const char* NameConverter::NameOfByteCPURegister(int reg) const {
UNREACHABLE(); // ARM64 does not have the concept of a byte register UNREACHABLE(); // ARM64 does not have the concept of a byte register
return "nobytereg";
} }
const char* NameConverter::NameOfXMMRegister(int reg) const { const char* NameConverter::NameOfXMMRegister(int reg) const {
UNREACHABLE(); // ARM64 does not have any XMM registers UNREACHABLE(); // ARM64 does not have any XMM registers
return "noxmmreg";
} }
const char* NameConverter::NameInCode(byte* addr) const { const char* NameConverter::NameInCode(byte* addr) const {
......
...@@ -38,7 +38,6 @@ int EhFrameWriter::RegisterToDwarfCode(Register name) { ...@@ -38,7 +38,6 @@ int EhFrameWriter::RegisterToDwarfCode(Register name) {
return kX0DwarfCode; return kX0DwarfCode;
default: default:
UNIMPLEMENTED(); UNIMPLEMENTED();
return -1;
} }
} }
......
This diff is collapsed.
...@@ -1517,7 +1517,6 @@ void Simulator::VisitPCRelAddressing(Instruction* instr) { ...@@ -1517,7 +1517,6 @@ void Simulator::VisitPCRelAddressing(Instruction* instr) {
break; break;
case ADRP: // Not implemented in the assembler. case ADRP: // Not implemented in the assembler.
UNIMPLEMENTED(); UNIMPLEMENTED();
break;
default: default:
UNREACHABLE(); UNREACHABLE();
} }
...@@ -2212,7 +2211,6 @@ Simulator::TransactionSize Simulator::get_transaction_size(unsigned size) { ...@@ -2212,7 +2211,6 @@ Simulator::TransactionSize Simulator::get_transaction_size(unsigned size) {
default: default:
UNREACHABLE(); UNREACHABLE();
} }
return TransactionSize::None;
} }
void Simulator::VisitLoadStoreAcquireRelease(Instruction* instr) { void Simulator::VisitLoadStoreAcquireRelease(Instruction* instr) {
...@@ -5210,7 +5208,6 @@ void Simulator::VisitNEONScalar2RegMisc(Instruction* instr) { ...@@ -5210,7 +5208,6 @@ void Simulator::VisitNEONScalar2RegMisc(Instruction* instr) {
break; break;
default: default:
UNIMPLEMENTED(); UNIMPLEMENTED();
break;
} }
} else { } else {
VectorFormat fpf = nfd.GetVectorFormat(nfd.FPScalarFormatMap()); VectorFormat fpf = nfd.GetVectorFormat(nfd.FPScalarFormatMap());
......
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