This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Gcc vector extensions
- From: Ian Lance Taylor <iant at google dot com>
- To: Hari Sandanagobalane <hariharans at picochip dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 28 Feb 2011 15:37:42 -0800
- Subject: Re: Gcc vector extensions
- References: <4D6BBD15.2010507@picochip.com>
Hari Sandanagobalane <hariharans@picochip.com> writes:
> Picochip processor has a vector unit that supports operations such as
>
> ADD imm,vsrc,vdest.
>
> where you can add a scalar value to a vector register. This is
> equivalent to adding every element of the vector register with the
> scalar value.
>
> GCC vector extensions allow for a scalar to be used for shift
> operations. This example from documentation says
>
> typedef int v4si __attribute__ ((vector_size (16)));
>
> v4si a, b;
>
> b = a >> 1; /* b = a >> {1,1,1,1}; */
>
> Is it possible to support
>
> b = a + 1 /* b = a + {1,1,1,1} */
>
> Or, is there any other way to represent this operation?
That is not currently supported as you wrote it. It would have to be
done using a builtin function.
Ian