I\'m trying to find a way to perform an indirect shift-left/right operation without actually using the variable shift op or any branches.
The particular PowerPC pro
How about this:
if (y & 16) x <<= 16; if (y & 8) x <<= 8; if (y & 4) x <<= 4; if (y & 2) x <<= 2; if (y & 1) x <<= 1;
will probably take longer yet to execute but easier to interleave if you have other code to go between.