Revert "trying with the restrict keyword - unsuccessful"

This reverts commit 1908687002c085c628853711d26b95e9bc92a1ad.
This commit is contained in:
Richard Thier 2022-09-01 02:15:43 +02:00
parent 1908687002
commit d0843cbc40

View File

@ -241,7 +241,7 @@ namespace MagyarSort {
}; };
template<typename COUNTER_TYP> template<typename COUNTER_TYP>
static inline void calcPrefixSums(COUNTER_TYP *__restrict radics) noexcept { static inline void calcPrefixSums(COUNTER_TYP *radics) noexcept {
static thread_local COUNTER_TYP prev[DIGITS]; static thread_local COUNTER_TYP prev[DIGITS];
memset(prev, 0, sizeof(prev)); memset(prev, 0, sizeof(prev));
@ -267,7 +267,7 @@ namespace MagyarSort {
/** Recursive Functor: no class should be generated I think (compiler should be smart) */ /** Recursive Functor: no class should be generated I think (compiler should be smart) */
template<int DIGIT, typename COUNTER_TYP> template<int DIGIT, typename COUNTER_TYP>
struct RadixMagic : public RadixMagic<DIGIT - 1, COUNTER_TYP> { struct RadixMagic : public RadixMagic<DIGIT - 1, COUNTER_TYP> {
inline __attribute__((always_inline)) RadixMagic(bool &swapped, COUNTER_TYP *__restrict radics, uint32_t *__restrict from, uint32_t *__restrict to, COUNTER_TYP size) noexcept inline __attribute__((always_inline)) RadixMagic(bool &swapped, COUNTER_TYP *radics, uint32_t *from, uint32_t *to, COUNTER_TYP size) noexcept
: RadixMagic<DIGIT - 1, COUNTER_TYP>(swapped, radics, from, to, size) { : RadixMagic<DIGIT - 1, COUNTER_TYP>(swapped, radics, from, to, size) {
// Tricky: see (**) // Tricky: see (**)
if(swapped) { // never true for DIGIT 0, see (***) if(swapped) { // never true for DIGIT 0, see (***)
@ -305,7 +305,7 @@ namespace MagyarSort {
/** Ends template recursion */ /** Ends template recursion */
template<typename COUNTER_TYP> template<typename COUNTER_TYP>
struct RadixMagic<-1, COUNTER_TYP> { struct RadixMagic<-1, COUNTER_TYP> {
inline RadixMagic(bool swapped, COUNTER_TYP *__restrict radics, uint32_t *__restrict from, uint32_t *__restrict to, COUNTER_TYP size) noexcept {} inline RadixMagic(bool swapped, COUNTER_TYP *radics, uint32_t *&from, uint32_t *&to, COUNTER_TYP size) noexcept {}
}; };
/* SORT */ /* SORT */