From 4ee246ed0e02c61f0b33251d86ea74a4a0380a47 Mon Sep 17 00:00:00 2001 From: notaz Date: Thu, 10 Aug 2023 20:53:40 +0300 Subject: [PATCH] drc: fix reg alloc for div libretro/pcsx_rearmed#745 --- libpcsxcore/new_dynarec/new_dynarec.c | 30 +++++++++------------------ 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/libpcsxcore/new_dynarec/new_dynarec.c b/libpcsxcore/new_dynarec/new_dynarec.c index 37bdc3e7..d7c24365 100644 --- a/libpcsxcore/new_dynarec/new_dynarec.c +++ b/libpcsxcore/new_dynarec/new_dynarec.c @@ -2114,28 +2114,18 @@ static void multdiv_alloc(struct regstat *current,int i) clear_const(current,dops[i].rs2); alloc_cc(current,i); // for stalls dirty_reg(current,CCREG); - if(dops[i].rs1&&dops[i].rs2) + current->u &= ~(1ull << HIREG); + current->u &= ~(1ull << LOREG); + alloc_reg(current, i, HIREG); + alloc_reg(current, i, LOREG); + dirty_reg(current, HIREG); + dirty_reg(current, LOREG); + if ((dops[i].opcode2 & 0x3e) == 0x1a || (dops[i].rs1 && dops[i].rs2)) // div(u) { - current->u&=~(1LL<u&=~(1LL<