mirror of
https://github.com/ptitSeb/box64.git
synced 2024-11-26 16:21:17 +00:00
Merge branch 'main' into embrace_malloc_override
This commit is contained in:
commit
48062f8ece
@ -145,7 +145,7 @@ Force the use of Double for x87 emulation
|
||||
|
||||
#### BOX64_DYNAREC_FASTNAN
|
||||
Enable/Disable generation of -NAN
|
||||
* 0 : Generate -NAN like on x86 (Default.)
|
||||
* 0 : Generate -NAN like on x86
|
||||
* 1 : Don't do anything special with NAN, to go as fast as possible (default)
|
||||
|
||||
#### BOX64_LIBGL
|
||||
|
@ -30,10 +30,12 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
|
||||
uint8_t opcode = F8;
|
||||
uint8_t nextop;
|
||||
uint8_t gd, ed, u8;
|
||||
uint8_t wback, wb1, wb2, gb1, gb2;
|
||||
uint8_t wback, wb1, wb2, eb1, eb2, gb1, gb2;
|
||||
int32_t i32;
|
||||
int64_t i64, j64;
|
||||
int64_t fixedaddress;
|
||||
MAYUSE(eb1);
|
||||
MAYUSE(eb2);
|
||||
MAYUSE(gb1);
|
||||
MAYUSE(gb2);
|
||||
MAYUSE(wb1);
|
||||
@ -704,6 +706,39 @@ uintptr_t dynarec64_F0(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
|
||||
DMB_ISH();
|
||||
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 {
|
||||
DMB_ISH();
|
||||
GETGB(x4);
|
||||
addr = geted(dyn, addr, ninst, nextop, &ed, x2, &fixedaddress, 0, 0, rex, LOCK_LOCK, 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);
|
||||
DMB_ISH();
|
||||
BFIx(gb1, x1, gb2*8, 8);
|
||||
}
|
||||
break;
|
||||
case 0x87:
|
||||
INST_NAME("LOCK XCHG Ed, Gd");
|
||||
nextop = F8;
|
||||
|
@ -842,6 +842,35 @@ uintptr_t RunF0(x64emu_t *emu, rex_t rex, uintptr_t addr)
|
||||
pthread_mutex_unlock(&emu->context->mutex_lock);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 0x86: /* XCHG Eb,Gb */
|
||||
nextop = F8;
|
||||
#ifdef DYNAREC
|
||||
GETEB(0);
|
||||
GETGB;
|
||||
if(MODREG) { // reg / reg: no lock
|
||||
tmp8u = GB;
|
||||
GB = EB->byte[0];
|
||||
EB->byte[0] = tmp8u;
|
||||
} else {
|
||||
do {
|
||||
tmp8u = native_lock_read_b(EB);
|
||||
} while(native_lock_write_b(EB, GB));
|
||||
GB = tmp8u;
|
||||
}
|
||||
// dynarec use need it's own mecanism
|
||||
#else
|
||||
GETEB(0);
|
||||
GETGB;
|
||||
if(!MODREG)
|
||||
pthread_mutex_lock(&emu->context->mutex_lock); // XCHG always LOCK (but when accessing memory only)
|
||||
tmp8u = GB;
|
||||
GB = EB->byte[0];
|
||||
EB->byte[0] = tmp8u;
|
||||
if(!MODREG)
|
||||
pthread_mutex_unlock(&emu->context->mutex_lock);
|
||||
#endif
|
||||
break;
|
||||
case 0x87: /* XCHG Ed,Gd */
|
||||
nextop = F8;
|
||||
#ifdef DYNAREC
|
||||
|
Loading…
Reference in New Issue
Block a user