Ian, Thanks for prompt reply. Just out of curiosity. Isn't this naming convention for shift instructions inconsistent with other patterns? For example, we can define add<vector_mode>3 and GCC will automatically use it by vectorization or in plus expression of two vector types. Why does shift need special names?
Bingfeng > -----Original Message----- > From: Ian Lance Taylor [mailto:i...@google.com] > Sent: 10 February 2009 14:31 > To: Bingfeng Mei > Cc: gcc@gcc.gnu.org > Subject: Re: Difference between vec_shl_<vector_mode> and > ashl<vector_mode>3 > > "Bingfeng Mei" <b...@broadcom.com> writes: > > > Could anyone explain to me what is difference between > > vec_shl_<vector_mode> and ashl<vector_mode>3 patterns? It > seems to me > > that both shift a vector operand 1 with scalar operand 2. > > The difference is that with a vector mode gcc will look for > the standard > name vec_shl_MODE, and with a non-vector mode gcc will look for the > standard name lshlMODE or ashlMODE. > > > I tried to understand some targets' implemenation, e.g., ia64 as > > follows, and cannot grasp their difference. > > The name which matters is vec_shr_<mode>. The fact that the > ia64 names > the real insn <lshr>mode3 does not imply that that insn name > is actually > used by anything. vec_shr_<mode> is a define_expand which is expands > into a pattern which is recognized by the <lshr>mode3 insn. > The name of > the <lshr>mode3 insn could change or be removed and everything would > work. > > Ian > >