diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2021-03-25 15:39:19 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2021-03-25 15:39:19 +0100 |
| commit | 207f829066d08556b46e22da85d6420ba377e9f2 (patch) | |
| tree | 547c4536380c19830e1160f5706faa3027b997f5 | |
| parent | f1fba8eb4228295597b1273d74ab880dd9c54be7 (diff) | |
| download | box64-207f829066d08556b46e22da85d6420ba377e9f2.tar.gz box64-207f829066d08556b46e22da85d6420ba377e9f2.zip | |
[DYNAREC] Added 86 opcode
| -rwxr-xr-x | src/dynarec/dynarec_arm64_00.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/dynarec/dynarec_arm64_00.c b/src/dynarec/dynarec_arm64_00.c index 6c690a54..845703f4 100755 --- a/src/dynarec/dynarec_arm64_00.c +++ b/src/dynarec/dynarec_arm64_00.c @@ -820,7 +820,37 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin GETED(0); emit_test32(dyn, ninst, rex, ed, gd, x3, x5); break; - + case 0x86: + INST_NAME("(LOCK)XCHG Eb, Gb"); + // Do the swap + nextop = F8; + if(MODREG) { + GETGB(x4); + if(rex.rex) { + ed = xRAX+(nextop&7)+(rex.b<<3); + eb1 = ed; + eb2 = 0; + } else { + ed = (nextop&7); + eb1 = xRAX+(ed&3); + eb2 = ((ed&4)>>2); + } + UBFXw(x1, eb1, eb2*8, 8); + // do the swap 14 -> ed, 1 -> gd + BFIx(gb1, x1, gb2*8, 8); + BFIx(eb1, x4, eb2*8, 8); + } else { + GETGB(x4); + addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0, 0, rex, 0, 0); + MARKLOCK; + // do the swap with exclusive locking + LDAXRB(x1, ed); + // do the swap 14 -> strb(ed), 1 -> gd + STLXRB(x3, x4, ed); + CBNZx_MARKLOCK(x3); + BFIx(gb1, x1, gb2*8, 8); + } + break; case 0x87: INST_NAME("(LOCK)XCHG Ed, Gd"); nextop = F8; |