Created
May 17, 2013 12:35
-
-
Save trast/5598743 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
| typedef float v32float __attribute__((vector_size(32))); | |
| v32float sqrt_v32float(v32float x) { | |
| v32float r; | |
| #ifdef __AVX__ | |
| __asm__ __volatile__ ("VSQRTPS %0, %1" : "=x"(r) : "xm"(x)); | |
| #else | |
| int i; | |
| for (i = 0; i < 8; i++) | |
| r[i] = sqrtf(x[i]); | |
| #endif | |
| return r; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment