Closed romange closed 6 years ago
Very clever. My concern would be that it makes code less understandable. Perhaps, it's not such a bad thing given how much shorter it's now.
Very impressive C++ work.
;-)
Yes, sfinae is borderly understandable though here it's not that complicated. But I understand the concerns. Would you like to keep the original code?
@romange Sorry I did not get back to you regarding your question. I think I did write a reply back but never hit the "comment" button. I did not mean to be rude. I think that your work is fantastic and well worth including.
Hey Daniele, all is good :) and you are not rude at all. i just did not want to push something that you think is unneeded. But if you think it's worth including i will try to send the whole PR sometime next week.
Have a great weekend)
On Aug 25, 2017 10:59 PM, "Daniel Lemire" notifications@github.com wrote:
@romange https://github.com/romange Sorry I did not get back to you regarding your question. I think I did write a reply back but never hit the "comment" button. I did not mean to be rude. I think that your work is fantastic and well worth including.
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/lemire/FastPFor/pull/30#issuecomment-325021290, or mute the thread https://github.com/notifications/unsubscribe-auth/ADgSiLjBC4qkt9D6DLxIMwgqf5upZJ8vks5sbyeXgaJpZM4O_dFx .
It's nice to see that the compiler's constant-folding can substitute when if constexpr
isn't yet supported.
Hi @lemire . Please take a look at this PR. It's not intended for merging at his moment but merely demonstrates how templates can reduce amount of code in this file without compromising the performance. Rfastunpack1, Rfastunpack2, R__fastunpack3 are equivalent to their original counter-parts but are one-liners. I verified with
gcc -O3 -mtune=core2 -std=c++17 -S -masm=intel bitpacking.cpp
that the asm code generated is the same in both versions.