This simple SSE code:
#include <vector>
#include <emmintrin.h>
int main() {
std::vector<__m128> blah;
blah.push_back(__m128());
}
Crashes on MSVC 10 with a segfault at 0xffffffff
.
What could be going wrong ?
This simple SSE code:
#include <vector>
#include <emmintrin.h>
int main() {
std::vector<__m128> blah;
blah.push_back(__m128());
}
Crashes on MSVC 10 with a segfault at 0xffffffff
.
What could be going wrong ?
A std::vector
does not allocate specially aligned memory, which __m128
needs to store it's data. You will have to either swap out the allocator, or replace it with an array of 4 floats and then perform an unaligned load or copy out to an aligned location every time you access the vector.