From: notaz Date: Thu, 10 Aug 2023 17:53:40 +0000 (+0300) Subject: drc: fix reg alloc for div X-Git-Tag: r24l~253 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f0488ffe868b9248935990a708bb71d113e1d80;p=pcsx_rearmed.git drc: fix reg alloc for div libretro/pcsx_rearmed#745 --- 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<