Debian Codegraph @

CMakeModules/TestSSE2.c

raw
1 #include <stdio.h>
2
3 //include sse and sse2 headers
4 #include <xmmintrin.h>
5 #include <emmintrin.h>
6
7 /* __m128 is ugly to write */
8 typedef __m128d v2df; // vector of 2 double (sse2)
9
10 int main(int argc, char **argv)
11 {
12 v2df calcx = _mm_setr_pd(2.0, 3.0);
13 v2df xx = _mm_mul_pd(calcx, calcx);
14 double d;
15 _mm_storel_pd(&d, xx);
16 printf("%f\n", d);
17 _mm_storeh_pd(&d, xx);
18 printf("%f\n", d);
19 return 0;
20 }