sh2, optimizations to innermost run loop

This commit is contained in:
kub 2020-04-22 20:29:53 +02:00
parent 9a02334f3a
commit 2eb213314a
3 changed files with 21 additions and 18 deletions

View file

@ -235,11 +235,10 @@ extern SH2 sh2s[2];
# define sh2_pc(sh2) (sh2)->ppc
#else
# define sh2_end_run(sh2, after_) do { \
int left_ = (signed int)(sh2)->sr >> 12; \
if (left_ > (after_)) { \
(sh2)->cycles_timeslice -= left_ - (after_); \
(sh2)->sr &= 0xfff; \
(sh2)->sr |= (after_) << 12; \
int left_ = ((signed int)(sh2)->sr >> 12) - (after_); \
if (left_ > 0) { \
(sh2)->cycles_timeslice -= left_; \
(sh2)->sr -= (left_ << 12); \
} \
} while (0)
# define sh2_cycles_left(sh2) ((signed int)(sh2)->sr >> 12)