Combining __restrict__ and __attribute__((aligned(32)))
问题 I want to ensure that gcc knows: The pointers refer to non-overlapping chunks of memory The pointers have 32 byte alignments Is the following the correct? template<typename T, typename T2> void f(const T* __restrict__ __attribute__((aligned(32))) x, T2* __restrict__ __attribute__((aligned(32))) out) {} Thanks. Update: I try to use one read and lots of write to saturate the cpu ports for writing. I hope that would make the performance gain by aligned moves more significant. But the assembly