VarAction2: Add group flag for whether to run jump insert pass

pull/400/head
Jonathan G Rennison 2 years ago
parent 3714fad790
commit 387e646439

@ -6705,6 +6705,7 @@ static void OptimiseVarAction2Adjust(VarAction2OptimiseState &state, const GrfSp
if (adjust.operation == DSGA_OP_MUL && adjust.variable != 0x7E) {
state.inference |= VA2AIF_MUL_BOOL;
adjust.adjust_flags |= DSGAF_JUMP_INS_HINT;
group->dsg_flags |= DSGF_CHECK_INSERT_JUMP;
}
}
} else {
@ -7007,6 +7008,7 @@ static void OptimiseVarAction2Adjust(VarAction2OptimiseState &state, const GrfSp
}
if (non_const_var_inference & VA2AIF_ONE_OR_ZERO) {
adjust.adjust_flags |= DSGAF_JUMP_INS_HINT;
group->dsg_flags |= DSGF_CHECK_INSERT_JUMP;
}
break;
}
@ -8050,7 +8052,7 @@ static void HandleVarAction2OptimisationPasses()
OptimiseVarAction2DeterministicSpriteGroupSimplifyStores(group);
OptimiseVarAction2DeterministicSpriteGroupAdjustOrdering(group);
if (!(group->dsg_flags & DSGF_NO_DSE)) {
if ((group->dsg_flags & DSGF_CHECK_INSERT_JUMP) && !(group->dsg_flags & DSGF_NO_DSE)) {
OptimiseVarAction2DeterministicSpriteGroupInsertJumps(group, var_tracking);
}
if (group->dsg_flags & DSGF_CHECK_EXPENSIVE_VARS) {

@ -913,6 +913,7 @@ void SpriteGroupDumper::DumpSpriteGroup(const SpriteGroup *sg, int padding, uint
if (dsg->dsg_flags & DSGF_VAR_TRACKING_PENDING) p += seprintf(p, lastof(this->buffer), ", VAR_PENDING");
if (dsg->dsg_flags & DSGF_REQUIRES_VAR1C) p += seprintf(p, lastof(this->buffer), ", REQ_1C");
if (dsg->dsg_flags & DSGF_CHECK_EXPENSIVE_VARS) p += seprintf(p, lastof(this->buffer), ", CHECK_EXP_VAR");
if (dsg->dsg_flags & DSGF_CHECK_INSERT_JUMP) p += seprintf(p, lastof(this->buffer), ", CHECK_INS_JMP");
}
print();
emit_start();

@ -446,6 +446,7 @@ enum DeterministicSpriteGroupFlags : uint8 {
DSGF_VAR_TRACKING_PENDING = 1 << 2,
DSGF_REQUIRES_VAR1C = 1 << 3,
DSGF_CHECK_EXPENSIVE_VARS = 1 << 4,
DSGF_CHECK_INSERT_JUMP = 1 << 5,
};
DECLARE_ENUM_AS_BIT_SET(DeterministicSpriteGroupFlags)

Loading…
Cancel
Save