Изучаю SSE, пишу код:
#include <xmmintrin.h>
int main()
{
float *temp = malloc(128);
for (;;)
{
__m128 summand1 = _mm_set_ps1(1.0);
__m128 summand2 = _mm_set_ps1(2.0);
__m128 result = _mm_add_ps(summand1, summand2);
_mm_storeu_ps(temp, result);
}
free(temp);
}
gcc -O3 -march=pentium4 -mfpmath=sse -funroll-loops -fomit-frame-pointer -std=c99 -o segfault segfault.c
#include <xmmintrin.h>
int main()
{
for (;;)
{
float *temp = malloc(128);
__m128 summand1 = _mm_set_ps1(1.0);
__m128 summand2 = _mm_set_ps1(2.0);
__m128 result = _mm_add_ps(summand1, summand2);
_mm_storeu_ps(temp, result);
free(temp);
}
}