Revert "schwab: tried to help a bit with ILP - does not seem to help at all"
This reverts commit bf9c22f4ecd37039fe69142e9b72db6eb50b82a9.
This commit is contained in:
parent
bf9c22f4ec
commit
283783bf9b
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
/* A fast quicksort-like new alg created in Csolnok, Hungary with:
|
/* A fast quicksort-like new alg created in Csolnok, Hungary with:
|
||||||
* - 4-way partitioning with 0..5 copies (not swaps) per elem per run
|
* - 4-way partitioning with 0..5 copies (not swaps) per elem per run
|
||||||
* - "Practically ensures" O(log2(n)) recursion depth
|
* - ensured O(log2(n)) worst recursion depth
|
||||||
*
|
*
|
||||||
* LICENCE: CC-BY, 2025 May 08-09
|
* LICENCE: CC-BY, 2025 May 08-09
|
||||||
* Author: Richárd István Thier (also author of the Magyarsort)
|
* Author: Richárd István Thier (also author of the Magyarsort)
|
||||||
@ -164,20 +164,23 @@ static inline int schwab_partition(
|
|||||||
* This is likely faster than calling a memcpy if we code this for not just uint32s!
|
* This is likely faster than calling a memcpy if we code this for not just uint32s!
|
||||||
*/
|
*/
|
||||||
if(curr < klo) {
|
if(curr < klo) {
|
||||||
arr[b3] = arr[b2++];
|
arr[b3] = arr[b2];
|
||||||
arr[b2 - 1] = arr[b1++];
|
arr[b2] = arr[b1];
|
||||||
arr[b1 - 1] = arr[b0++];
|
arr[b1] = arr[b0];
|
||||||
arr[b0 - 1] = curr;
|
arr[b0] = curr;
|
||||||
|
++b0; ++b1; ++b2;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(curr < kmid) {
|
if(curr < kmid) {
|
||||||
arr[b3] = arr[b2++];
|
arr[b3] = arr[b2];
|
||||||
arr[b2 - 1] = arr[b1++];
|
arr[b2] = arr[b1];
|
||||||
arr[b1 - 1] = curr;
|
arr[b1] = curr;
|
||||||
|
++b1; ++b2;
|
||||||
} else {
|
} else {
|
||||||
arr[b3] = arr[b2++];
|
arr[b3] = arr[b2];
|
||||||
arr[b2 - 1] = curr;
|
arr[b2] = curr;
|
||||||
|
++b2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user