schwab: tried to change cache friendlyness for branch prediction - it seems it is very marginally worse and much worse if I move thid after the other branches

This commit is contained in:
Richard Thier 2025-05-09 02:36:04 +02:00
parent 7d1d93a89c
commit fac01a81e3

View File

@ -242,21 +242,17 @@ static inline void schwab_sort(
/* But that would complicate codes above this point! */
/* Rem.: Order of operations try to be a cache-friendly as */
/* possible, but had to put loops changes to the end */
if(needmid) {
schwab_sort(array, plo, pmid - 1, state);
schwab_sort(array, pmid, phi - 1, state);
}
if(lolen < hilen) {
schwab_sort(array, low, plo - 1, state);
if(needmid) {
schwab_sort(array, plo, pmid - 1, state);
schwab_sort(array, pmid, phi - 1, state);
}
low = phi;
/* high = high; */
} else {
schwab_sort(array, phi, high, state);
if(needmid) {
schwab_sort(array, pmid, phi - 1, state);
schwab_sort(array, plo, pmid - 1, state);
}
/* low = low; */
high = plo - 1;