simplify spawn block handling

This commit is contained in:
Eyck Jentzsch 2022-01-31 23:40:19 +01:00
parent 7578906310
commit ef2a4df925

View File

@ -181,6 +181,15 @@ protected:
auto sign_mask = 1ULL<<(W-1);
return (from & mask) | ((from & sign_mask) ? ~mask : 0);
}
inline void process_spawn_blocks() {
for(auto it = std::begin(spawn_blocks); it!=std::end(spawn_blocks);)
if(*it){
(*it)();
++it;
} else
spawn_blocks.erase(it);
}
<%functions.each{ it.eachLine { %>
${it}<%}%>
<%}%>
@ -226,7 +235,7 @@ private:
<%instr.behavior.eachLine{%>${it}
<%}%>} catch(...){}
// post execution stuff
for(auto& spawn_block:spawn_blocks) spawn_block();
process_spawn_blocks();
if(this->sync_exec && POST_SYNC) this->do_sync(POST_SYNC, ${idx});
// trap check
if(*trap_state!=0){