I've try this code:
#include <QtCore/QCoreApplication>
#include <xmmintrin.h>
#include <emmintrin.h>
int main(int argc, char *argv[])
{
quint32 a[256];
quint32 b[256];
quint32 c[256];
for (int i = 0; i < 256; i += 4)
{
__m128i vectorA = _mm_loadu_si128((__m128i*)&a[i]);
__m128i vectorB = _mm_loadu_si128((__m128i*)&b[i]);
__m128i vectorC = _mm_add_epi32(vectorA, vectorB);
_mm_storeu_si128((__m128i*)&c[i], vectorC);
}
return x.exec();
}
#include <QtCore/QCoreApplication>
#include <xmmintrin.h>
#include <emmintrin.h>
int main(int argc, char *argv[])
{
QCoreApplication x(argc, argv);
quint32 a[256];
quint32 b[256];
quint32 c[256];
for (int i = 0; i < 256; i += 4)
{
__m128i vectorA = _mm_loadu_si128((__m128i*)&a[i]);
__m128i vectorB = _mm_loadu_si128((__m128i*)&b[i]);
__m128i vectorC = _mm_add_epi32(vectorA, vectorB);
_mm_storeu_si128((__m128i*)&c[i], vectorC);
}
return x.exec();
}
To copy to clipboard, switch view to plain text mode
And got this:
/usr/lib/gcc/i586-suse-linux/4.6/include/xmmintrin.h:32: error: #error "SSE instruction set not enabled"
/usr/lib/gcc/i586-suse-linux/4.6/include/emmintrin.h:32: error: #error "SSE2 instruction set not enabled"
error: ‘__m128i’ was not declared in this scope.
How can I fix it ?
Bookmarks