5 ms·
The inverse problem is here too: > int partition_branchless(int* arr, int low, int high) {... for (int j = low; j < high; j++) { ... }... } That for loop i
by zeckalpha 1y ago
The inverse problem is here too:
> int partition_branchless(int* arr, int low, int high) {...
for (int j = low; j < high; j++) { ... }... }
That for loop is just a sugared while loop which is just a sugared cmp and jmp
- xigoi 1y agoThe articleesays that it optimizes just the inside of the loop (the loop jump can be optimized via unrolling, which the compiler may do automatically).