[cfe-dev] vector constructors

Chris Lattner clattner at apple.com
Tue Mar 16 11:48:26 PDT 2010


On Mar 16, 2010, at 11:39 AM, Jochen Wilhelmy wrote:

> Hi!
> 
> I'd like to do this myself but I have to dig into clang only for this 
> wich takes some
> time therefore I'd like to ask if someone is already is working on it 
> (or wants to do it ;-) :
> 
> for c, the cast operator is extended to vectors (opencl):
> (int)(1)
> (int4)(1, 2, 3, 4)
> 
> for c++ the same could be done:
> int(1)
> int4(1, 2, 3, 4)
> 
> I use this variant since it can be emulated with c++ classes when no vector
> extensions are available.
> 
> Will it be supported in the near future?

This is already supported with -faltivec, you can enable the LangOptions flag to get this.

-Chris



More information about the cfe-dev mailing list