Failure to vectorize widen mult through intermediate steps

Paulo Matos pmatos@broadcom.com
Mon Dec 3 16:56:00 GMT 2012


Is the lack of replies a sign that I missed to explain something in my email?

Cheers,

Paulo Matos


> -----Original Message-----
> From: gcc-owner@gcc.gnu.org [mailto:gcc-owner@gcc.gnu.org] On Behalf Of Paulo
> Matos
> Sent: 29 November 2012 17:04
> To: gcc@gcc.gnu.org
> Subject: Failure to vectorize widen mult through intermediate steps
> 
> Hello,
> 
> I have been looking at a piece of code that fails to vectorize because
> GCC4.7.0 is unable in suportable_widening_operation to provide proper
> conversions for a WIDEN_MULT_EXPR. vectype_in is V8HI and vectype_out is
> V2DI. The problem seems to be that GCC code at the end of this functions
> blocks the search for intermediate conversions. If GCC would look for them it
> would find:
> vec_widen_smult_lo_v8hi with v4si output
> vec_widen_smult_lo_v4si with v2di output
> however, since this search doesn't occur, vectorization fails.
> 
> How can I instruct GCC that it should take this steps to enable vectorization
> between these vectypes?
> I thought about defining vec_widen_smult_lo_v8hi with v2di output but can't
> because of the constraints on the pattern ("Multiply the high/low elements of
> the two vectors, and put the N/2 products of size 2*S in the output vector
> (operand 0).").
> 
> The hook TARGET_VECTORIZE_BUILTIN_CONVERSION sounds like it could be what I
> want but I added some test code and in my simple example this function is
> never called.
> 
> Any suggestions on how to work this out in the backend?
> 
> Cheers,
> 
> Paulo Matos
> 



More information about the Gcc mailing list