Last active
April 29, 2018 15:00
-
-
Save Abhiroop/ab2d71f3b14e28c91b6acd2f395d605d to your computer and use it in GitHub Desktop.
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 <stdio.h> | |
#include <xmmintrin.h> //SSE | |
inline __m64 shuf(int perm){ | |
__m64 a = _mm_setr_pi16(1,2,3,4); | |
return _mm_shuffle_pi16 (a, perm); | |
} | |
int main() | |
{ | |
__m64 e = shuf(4); | |
printf("v_out = %vhd\n", e); | |
return 0; | |
} | |
// gcc -Wall -msse shuffle_fail.c | |
/* | |
clang has a more descriptive error message than gcc: | |
argument to '__builtin_ia32_pshufw' must be a constant integer | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment