This is the mail archive of the gcc@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]

RFC: PR14880 vec_duplicate or vec_select?


Hi David.  Hi Dorit.

I'm looking at 14880, and it suggests vecspltX patterns should be modeled 
with vec_duplicate, presumably to optimize with the vector optimizer.

I think what we want is vec_select, not vec_duplicate.

Take vspltw for instance:

	vspltw v0,v1,3

The specs say, we should put v1[3] into each element of v0.

I think the correct way to model this would be:

	(set (reg:V4SI v0)
	  (vec_select:V4SI (reg:V4SI v1)
			   (parallel [(const_int 3)
				      (const_int 3)
				      (const_int 3)
				      (const_int 3)])))

What do you guys think?  I'm not familiar with the vectorizer, so I don't
know what patterns are actually supported or used.

Let me know, so I can fix the patterns.

Cheers.
Aldy


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