Skip to main content
gamedev.net
🔒 Locked

boost loop unrolling

Started by Dragon_Strike 1 reply 1.3k views
Original Post
Dragon_Strike
Dragon_Strike
im looking for loop unrolling functionality somewhere in the boost library similar to: http://www.ddj.com/cpp/184401835 but so far i havent found anything... does anyone know if the boost library has any of this functionality?
mfawcett
mfawcett
Boost.MPL.for_each is close, but probably not exactly what you are looking for.


--Michael Fawcett
Sneftel
Sneftel
You can also use BOOST_PP_REPEAT for this sort of thing. Honestly, though, I wouldn't. The compiler is much better than a programmer at deciding what should and shouldn't be unrolled. I wouldn't even consider unrolling a loop until it had already bubbled to the top of my profiler report AND it was clear to me that branch mispredictions were doing it.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.