Currently, encoder kernels are simple while loops that are inserted into a switch statement by an #include directive. Turn these loops into full static inline functions.
Makes early returning possible.
Makes it possible to do pre-loop and post-loop computations, such as calculating the number of rounds in advance. This could be done now, but not in a straightforward way.
Will later make it possible to unroll loops by inlining multiple copies of the inner loop.
Communicates additional constraints to the compiler, potentially allowing it to optimize better.
This change should have no adverse effects, because the compiler will inline the function at its only callsite. On the contrary, this change will be beneficial for maintenance and performance.
Currently, encoder kernels are simple
while
loops that are inserted into a switch statement by an#include
directive. Turn these loops into fullstatic inline
functions.This change should have no adverse effects, because the compiler will inline the function at its only callsite. On the contrary, this change will be beneficial for maintenance and performance.