sh2 drc bugfix for aarch64/mips

This commit is contained in:
kub 2019-10-12 00:26:11 +02:00
parent e7ee7bc00a
commit a6c0ab7d99
6 changed files with 20 additions and 19 deletions

View file

@ -979,7 +979,7 @@ static void emith_ldst_offs(int sz, int rd, int rn, int o9, int ld, int mode)
#define emith_save_caller_regs(mask) do { \
int _c, _r1, _r2; u32 _m = mask & 0x3ffff; \
if (__builtin_parity(_m) == 1) _m |= 0x40000; /* hardware align */ \
for (_c = HOST_REGS, _r1 = -1; _m && _c >= 0; _m &= ~(1 << _c), _c--) \
for (_c = HOST_REGS-1, _r1 = -1; _m && _c >= 0; _m &= ~(1 << _c), _c--)\
if (_m & (1 << _c)) { \
_r2 = _r1, _r1 = _c; \
if (_r2 != -1) { \

View file

@ -1065,7 +1065,7 @@ static void emith_lohi_nops(void)
if (__builtin_parity(_m) == 1) _m |= 0x1; /* ABI align */ \
int _s = count_bits(_m) * 4, _o = _s; \
if (_s) emith_sub_r_imm(SP, _s); \
for (_c = HOST_REGS; _m && _c >= 0; _m &= ~(1 << _c), _c--) \
for (_c = HOST_REGS-1; _m && _c >= 0; _m &= ~(1 << _c), _c--) \
if (_m & (1 << _c)) \
{ _o -= 4; if (_c) emith_write_r_r_offs(_c, SP, _o); } \
} while (0)
@ -1279,7 +1279,7 @@ static int emith_cond_check(int cond, int *r)
if (__builtin_parity(_m) == 1) _m |= 0x1; /* ABI align for SP is 8 */ \
int _s = count_bits(_m) * 4 + 16, _o = _s; /* 16 byte arg save area */ \
if (_s) emith_sub_r_imm(SP, _s); \
for (_c = HOST_REGS; _m && _c >= 0; _m &= ~(1 << _c), _c--) \
for (_c = HOST_REGS-1; _m && _c >= 0; _m &= ~(1 << _c), _c--) \
if (_m & (1 << _c)) \
{ _o -= 4; if (_c) emith_write_r_r_offs(_c, SP, _o); } \
} while (0)

View file

@ -1115,7 +1115,7 @@ enum { xAX = 0, xCX, xDX, xBX, xSP, xBP, xSI, xDI, // x86-64,i386 common
#define emith_save_caller_regs(mask) do { \
int _c; u32 _m = mask & 0xfc7; /* AX, CX, DX, SI, DI, 8, 9, 10, 11 */ \
if (__builtin_parity(_m) == 1) _m |= 0x8; /* BX for ABI align */ \
for (_c = HOST_REGS; _m && _c >= 0; _m &= ~(1 << _c), _c--) \
for (_c = HOST_REGS-1; _m && _c >= 0; _m &= ~(1 << _c), _c--) \
if (_m & (1 << _c)) emith_push(_c); \
} while (0)