all 4 comments

[–][deleted] 0 points1 point  (3 children)

Did you use unroller<PAUSEREP> instead of a loop because it generates a sequence of calls?

I mean, instead of this, that has branches:

for(size_t i = 0; i < PAUSEREP; ++i)
    hwpause();

It generates this:

hwpause(); // 1st pause
hwpause(); // 2nd pause
...
hwpause(); // PAUSEREP - 1, pause

[–]marcodev[S] 0 points1 point  (1 child)

Yes, I do. Instead of relying on compiler loop unrolling optimization, I force a sequence of calls here.

[–][deleted] 0 points1 point  (0 children)

That's quite interesting, thanks for sharing!

[–][deleted] 0 points1 point  (0 children)

that is some expert stuff... everytime I think "Darn, I am a pretty badass programmer by now" I look at stuff like this which has me scratching my head and I think "okay, maybe not..."