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  6, 2006, Richard Henderson <rth@redhat.com> wrote:

> On Fri, Jan 06, 2006 at 09:59:55PM -0200, Alexandre Oliva wrote:
>> * config/i386/sse.md (*vec_extractv2di_1_sse2): New.
>> (*vec_extractv2di_1_sse): New.

> Yes.  But like I said, we need a similar set of sse1 patterns
> for V2DF.

As I worked on the V2DF patterns, I realized the new V2DI patterns
didn't follow the style of the other patterns in sse.md (store,
reg-to-reg, load, in this order), so this patch adjusts that.

I also noticed that the modes in the SSE1 pattern were wrong (probably
because of a cut&paste error due to the different style), so I fixed
that too.  Testing now.  I'll check it in as obvious if testing
succeeds.

Index: gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* config/i386/sse.md (*vec_extractv2di_1_sse2): Reorder
	alternatives to match style of other entries.
	(*vec_extractv2di_1_sse): Likewise.  Fix mode attr.

Index: gcc/config/i386/sse.md
===================================================================
--- gcc/config/i386/sse.md.orig	2006-01-09 14:59:18.000000000 -0200
+++ gcc/config/i386/sse.md	2006-01-09 15:02:09.000000000 -0200
@@ -3495,29 +3495,29 @@
 })
 
 (define_insn "*vec_extractv2di_1_sse2"
-  [(set (match_operand:DI 0 "nonimmediate_operand" "=x,m,x")
+  [(set (match_operand:DI 0 "nonimmediate_operand" "=m,x,x")
 	(vec_select:DI
-	  (match_operand:V2DI 1 "nonimmediate_operand" "0,x,o")
+	  (match_operand:V2DI 1 "nonimmediate_operand" "x,0,o")
 	  (parallel [(const_int 1)])))]
   "TARGET_SSE2 && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
   "@
-   psrldq\t{$4, %0|%0, 4}
    movhps\t{%1, %0|%0, %1}
+   psrldq\t{$4, %0|%0, 4}
    movq\t{%H1, %0|%0, %H1}"
-  [(set_attr "type" "sseishft,ssemov,ssemov")
-   (set_attr "mode" "TI,V4SF,TI")])
+  [(set_attr "type" "ssemov,sseishft,ssemov")
+   (set_attr "mode" "V2SF,TI,TI")])
 
 ;; Not sure this is ever used, but it doesn't hurt to have it. -aoliva
 (define_insn "*vec_extractv2di_1_sse"
-  [(set (match_operand:DI 0 "nonimmediate_operand" "=x,m,x")
+  [(set (match_operand:DI 0 "nonimmediate_operand" "=m,x,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}
+   movhlps\t{%1, %0|%0, %1}
    movlps\t{%H1, %0|%0, %H1}"
   [(set_attr "type" "ssemov")
    (set_attr "mode" "V2SF,V4SF,V2SF")])
-- 
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]