GCC\'s vector extensions offer a nice, reasonably portable way of accessing some SIMD instructions on different hardware architectures without resorting to hardware specific
Edit (thanks Peter Cordes) You can cast pointers:
typedef char v16qi __attribute__ ((vector_size (16), aligned (16)));
v16qi vec = *(v16qi*)&buf[i]; // load
*(v16qi*)(buf + i) = vec; // store whole vector
This compiles to vmovdqa to load and vmovups to store. If the data isn't known to be aligned, set aligned (1) to generate vmovdqu. (godbolt)
Note that there are also several special-purpose builtins for loading and unloading these registers (Edit 2):
v16qi vec = _mm_loadu_si128((__m128i*)&buf[i]); // _mm_load_si128 for aligned
_mm_storeu_si128((__m128i*)&buf[i]), vec); // _mm_store_si128 for aligned
It seems to be necessary to use -flax-vector-conversions to go from chars to v16qi with this function.
See also: C - How to access elements of vector using GCC SSE vector extension
See also: SSE loading ints into __m128
(Tip: The best phrase to google is something like "gcc loading __m128i".)