cleanup and microoptimizations in SH2 hw handling

This commit is contained in:
kub 2019-08-31 17:37:18 +02:00
parent f740428b81
commit fe344bd3d8
12 changed files with 308 additions and 247 deletions

View file

@ -1163,9 +1163,10 @@ static void emith_ldst_offs(int sz, int rd, int rn, int o9, int ld, int mode)
int t2 = rcache_get_tmp(); \
int t3 = rcache_get_tmp(); \
/* if (sr < 0) return */ \
emith_asrf(t2, sr, 12); \
emith_cmp_r_imm(sr, 0); \
EMITH_JMP_START(DCOND_LE); \
/* turns = sr.cycles / cycles */ \
emith_asr(t2, sr, 12); \
emith_move_r_imm(t3, (u32)((1ULL<<32) / (cycles)) + 1); \
emith_mul_u64(t1, t2, t2, t3); /* multiply by 1/x */ \
rcache_free_tmp(t3); \

View file

@ -560,8 +560,8 @@ static void emith_set_arith_flags(int rd, int rt, int rs, s32 imm, int sub)
#define emith_adc_r_r(d, s) \
emith_adc_r_r_r(d, d, s)
// NB: the incoming C can cause its own outgoing C if s2+C=0 (or s1+C=0 FWIW)
// moreover, s2 is 0 if there is C, so no other C can be generated.
// NB: the incoming carry Cin can cause Cout if s2+Cin=0 (or s1+Cin=0 FWIW)
// moreover, if s2+Cin=0 caused Cout, s1+s2+Cin=s1+0 can't cause another Cout
#define emith_adcf_r_r_r(d, s1, s2) do { \
emith_add_r_r_r(FNZ, s2, FC); \
EMIT(MIPS_SLTU_REG(AT, FNZ, FC)); \

View file

@ -1,7 +1,7 @@
/*
* Basic macros to emit x86 instructions and some utils
* Copyright (C) 2008,2009,2010 notaz
* Copyright (C) 2019 kuv
* Copyright (C) 2019 kub
*
* This work is licensed under the terms of MAME license.
* See COPYING file in the top-level directory.