Skip to content

Instantly share code, notes, and snippets.

@ksc91u
Created July 2, 2016 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ksc91u/96bb0b2d6762450371f624eb2f303b67 to your computer and use it in GitHub Desktop.
Save ksc91u/96bb0b2d6762450371f624eb2f303b67 to your computer and use it in GitHub Desktop.
sse2
#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