search for: to_float4

Displaying 1 result from an estimated 1 matches for "to_float4".

Did you mean: to_float
2012 Feb 28
1
[LLVMdev] How to vectorize a vector type cast?
...g does not seem to allow type casts, such as uchar4 to float4, between vector types, it seems it is necessary to write them as element by element conversions, such as typedef float float4 __attribute__((ext_vector_type(4))); typedef unsigned char uchar4 __attribute__((ext_vector_type(4))); float4 to_float4(uchar4 in) { float4 out = {in.x, in.y, in.z, in.w}; return out; } Running this code through "clang -c -emit-llvm" and then through "opt -O2 -S", produces the following IR: define <4 x float> @to_float4(i32 %in.coerce) nounwind uwtable readnone { entry: %0 = bitcast...