mirror of
https://github.com/86Box/86Box.git
synced 2026-02-23 18:08:20 -07:00
New dynamic recompiler register optimizations
1. Register enums now implicitly start from 0, instead of explicitly. 2. Removed unused `acycs` enum. 3. Volatile registers are now at the end of the list. 3. Make `codegen_reg_mark_as_required` function only handle registers after IREG_EBX and before any volatile registers. 3-5% performance improvement observed on Linux.
This commit is contained in:
@@ -187,10 +187,12 @@ struct
|
||||
void
|
||||
codegen_reg_mark_as_required(void)
|
||||
{
|
||||
for (uint8_t reg = 0; reg < IREG_COUNT; reg++) {
|
||||
/* This used to start from IREG_EAX, now only starts from IREG_ESP since the first 4 registers are never optimized out. */
|
||||
/* It also no longer iterates through volatile registers unnecessarily. */
|
||||
for (uint8_t reg = IREG_ESP; reg < IREG_temp0; reg++) {
|
||||
int last_version = reg_last_version[reg];
|
||||
|
||||
if (last_version > 0 && ireg_data[reg].is_volatile == REG_PERMANENT)
|
||||
if (last_version > 0)
|
||||
reg_version[reg][last_version].flags |= REG_FLAGS_REQUIRED;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user