From c72951a36d6cb9775dc1ecd9bc26bc13e796f10c Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Sat, 2 Jul 2022 13:45:09 -0700 Subject: Dropping the async interface, and adding some real uarch. --- aisa/simple-models.h | 39 +++++---------------------------------- 1 file changed, 5 insertions(+), 34 deletions(-) (limited to 'aisa/simple-models.h') diff --git a/aisa/simple-models.h b/aisa/simple-models.h index 62b5388..a94f010 100644 --- a/aisa/simple-models.h +++ b/aisa/simple-models.h @@ -7,7 +7,6 @@ #include #include #include -#include #include #include "aisa/aisa.h" @@ -51,45 +50,17 @@ namespace aisa { struct TaskStack { std::deque> tasks; - bool pop_task() - { - if (tasks.empty()) - return false; - tasks.pop_back(); - return true; - } - - bool push_task(std::unique_ptr &&task) - { - tasks.emplace_back(std::move(task)); - return true; - } + bool pop_task(); + bool push_task(std::unique_ptr &&task); - std::optional top_task() - { - if (tasks.empty()) - return {}; - return tasks.back().get(); - } + std::optional top_task(); }; struct VectorRF { std::vector> rf; - std::optional load_reg(regnum_t rn) const - { - if (rf.size() <= rn) - return {}; - return rf[rn]; - } - - bool store_reg(regnum_t rn, regval_t rv) - { - if (rf.size() <= rn) - rf.resize(rn + 1); - rf[rn] = rv; - return true; - } + std::optional load_reg(regnum_t rn) const; + bool store_reg(regnum_t rn, regval_t rv); }; } -- cgit v1.2.3