Created
June 10, 2019 12:11
-
-
Save Daiver/ad4280b4fa4facef7cd4211396402379 to your computer and use it in GitHub Desktop.
This file contains 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 <iostream> | |
#include <xmmintrin.h> | |
void foo(const float num, const float denom) | |
{ | |
typedef __v4sf Vec4; | |
//typedef __m128 Vec4; | |
const Vec4 num4 = { | |
num, | |
num, | |
num, | |
num, | |
}; | |
const Vec4 denom4 = { | |
denom, | |
denom, | |
denom, | |
denom, | |
}; | |
//float res_arr[4] __attribute__ ((aligned (16))); | |
Vec4 res;// = (Vec4*)res_arr; | |
res = num4 / denom4; | |
float *res_arr=(float*)&res; | |
std::cout << res_arr[0] << std::endl; | |
std::cout << res_arr[1] << std::endl; | |
std::cout << res_arr[2] << std::endl; | |
std::cout << res_arr[3] << std::endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment