/** * unrolled - loop attributes to ask the compiler to unroll it * * Usage: * * #define BATCH 8 * * unrolled_count(BATCH) * for (u32 i = 0; i < BATCH; i++) * // loop body without cross-iteration dependencies * * This is only a hint and the compiler is free to disable unrolling if it * thinks the count is suboptimal and may hurt performance and/or hugely * increase object code size. * Not having any cross-iteration dependencies (i.e. when iter x + 1 depends * on what iter x will do with variables) is not a strict requirement, but * provides best performance and object code size. * Available only on Clang and GCC 8.x onwards.
*/
/* Ask the compiler to pick an optimal unroll count, Clang only */ #define unrolled \
__pick_unrolled(clang loop unroll(enable), /* nothing */)
/* Unroll each @n iterations of the loop */ #define unrolled_count(n) \
__pick_unrolled(clang loop unroll_count(n), GCC unroll n)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.