From e7c0480bc32e0f3f569a677318a6c94f2c7ecd94 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sat, 18 Mar 2023 07:44:18 +0000 Subject: [RV64_DYNAREC] Added 0F B6/B7 MOVZX opcodes --- src/dynarec/rv64/dynarec_rv64_0f.c | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'src') diff --git a/src/dynarec/rv64/dynarec_rv64_0f.c b/src/dynarec/rv64/dynarec_rv64_0f.c index ed4d3c64..51e2784a 100644 --- a/src/dynarec/rv64/dynarec_rv64_0f.c +++ b/src/dynarec/rv64/dynarec_rv64_0f.c @@ -306,6 +306,47 @@ uintptr_t dynarec64_0F(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni } } break; + + case 0xB6: + INST_NAME("MOVZX Gd, Eb"); + nextop = F8; + GETGD; + if(MODREG) { + if(rex.rex) { + eb1 = xRAX+(nextop&7)+(rex.b<<3); + eb2 = 0; \ + } else { + ed = (nextop&7); + eb1 = xRAX+(ed&3); // Ax, Cx, Dx or Bx + eb2 = (ed&4)>>2; // L or H + } + if (eb2) { + SRLI(gd, eb1, wb2); + ANDI(gd, gd, 0xff); + } else { + ANDI(gd, eb1, 0xff); + } + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + LBU(gd, ed, fixedaddress); + } + break; + case 0xB7: + INST_NAME("MOVZX Gd, Ew"); + nextop = F8; + GETGD; + if(MODREG) { + ed = xRAX+(nextop&7)+(rex.b<<3); + SLLI(gd, ed, 48); + SRLI(gd, gd, 48); + } else { + SMREAD(); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, x1, &fixedaddress, rex, NULL, 1, 0); + LHU(gd, ed, fixedaddress); + } + break; + default: DEFAULT; } -- cgit 1.4.1