This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add Shift operation for vector types
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Andrew Pinski <Andrew_Pinski at playstation dot sony dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Trevor_Smigiel <Trevor_Smigiel at playstation dot sony dot com>
- Date: Thu, 8 Oct 2009 22:40:44 +0000 (UTC)
- Subject: Re: [PATCH] Add Shift operation for vector types
- References: <de8d50360907061645t2d8e71bu33faaf2a80901b42@mail.gmail.com> <de8d50360910021412p568159b0nb053b2c83de1a208@mail.gmail.com>
On Fri, 2 Oct 2009, Andrew Pinski wrote:
> On Mon, Jul 6, 2009 at 4:45 PM, Andrew Pinski
> <Andrew_Pinski@playstation.sony.com> wrote:
> > Hi,
> > The Cell C/C++ Language extension document includes a shift
> > operations for vector types. These operators take an integer vector
> > type and does an element by element shift, just like what is done for
> > addition and subtraction.
Do I understand correctly that it is also intended that the vectors must
have the same width and number of elements (but possibly different
signedness)?
If so, the testcases should cover this (errors for different width, errors
for different number of elements, allowing different signedness, errors if
either vector is floating point).
The tests should also verify that signed shift operations where the sign
bit is involved act as documented in implement-c.texi for individual
elements, and should test unsigned shift operations where the result
differs from that of signed shift (right shifting values with the top bit
set). It would also be good to run tests for different base types and
vector lengths (after all, the conversion to scalar code could generate
things such as shifts on types smaller than int that wouldn't arise
directly in normal C code, so it may not be obvious that it's well-tested
whether such operations on char or short work correctly at present,
although certainly valid GIMPLE), and to test shift count vectors that do
not have all counts equal.
--
Joseph S. Myers
joseph@codesourcery.com