Re: Native support for vector shift

2009-02-24 Thread Paolo Bonzini
>> It shouldn't be too hard to add the support. I suspect the person who did >> the >> initial support may have been on a machine without vector shifts. > > Nope, because it was originally done by Aldy who did the VMX support > which had vector shifts. OTOH the support for vector lowering was w

Re: Native support for vector shift

2009-02-24 Thread Andrew Pinski
On Tue, Feb 24, 2009 at 2:01 PM, Michael Meissner wrote: > On Tue, Feb 24, 2009 at 01:19:44PM -0800, Bingfeng Mei wrote: >> Yes, I am aware of both types of vector shift. Our target VLIW >> actually supports both and I have implemented all related patterns >> in our porting. But it would be still

Re: Native support for vector shift

2009-02-24 Thread Michael Meissner
On Tue, Feb 24, 2009 at 01:19:44PM -0800, Bingfeng Mei wrote: > Yes, I am aware of both types of vector shift. Our target VLIW > actually supports both and I have implemented all related patterns > in our porting. But it would be still nice to allow programmer > explicitly use vector shift, prefer

RE: Native support for vector shift

2009-02-24 Thread Bingfeng Mei
; From: Michael Meissner [mailto:meiss...@linux.vnet.ibm.com] > Sent: 24 February 2009 21:07 > To: Bingfeng Mei > Cc: gcc@gcc.gnu.org > Subject: Re: Native support for vector shift > > On Tue, Feb 24, 2009 at 06:15:37AM -0800, Bingfeng Mei wrote: > > Hello, > > For the

Re: Native support for vector shift

2009-02-24 Thread Michael Meissner
On Tue, Feb 24, 2009 at 06:15:37AM -0800, Bingfeng Mei wrote: > Hello, > For the targets that support vectors, we can write the following code: > > typedef shortV4H __attribute__ ((vector_size (8))); > > V4H tst(V4H a, V4H b){ > return a + b; > } > > Other operators such as -, *, |, &, ^

RE: Native support for vector shift

2009-02-24 Thread Bingfeng Mei
; short b; c = a + b; Instead of using c = a + (V4H){b, b, b, b}; This can be useful. > -Original Message- > From: Joseph Myers [mailto:jos...@codesourcery.com] > Sent: 24 February 2009 18:52 > To: Bingfeng Mei > Cc: gcc@gcc.gnu.org > Subject: Re: Native support for ve

Re: Native support for vector shift

2009-02-24 Thread Joseph S. Myers
On Tue, 24 Feb 2009, Bingfeng Mei wrote: > Currently, we have to use intrinsics to support such shift. Isn't syntax > of vector shift intuitive enough to be supported natively? Someone may > argue it breaks the C language. But vector is a GCC extension anyway. > Support for vector add/sub/etc a

Re: Native support for vector shift

2009-02-24 Thread Paolo Bonzini
> Currently, we have to use intrinsics to support such shift. Isn't syntax of > vector > shift intuitive enough to be supported natively? Someone may argue it breaks > the > C language. But vector is a GCC extension anyway. Support for vector > add/sub/etc > already break C syntax. Any thought?