Rewrote the recompiler interrupt checking in assembly (and removed it for the new dynamic compiler because the requires uops are not present), brings performance back up, and also did a number of CPU-related clean-ups (mostly removal of dead variables and associated code).

This commit is contained in:
OBattler
2020-07-13 19:46:19 +02:00
parent 0cd0d83cee
commit a862bda04c
32 changed files with 196 additions and 291 deletions

View File

@@ -225,4 +225,54 @@ extern void timer_advance_ex(pc_timer_t *timer, int start);
extern void timer_on(pc_timer_t *timer, double period, int start);
extern void timer_on_auto(pc_timer_t *timer, double period);
extern void timer_remove_head(void);
extern pc_timer_t * timer_head;
extern int timer_inited;
__inline void
timer_remove_head_inline(void)
{
pc_timer_t *timer;
if (timer_inited && timer_head) {
timer = timer_head;
timer_head = timer->next;
if (timer_head) {
timer_head->prev = NULL;
timer->next->prev = NULL;
}
timer->next = timer->prev = NULL;
timer->flags &= ~TIMER_ENABLED;
}
}
__inline void
timer_process_inline(void)
{
pc_timer_t *timer;
if (!timer_inited || !timer_head)
return;
while(1) {
timer = timer_head;
if (!TIMER_LESS_THAN_VAL(timer, (uint32_t)tsc))
break;
timer_remove_head_inline();
if (timer->flags & TIMER_SPLIT)
timer_advance_ex(timer, 0); /* We're splitting a > 1 s period into multiple <= 1 s periods. */
else if (timer->callback != NULL) /* Make sure it's no NULL, so that we can have a NULL callback when no operation is needed. */
timer->callback(timer->p);
}
timer_target = timer_head->ts.ts32.integer;
}
#endif /*_TIMER_H_*/