I am new to the SSE instructions and I was trying to learn them from this site: http://www.codeproject.com/Articles/4522/Introduction-to-SSE-Programming
I am using t
Short answer: use _mm_malloc
and _mm_free
from xmmintrin.h
instead of _aligned_malloc
and _aligned_free
.
You should not use _aligned_malloc
, _aligned_free
, posix_memalign
, memalign
, or whatever else when you are writing SSE/AVX code. These are all compiler/platform-specific functions (either MSVC or GCC or POSIX).
Intel introduced functions _mm_malloc
and _mm_free
in Intel compiler specifically for SIMD computations (see this). The other compilers with x86 target architecture added them too (just as they add Intel intrinsics regularly). In this sense they are the only cross-platform solution: they should be available in every compiler supporting SSE.
These functions are declared in xmmintrin.h
header. Any header for later SSE/AVX version automatically includes previous ones, so it would be enough to include only smmintrin.h
or emmintrin.h
for example.