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:
int[] multiplicands = { 1, 2, 4, 8, 16, 32, ... etc ...}; int ShiftByVar( int x, int y ) { //return x << y; return x * multiplicands[y]; }