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: [rs6000] Enable scalar shifts of vectors


On Thu, Oct 13, 2011 at 11:43:35AM -0700, Richard Henderson wrote:
> On 10/13/2011 11:36 AM, David Edelsohn wrote:
> > Are there testcases in the GCC testsuite that exercise these patterns?
> 
> I thought the vectorizer would use them.  E.g. gcc.dg/vect/vect-shift-3.c.
> 
> I see that I should have added ppc to check_effective_target_vect_shift_scalar,
> though, to enable even more testing.

I tried this patch on trunk, and I'm not seeing any changes in the code.  I'll
include the test case and asm as attachments.

This is due to the code I put into tree-vect-generic.c (in
expand_vector_operations_1) that converts between vector shift by vector and
vector shift by scalar.  Note, that AMD's XOP shifts are also vector/vector
shifts.

The code shifting by a scalar is pretty bad in that it recalcuates the splat of
the shift element every time in the loop, rather than doing the splat once
before the loop.  We also have the problem we've had for a couple of years that
if the type is signed char or signed short, the compiler wants to promote the
items to int and does this by several unpacks and repacks.

-- 
Michael Meissner, IBM
5 Technology Place Drive, M/S 2757, Westford, MA 01886-3141, USA
meissner@linux.vnet.ibm.com	fax +1 (978) 399-6899

Attachment: foo.c
Description: Text document

Attachment: foo-signed-int.s
Description: Text document

Attachment: foo-unsigned-int.s
Description: Text document

Attachment: foo-signed-short.s
Description: Text document

Attachment: foo-unsigned-short.s
Description: Text document

Attachment: foo-signed-char.s
Description: Text document

Attachment: foo-unsigned-char.s
Description: Text document


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