Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
b3ecbb815b [shader_recompiler/Maxwell] Fix ISBERD shift operation 2025-07-30 09:42:01 +00:00
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);
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;
}

View file

@ -46,7 +46,18 @@ void TranslatorVisitor::ISBERD(u64 insn) {
throw NotImplementedException("Mode {}", isberd.mode.Value());
}
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);
if (isberd.src_reg_num == 0xFF) {