Optimize 8-bit integer shifts
Use XOR instead of subtraction by power of two

 * XOR may be faster when not all execution units can compute subtraction
Implement avg() for 8, 16, 32 bit signed and 32 bit unsigned integers
Add an implementation of truncating avg