Optimization: Make SVC use RSB

This commit is contained in:
MerryMage
2016-08-15 15:02:08 +01:00
parent 6c45619aa1
commit 7d7ac0af71
8 changed files with 30 additions and 7 deletions

View File

@@ -166,6 +166,7 @@ struct LinkBlockFast {
struct PopRSBHint {};
struct If;
struct CheckHalt;
/// A Terminal is the terminal instruction in a MicroBlock.
using Terminal = boost::variant<
Invalid,
@@ -174,7 +175,8 @@ using Terminal = boost::variant<
LinkBlock,
LinkBlockFast,
PopRSBHint,
boost::recursive_wrapper<If>
boost::recursive_wrapper<If>,
boost::recursive_wrapper<CheckHalt>
>;
/**
@@ -188,6 +190,15 @@ struct If {
Terminal else_;
};
/**
* This terminal instruction checks if a halt was requested. If it wasn't, else_ is
* executed.
*/
struct CheckHalt {
CheckHalt(Terminal else_) : else_(else_) {}
Terminal else_;
};
} // namespace Term
using Term::Terminal;