This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add Shift operation for vector types


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]