A discovery about GCC's unidirectional rotation algorithm
41 points by soheilpro
by throwaway81523
0 subcomment
I thought the cool way to do this was reverse each sub-block in place, and then reverse the whole vector. If you draw a few diagrams you can see that accomplishes the rotation. Yes it moves everything twice, but it has near perfect cache locality, so at least on large blocks tends to be faster than cycle decomposition or other juggling tricks. It's discussed in one of Bentley's "Programming Pearls" books.
by jdw64
0 subcomment
Looking at this, I feel that while there seem to be many different actual implementations, they really boil down to just a few similar core principles
by srean
3 subcomments
'Shocking', 'striking', 'disappointing', 'will shock you' -- the article is padded with hyperbole.
by sylware
1 subcomments
gcc is gone, like clang. Those are c++ abominations. Not worth more than /opt.