mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-30 11:34:54 +00:00
Fix model name.
This commit is contained in:
parent
c0dd96eb7c
commit
37499d493a
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user