[shader_recompiler/Maxwell] Fix ISBERD shift operation

This commit is contained in:
SDK Chan 2025-07-30 09:42:01 +00:00
parent e4953d5866
commit b3ecbb815b
2 changed files with 13 additions and 2 deletions

View file

@ -34,7 +34,7 @@ void HosBinderDriverServer::AdjustRefcount(s32 binder_id, s32 delta, bool is_wea
auto search_rc = refcounts.find(binder_id); auto search_rc = refcounts.find(binder_id);
if (search_rc == refcounts.end()) { if (search_rc == refcounts.end()) {
LOG_WARNING(Service_VI, "AdjustRefcount called for unknown binder id {}", binder_id); // LOG_WARNING(Service_VI, "AdjustRefcount called for unknown binder id {}", binder_id);
return; return;
} }

View file

@ -46,7 +46,18 @@ void TranslatorVisitor::ISBERD(u64 insn) {
throw NotImplementedException("Mode {}", isberd.mode.Value()); throw NotImplementedException("Mode {}", isberd.mode.Value());
} }
if (isberd.shift != Shift::Default) { if (isberd.shift != Shift::Default) {
throw NotImplementedException("Shift {}", isberd.shift.Value()); IR::U32 offset{};
IR::U32 result{};
switch(static_cast<u64>(isberd.shift.Value())) {
case static_cast<u64>(Shift::U16):
offset = static_cast<IR::U32>(ir.ShiftLeftLogical(X(isberd.src_reg), ir.Imm32(1)));
break;
case static_cast<u64>(Shift::B32):
offset = static_cast<IR::U32>(ir.ShiftLeftLogical(X(isberd.src_reg), ir.Imm32(2)));
break;
}
result = ir.IAdd(X(isberd.src_reg), offset);
X(isberd.dest_reg, result);
} }
//LOG_DEBUG(Shader, "(STUBBED) called {}", insn); //LOG_DEBUG(Shader, "(STUBBED) called {}", insn);
if (isberd.src_reg_num == 0xFF) { if (isberd.src_reg_num == 0xFF) {