emit_arm64: EmitAddCycles: Do not emit code if cycles_to_add == 0

This commit is contained in:
Merry 2022-11-08 20:06:19 +00:00
parent 7dbd87ba2d
commit fa6b58d3a8

View file

@ -139,6 +139,9 @@ static void EmitAddCycles(oaknut::CodeGenerator& code, EmitContext& ctx, size_t
if (!ctx.conf.enable_cycle_counting) {
return;
}
if (cycles_to_add == 0) {
return;
}
if (oaknut::AddSubImm::is_valid(cycles_to_add)) {
code.SUB(Xticks, Xticks, cycles_to_add);