From 0400bea3bd4baef97db74b4b07358d603f2f5dac Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 19 Mar 2021 17:15:28 +0100 Subject: [DYNAREC] Added 0F 90..9F SETcc Eb opcode, and fixed GETEB macro (but WorldOfGoo still broken, didn't test the others --- src/dynarec/dynarec_arm64_0f.c | 23 +++++++++++++++++++++++ src/dynarec/dynarec_arm64_helper.h | 6 +++--- 2 files changed, 26 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/dynarec/dynarec_arm64_0f.c b/src/dynarec/dynarec_arm64_0f.c index afc0ce34..6509050d 100755 --- a/src/dynarec/dynarec_arm64_0f.c +++ b/src/dynarec/dynarec_arm64_0f.c @@ -128,6 +128,29 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin GOCOND(0x80, "J", "Id"); #undef GO + + #define GO(GETFLAGS, NO, YES, F) \ + READFLAGS(F); \ + GETFLAGS; \ + nextop=F8; \ + CSETw(x3, YES); \ + if(MODREG) { \ + if(rex.rex) { \ + eb1= xRAX+(nextop&7)+(rex.b<<3); \ + eb2 = 0; \ + } else { \ + ed = (nextop&7); \ + eb2 = (ed>>2)*8; \ + eb1 = xRAX+(ed&3); \ + } \ + BFIx(eb1, x3, eb2, 8); \ + } else { \ + addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0xfff, 0, rex, 0, 0); \ + STRB_U12(x3, ed, fixedaddress); \ + } + + GOCOND(0x90, "SET", "Eb"); + #undef GO case 0xBB: INST_NAME("BTC Ed, Gd"); diff --git a/src/dynarec/dynarec_arm64_helper.h b/src/dynarec/dynarec_arm64_helper.h index b7ef4a6a..9ef851d5 100755 --- a/src/dynarec/dynarec_arm64_helper.h +++ b/src/dynarec/dynarec_arm64_helper.h @@ -144,14 +144,14 @@ //GETEB will use i for ed, and can use r3 for wback. #define GETEB(i, D) if(MODREG) { \ if(rex.rex) { \ - wback = xRAX+(nextop&7)+(rex.r<<3); \ + wback = xRAX+(nextop&7)+(rex.b<<3); \ wb2 = 0; \ } else { \ wback = (nextop&7); \ wb2 = (wback>>2)*8; \ wback = xRAX+(wback&3); \ } \ - UBFMw(i, wback, wb2, 7); \ + UBFXx(i, wback, wb2, 8); \ wb1 = 0; \ ed = i; \ } else { \ @@ -165,7 +165,7 @@ wback = (nextop&7); \ wb2 = (wback>>2); \ wback = xEAX+(wback&3); \ - UXTB(i, wback, wb2); \ + UBFXx(i, wback, wb2, 8);\ wb1 = 0; \ ed = i; \ } else { \ -- cgit 1.4.1