Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence unhandled case warns #823

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/shader_recompiler/frontend/decode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ uint32_t GcnDecodeContext::getEncodingLength(InstEncoding encoding) {
case InstEncoding::EXP:
instLength = sizeof(uint64_t);
break;
default:
break;
}
return instLength;
}
Expand Down Expand Up @@ -217,6 +219,8 @@ uint32_t GcnDecodeContext::getOpMapOffset(InstEncoding encoding) {
case InstEncoding::VOP2:
offset = (uint32_t)OpcodeMap::OP_MAP_VOP2;
break;
default:
break;
}
return offset;
}
Expand Down Expand Up @@ -311,6 +315,8 @@ void GcnDecodeContext::repairOperandType() {
case Opcode::IMAGE_GATHER4_C:
m_instruction.src[0].type = ScalarType::Any;
break;
default:
break;
}
}

Expand Down Expand Up @@ -363,6 +369,8 @@ void GcnDecodeContext::decodeInstruction32(InstEncoding encoding, GcnCodeSlice&
case InstEncoding::VINTRP:
decodeInstructionVINTRP(hexInstruction);
break;
default:
break;
}
}

Expand All @@ -387,6 +395,8 @@ void GcnDecodeContext::decodeInstruction64(InstEncoding encoding, GcnCodeSlice&
case InstEncoding::EXP:
decodeInstructionEXP(hexInstruction);
break;
default:
break;
}
}

Expand Down Expand Up @@ -995,6 +1005,8 @@ u32 GcnDecodeContext::getMimgModifier(Opcode opcode) {
flags.set(MimgModifier::Pcf, MimgModifier::CoarseDerivative, MimgModifier::LodClamp,
MimgModifier::Offset);
break;
default:
break;
}

return flags.raw();
Expand Down
2 changes: 2 additions & 0 deletions src/shader_recompiler/frontend/format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3718,6 +3718,8 @@ InstFormat InstructionFormat(InstEncoding encoding, uint32_t opcode) {
return InstructionFormatSOP2[opcode];
case InstEncoding::VOP2:
return InstructionFormatVOP2[opcode];
default:
return {};
}
UNREACHABLE();
return {};
Expand Down
2 changes: 2 additions & 0 deletions src/shader_recompiler/ir/ir_emitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,8 @@ U16U32U64 IREmitter::UConvert(size_t result_bitsize, const U16U32U64& value) {
switch (value.Type()) {
case Type::U16:
return Inst<U32>(Opcode::ConvertU32U16, value);
default:
break;
}
default:
break;
Expand Down
1 change: 1 addition & 0 deletions src/shader_recompiler/ir/value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ bool Value::operator==(const Value& other) const {
case Type::F64x2:
case Type::F64x3:
case Type::F64x4:
default:
break;
}
UNREACHABLE_MSG("Invalid type {}", type);
Expand Down
Loading