Is char3 as_char3(char4 x) a valid OpenCL builtin function?
According to the spec, both have 4 bytes, so it seems to be a valid builtin.
Naturally one would want to implement it as
char3 as_char3(char4 x) { return __builtin_astype(x, char3); }
However this does not work since Clang will generate bitcast <4 x i8> to <3 x i8> and this is an invalid llvm instruction.
Do you think Clang should be patched to generate correct llvm instruction for this case?
Thanks.
Sam