It is very easy to undo 32-bit int elements after normal loading:
__m128i v = _mm_load_si128(buff);
You can do the same for 16-bit short elements, but more instructions are required:
__m128i v = _mm_load_si128(buff);
Note that you can do this with fewer commands using _mm_shuffle_epi8 ( PSHUFB ) if SSSE3 is available:
const __m128i vm = _mm_setr_epi8(14, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 0, 1);
Paul r
source share