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: Fix PR target/19235


On Mon, Jan 03, 2005 at 01:21:31PM -0800, Richard Henderson wrote:
> There *is* a way to load 8 bytes into an xmm register in sse1;
> we just need to use it.
> 
> I'm testing the following.

Not quite complete.  A full audit shows a couple more patterns affected.

Committed.


r~


        PR target/19235
        * config/i386/i386.md (movdi_2): Separate SSE1 and SSE2 alternatives.
        (mov<MMXMODEI>_internal): Likewise.
        (movdf_nointeger): Prefer Y while not preferring, but allowing, x.
        Add V2SF case; use it for SSE1; don't use TI.
        (movdf_integer): Likewise.
        (mov<SSEMODEI>_internal, movti_internal): Force V4SF for SSE1.

Index: config/i386/i386.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.md,v
retrieving revision 1.597
diff -c -p -d -r1.597 i386.md
*** config/i386/i386.md	3 Jan 2005 09:54:53 -0000	1.597
--- config/i386/i386.md	4 Jan 2005 09:54:33 -0000
***************
*** 1899,1906 ****
     (set_attr "length_immediate" "1")])
  
  (define_insn "*movdi_2"
!   [(set (match_operand:DI 0 "nonimmediate_operand" "=r,o,!m*y,!*y,!m,!*x,!*x")
! 	(match_operand:DI 1 "general_operand" "riFo,riF,*y,m,*x,*x,m"))]
    "!TARGET_64BIT
     && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)"
    "@
--- 1899,1908 ----
     (set_attr "length_immediate" "1")])
  
  (define_insn "*movdi_2"
!   [(set (match_operand:DI 0 "nonimmediate_operand"
! 					"=r  ,o  ,m*y,*y,m ,*Y,*Y,m ,*x,*x")
! 	(match_operand:DI 1 "general_operand"
! 					"riFo,riF,*y ,m ,*Y,*Y,m ,*x,*x,m "))]
    "!TARGET_64BIT
     && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)"
    "@
***************
*** 1910,1918 ****
     movq\t{%1, %0|%0, %1}
     movq\t{%1, %0|%0, %1}
     movdqa\t{%1, %0|%0, %1}
!    movq\t{%1, %0|%0, %1}"
!   [(set_attr "type" "*,*,mmx,mmx,ssemov,ssemov,ssemov")
!    (set_attr "mode" "DI,DI,DI,DI,DI,TI,DI")])
  
  (define_split
    [(set (match_operand:DI 0 "push_operand" "")
--- 1912,1923 ----
     movq\t{%1, %0|%0, %1}
     movq\t{%1, %0|%0, %1}
     movdqa\t{%1, %0|%0, %1}
!    movq\t{%1, %0|%0, %1}
!    movlps\t{%1, %0|%0, %1}
!    movaps\t{%1, %0|%0, %1}
!    movlps\t{%1, %0|%0, %1}"
!   [(set_attr "type" "*,*,mmx,mmx,ssemov,ssemov,ssemov,ssemov,ssemov,ssemov")
!    (set_attr "mode" "DI,DI,DI,DI,DI,TI,DI,V2SF,V4SF,V2SF")])
  
  (define_split
    [(set (match_operand:DI 0 "push_operand" "")
***************
*** 2444,2452 ****
  
  (define_insn "*movdf_nointeger"
    [(set (match_operand:DF 0 "nonimmediate_operand"
! 				"=f#x,m  ,f#x,*r  ,o  ,x#f,x#f,x#f  ,m")
  	(match_operand:DF 1 "general_operand"
! 				"fm#x,f#x,G  ,*roF,F*r,C  ,x#f,xHm#f,x#f"))]
    "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
     && ((optimize_size || !TARGET_INTEGER_DFMODE_MOVES) && !TARGET_64BIT)
     && (reload_in_progress || reload_completed
--- 2449,2457 ----
  
  (define_insn "*movdf_nointeger"
    [(set (match_operand:DF 0 "nonimmediate_operand"
! 			"=f#Y,m  ,f#Y,*r  ,o  ,Y#f*x,Y#f*x,Y#f*x  ,m    ")
  	(match_operand:DF 1 "general_operand"
! 			"fm#Y,f#Y,G  ,*roF,F*r,C    ,Y#f*x,HmY#f*x,Y#f*x"))]
    "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
     && ((optimize_size || !TARGET_INTEGER_DFMODE_MOVES) && !TARGET_64BIT)
     && (reload_in_progress || reload_completed
***************
*** 2500,2505 ****
--- 2505,2512 ----
  	  return "movsd\t{%1, %0|%0, %1}";
  	case MODE_V1DF:
  	  return "movlpd\t{%1, %0|%0, %1}";
+ 	case MODE_V2SF:
+ 	  return "movlps\t{%1, %0|%0, %1}";
  	default:
  	  abort ();
  	}
***************
*** 2510,2527 ****
  }
    [(set_attr "type" "fmov,fmov,fmov,multi,multi,ssemov,ssemov,ssemov,ssemov")
     (set (attr "mode")
!         (cond [(eq_attr "alternative" "3,4")
  		 (const_string "SI")
  
  	       /* For SSE1, we have many fewer alternatives.  */
  	       (eq (symbol_ref "TARGET_SSE2") (const_int 0))
  		 (cond [(eq_attr "alternative" "5,6")
! 			  (if_then_else
! 			    (ne (symbol_ref "optimize_size") (const_int 0))
! 			    (const_string "V4SF")
! 			    (const_string "TI"))
  		       ]
! 		   (const_string "DI"))
  
  	       /* xorps is one byte shorter.  */
  	       (eq_attr "alternative" "5")
--- 2517,2533 ----
  }
    [(set_attr "type" "fmov,fmov,fmov,multi,multi,ssemov,ssemov,ssemov,ssemov")
     (set (attr "mode")
!         (cond [(eq_attr "alternative" "0,1,2")
! 		 (const_string "DF")
! 	       (eq_attr "alternative" "3,4")
  		 (const_string "SI")
  
  	       /* For SSE1, we have many fewer alternatives.  */
  	       (eq (symbol_ref "TARGET_SSE2") (const_int 0))
  		 (cond [(eq_attr "alternative" "5,6")
! 			  (const_string "V4SF")
  		       ]
! 		   (const_string "V2SF"))
  
  	       /* xorps is one byte shorter.  */
  	       (eq_attr "alternative" "5")
***************
*** 2563,2571 ****
  
  (define_insn "*movdf_integer"
    [(set (match_operand:DF 0 "nonimmediate_operand"
! 			"=f#Yr,m   ,f#Yr,r#Yf  ,o    ,Y#rf,Y#rf,Y#rf ,m")
  	(match_operand:DF 1 "general_operand"
! 			"fm#Yr,f#Yr,G   ,roF#Yf,Fr#Yf,C   ,Y#rf,Ym#rf,Y#rf"))]
    "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
     && ((!optimize_size && TARGET_INTEGER_DFMODE_MOVES) || TARGET_64BIT)
     && (reload_in_progress || reload_completed
--- 2569,2577 ----
  
  (define_insn "*movdf_integer"
    [(set (match_operand:DF 0 "nonimmediate_operand"
! 		"=f#Yr,m   ,f#Yr,r#Yf  ,o    ,Y#rf*x,Y#rf*x,Y#rf*x,m")
  	(match_operand:DF 1 "general_operand"
! 		"fm#Yr,f#Yr,G   ,roF#Yf,Fr#Yf,C     ,Y#rf*x,m     ,Y#rf*x"))]
    "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
     && ((!optimize_size && TARGET_INTEGER_DFMODE_MOVES) || TARGET_64BIT)
     && (reload_in_progress || reload_completed
***************
*** 2620,2625 ****
--- 2626,2633 ----
  	  return "movsd\t{%1, %0|%0, %1}";
  	case MODE_V1DF:
  	  return "movlpd\t{%1, %0|%0, %1}";
+ 	case MODE_V2SF:
+ 	  return "movlps\t{%1, %0|%0, %1}";
  	default:
  	  abort ();
  	}
***************
*** 2630,2647 ****
  }
    [(set_attr "type" "fmov,fmov,fmov,multi,multi,ssemov,ssemov,ssemov,ssemov")
     (set (attr "mode")
!         (cond [(eq_attr "alternative" "3,4")
  		 (const_string "SI")
  
  	       /* For SSE1, we have many fewer alternatives.  */
  	       (eq (symbol_ref "TARGET_SSE2") (const_int 0))
  		 (cond [(eq_attr "alternative" "5,6")
! 			  (if_then_else
! 			    (ne (symbol_ref "optimize_size") (const_int 0))
! 			    (const_string "V4SF")
! 			    (const_string "TI"))
  		       ]
! 		   (const_string "DI"))
  
  	       /* xorps is one byte shorter.  */
  	       (eq_attr "alternative" "5")
--- 2638,2654 ----
  }
    [(set_attr "type" "fmov,fmov,fmov,multi,multi,ssemov,ssemov,ssemov,ssemov")
     (set (attr "mode")
!         (cond [(eq_attr "alternative" "0,1,2")
! 		 (const_string "DF")
! 	       (eq_attr "alternative" "3,4")
  		 (const_string "SI")
  
  	       /* For SSE1, we have many fewer alternatives.  */
  	       (eq (symbol_ref "TARGET_SSE2") (const_int 0))
  		 (cond [(eq_attr "alternative" "5,6")
! 			  (const_string "V4SF")
  		       ]
! 		   (const_string "V2SF"))
  
  	       /* xorps is one byte shorter.  */
  	       (eq_attr "alternative" "5")
***************
*** 19825,19831 ****
  }
    [(set_attr "type" "ssemov")
     (set (attr "mode")
!         (cond [(eq_attr "alternative" "0,1")
  		 (if_then_else
  		   (ne (symbol_ref "optimize_size")
  		       (const_int 0))
--- 19832,19841 ----
  }
    [(set_attr "type" "ssemov")
     (set (attr "mode")
!         (cond [(eq (symbol_ref "TARGET_SSE2") (const_int 0))
! 		 (const_string "V4SF")
! 
! 	       (eq_attr "alternative" "0,1")
  		 (if_then_else
  		   (ne (symbol_ref "optimize_size")
  		       (const_int 0))
***************
*** 19878,19886 ****
  
  (define_insn "*mov<mode>_internal"
    [(set (match_operand:MMXMODEI 0 "nonimmediate_operand"
! 					"=*y,*y ,m ,*y,*Y,*x,*x ,m")
  	(match_operand:MMXMODEI 1 "vector_move_operand"
! 					"C  ,*ym,*y,*Y,*y,C ,*xm,*x"))]
    "TARGET_MMX
     && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)"
    "@
--- 19888,19896 ----
  
  (define_insn "*mov<mode>_internal"
    [(set (match_operand:MMXMODEI 0 "nonimmediate_operand"
! 				"=*y,*y ,m ,*y,*Y,*Y,*Y ,m ,*x,*x,*x,m")
  	(match_operand:MMXMODEI 1 "vector_move_operand"
! 				"C  ,*ym,*y,*Y,*y,C ,*Ym,*Y,C ,*x,m ,*x"))]
    "TARGET_MMX
     && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)"
    "@
***************
*** 19891,19899 ****
      movq2dq\t{%1, %0|%0, %1}
      pxor\t%0, %0
      movq\t{%1, %0|%0, %1}
!     movq\t{%1, %0|%0, %1}"
!   [(set_attr "type" "mmxmov,mmxmov,mmxmov,ssecvt,ssecvt,ssemov,ssemov,ssemov")
!    (set_attr "mode" "DI")])
  
  (define_expand "movv2sf"
    [(set (match_operand:V2SF 0 "nonimmediate_operand" "")
--- 19901,19913 ----
      movq2dq\t{%1, %0|%0, %1}
      pxor\t%0, %0
      movq\t{%1, %0|%0, %1}
!     movq\t{%1, %0|%0, %1}
!     xorps\t%0, %0
!     movaps\t{%1, %0|%0, %1}
!     movlps\t{%1, %0|%0, %1}
!     movlps\t{%1, %0|%0, %1}"
!   [(set_attr "type" "mmxmov,mmxmov,mmxmov,ssecvt,ssecvt,ssemov,ssemov,ssemov,ssemov,ssemov,ssemov,ssemov")
!    (set_attr "mode" "DI,DI,DI,DI,DI,TI,DI,DI,V4SF,V4SF,V2SF,V2SF")])
  
  (define_expand "movv2sf"
    [(set (match_operand:V2SF 0 "nonimmediate_operand" "")
***************
*** 19983,19989 ****
  }
    [(set_attr "type" "ssemov,ssemov,ssemov")
     (set (attr "mode")
!         (cond [(eq_attr "alternative" "0,1")
  		 (if_then_else
  		   (ne (symbol_ref "optimize_size")
  		       (const_int 0))
--- 19997,20006 ----
  }
    [(set_attr "type" "ssemov,ssemov,ssemov")
     (set (attr "mode")
!         (cond [(eq (symbol_ref "TARGET_SSE2") (const_int 0))
! 		 (const_string "V4SF")
! 
! 	       (eq_attr "alternative" "0,1")
  		 (if_then_else
  		   (ne (symbol_ref "optimize_size")
  		       (const_int 0))


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