1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-25 03:29:45 +00:00

Fix model name.

This commit is contained in:
Thomas Harte 2024-03-02 21:47:09 -05:00
parent c0dd96eb7c
commit 37499d493a
2 changed files with 6 additions and 5 deletions

View File

@ -556,10 +556,10 @@ private:
/// Provides an analogue of the @c OperationMapper -affiliated @c dispatch that also updates the
/// program counter in an executor's register bank appropriately.
template <typename MemoryT>
template <Model model, typename MemoryT>
void dispatch(uint32_t pc, uint32_t instruction, Executor<MemoryT> &executor) {
executor.set_pc(pc);
dispatch(instruction, executor);
dispatch<model>(instruction, executor);
}
}

View File

@ -14,7 +14,7 @@
namespace InstructionSet::ARM {
enum class Model {
ARM2,
ARMv2,
};
enum class Condition {
@ -389,6 +389,7 @@ private:
};
/// Operation mapper; use the free function @c dispatch as defined below.
template <Model>
struct OperationMapper {
static Condition condition(uint32_t instruction) {
return Condition(instruction >> 28);
@ -506,8 +507,8 @@ struct SampleScheduler {
/// Decodes @c instruction, making an appropriate call into @c scheduler.
///
/// In lieu of C++20, see the sample definition of SampleScheduler above for the expected interface.
template <typename SchedulerT> void dispatch(uint32_t instruction, SchedulerT &scheduler) {
OperationMapper mapper;
template <Model model, typename SchedulerT> void dispatch(uint32_t instruction, SchedulerT &scheduler) {
OperationMapper<model> mapper;
// Test condition.
const auto condition = mapper.condition(instruction);