From 298edba5d25c7fc521831fcd71d21735e8e23456 Mon Sep 17 00:00:00 2001 From: Richard Thier Date: Sat, 18 Dec 2021 01:48:42 +0100 Subject: [PATCH] minor unroll --- magyarsort.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/magyarsort.h b/magyarsort.h index 8a189d5..0d39686 100644 --- a/magyarsort.h +++ b/magyarsort.h @@ -108,9 +108,10 @@ namespace MagyarSort { template static inline void countOccurences(uint32_t arr[], COUNTER_TYP size, COUNTER_TYP *radicsOut) noexcept { COUNTER_TYP i = 0; - // #pragma GCC unroll 4 + //#pragma GCC unroll 4 for(; i < size - 64; i += 64) { // Prefetch for read level-1 cache + //__builtin_prefetch(&arr[i + (1 * 16)], 0/*r*/, 2/*L2 or L3 cache likely*/); __builtin_prefetch(&arr[i + (1 * 16)]); // Creates no object, struct is empty OccurenceMagic(arr, i, radicsOut); @@ -183,6 +184,7 @@ namespace MagyarSort { OccurenceMagic(arr, i + 63, radicsOut); } + #pragma GCC unroll 4 for(; i < size; ++i) { OccurenceMagic(arr, i, radicsOut); }