This is a simpler view of my Problem, I want to convert a float value into defined type v4si (I want to use SIMD Operation for optimization.) Please help to convert float/do
You don't need to define a custom SIMD vector type (v4si) or mess around with casts and type punning - just use the provided intrinsics in the appropriate *intrin.h header, e.g.
#include // use SSE intrinsics
int main(void)
{
__m128 v; // __m128 is the standard SSE vector type for 4 x float
float x, y, z, w;
v = _mm_set_ps(x, y, z, w);
// use intrinsic to set vector contents to x, y, z, w
// ...
return 0;
}