On Thu, 18 Jul 2024, Richard Biener wrote:

> > (also, in C op2 and op3 of a ternary operator always have integer promotions
> > applied, but for vector selection we should use unpromoted types)
> 
> Yes.  So a good testcase would use  char typed variable then.  It’s 
> unfortunate C and C++ do not behave the same here.
> 
> Do you read the OpenCL standard the same in not supporting two scalar types 
> here?

Yes; however, Clang (acting as OpenCL C frontend) accepts that without a
warning, and clspv accepts that with a confusing warning (but emits the
same code as Clang, i.e. forming vectors by broadcasting scalars).

They also disallow mismatching vector sizes, e.g. when the condition
is int4, but op2 and op3 are char4.

Alexander

Reply via email to