Error : casting user defined data types in c
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/double value to a defined type. #include<stdio.h> typedef double v4si __attribute__ ((vector_size (16))); int main() { double stoptime=36000; float x =0.5*stoptime; float * temp = &x; v4si a = ((v4si)x); // Error: Incompatible data types v4si b; v4si *c; c = ((v4si*)&temp); // Copies address of temp, b = *(c); printf("%f\n" , b); // but printing (*c) crashes program } You don't need to define a custom SIMD vector type ( v4si