Created
July 2, 2016 09:21
-
-
Save ksc91u/96bb0b2d6762450371f624eb2f303b67 to your computer and use it in GitHub Desktop.
sse2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <emmintrin.h> //sse2 | |
#include <stdio.h> | |
/* | |
#include <xmmintrin.h> //sse | |
#include <mmintrin.h> //mmx | |
intro | |
http://www.linuxjournal.com/content/introduction-gcc-compiler-intrinsics-vector-processing | |
printf && set | |
http://stackoverflow.com/questions/13257166/print-a-m128i-variable | |
gcc -mfpmath=sse -mmmx -msse -msse2 | |
*/ | |
int main(int argc, char * argv[]){ | |
__m128i a = _mm_set_epi32(1, 2, 3, 4); | |
__m128i b = _mm_set_epi32(5, 6, 7, 8); | |
__m128i c; | |
c= _mm_add_epi32(a,b); | |
uint32_t *val = (uint32_t*) &c; | |
printf("%d, %d, %d, %d\n", val[0], val[1], val[2], val[3]); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment