-
Screwtape authored
Previously, optional extra cycles (such as the extra cycle incurred when a branch instruction is taken) were only mentioned in comments, not in the actual data, with the understanding that an emulator would just silently add them when necessary. Some operations made those optional cycles mandatory, or impossible, so we added the "force_cycles" field, meant to signal to emulators that they should *not* add the extra optional cycles to this operation, but this was unsatisfying. It meant emulators had to know about this special convention, and it would be impossible for automated tests to know if they'd covered all the situations that might incur optional cycles. Now, instead of "cycles" and "force_cycles" we have "base_cycles" (the absolute minimum number of cycles an operation takes) and "extra_cycles" (an additional number of cycles the operation might take under some circumstances. For any operations with extra_cycles=0, emulators shouldn't add any extra optional cycles, and when we need to override the cycle count for ano operation, we can just set base_cycles to that number and emulators don't need to look in a different field and treat it differently. Best of all, we have extra cycles for instructions and extra cycles for addressing modes, so all the combinations work out automatically.
19833063Screwtape authoredPreviously, optional extra cycles (such as the extra cycle incurred when a branch instruction is taken) were only mentioned in comments, not in the actual data, with the understanding that an emulator would just silently add them when necessary. Some operations made those optional cycles mandatory, or impossible, so we added the "force_cycles" field, meant to signal to emulators that they should *not* add the extra optional cycles to this operation, but this was unsatisfying. It meant emulators had to know about this special convention, and it would be impossible for automated tests to know if they'd covered all the situations that might incur optional cycles. Now, instead of "cycles" and "force_cycles" we have "base_cycles" (the absolute minimum number of cycles an operation takes) and "extra_cycles" (an additional number of cycles the operation might take under some circumstances. For any operations with extra_cycles=0, emulators shouldn't add any extra optional cycles, and when we need to override the cycle count for ano operation, we can just set base_cycles to that number and emulators don't need to look in a different field and treat it differently. Best of all, we have extra cycles for instructions and extra cycles for addressing modes, so all the combinations work out automatically.
Loading