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: [x86] do not issue invalid vec_select from V2DI


On Jan  5, 2006, Richard Henderson <rth@redhat.com> wrote:

> On Wed, Jan 04, 2006 at 09:05:22PM -0200, Alexandre Oliva wrote:
>> instead of the simpler (and SSE1-compatible, I hope, although this is
>> all new to me and I haven't found reliable docs on differences between
>> SSE1 and SSE2 so far):

> What you have isn't sse1 compatible; sse1 doesn't have anything
> to do with doubles or integers.  

Aah.  So how about this for SSE1, then?

(define_insn "*vec_extractv2di_sse"
  [(set (match_operand:DI 0 "nonimmediate_operand" "=x,m,x")
	(vec_select:DI
	  (match_operand:V2DI 1 "nonimmediate_operand" "x,x,o")
	  (parallel [(const_int 1)])))]
  "!TARGET_SSE2 && TARGET_SSE
   && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
  "@
   movhlps\t{%1, %0|%0, %1}
   movhps\t{%1, %0|%0, %1}
   movlps\t{%H1, %0|%0, %H1}"
  [(set_attr "type" "ssemov")
   (set_attr "mode" "V2SF,V4SF,V2SF")])

> See also typed registers and the reformatting costs associated.
> If we have an integer formatted register, unless optimizing for
> size, we prefer to use insns that operate on integers.  Thus the
> shift instead of movhlpd.

Even if additional copying (involving reformatting anyway?) would be
necessary to get the `0' constraint to fit?  I.e., could the fourth
alternative below (for SSE2) ever be a win, or should I just drop it?

(define_insn "*vec_extractv2di_sse2"
  [(set (match_operand:DI 0 "nonimmediate_operand" "=x,m,x,x")
	(vec_select:DI
	  (match_operand:V2DI 1 "nonimmediate_operand" "0,x,o,!x")
	  (parallel [(const_int 1)])))]
  "TARGET_SSE2 && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
  "@
   psrldq\t{$4, %0|%0, 4}
   movhpd\t{%1, %0|%0, %1}
   movlpd\t{%H1, %0|%0, %H1}
   movhlpd\t{$1, %0|%0, %1}"
  [(set_attr "type" "sseishft,ssemov,ssemov,ssemov")
   (set_attr "mode" "TI,V2DF,DF,V1DF")])

-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}


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