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]

SSE fix 22 - movti fix


Hi,
I am getting crashes on loading 0 into register.  This is because movti
accepts general operand (that is wrong) and has constraint 'O' that is
not defined.
I am having something similar code in movss and movdi patterns, but for
CONST_DOUBLES.  We should handle CONST_VECTORS too, so I think we should
define EXTRA_CONSTRAINT accepting all the constants.  In case this does
not have serious problem somewhere I will kill the existing 'H'
constraint used for CONST_DOUBLES and fix other move patterns too.

Honza

Tue Oct 22 16:50:37 CEST 2002  Jan Hubicka  <jh@suse.cz>
	* i386.c (standard_sse_constant_p): Accept vector and integer zeros too.
	* i386.h (EXTRA_CONSTRAINT): Recognize 'C'
	* i386.md (movti_internal): Use 'C'
Index: i386.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386.c,v
retrieving revision 1.480
diff -c -3 -p -r1.480 i386.c
*** i386.c	21 Oct 2002 22:09:05 -0000	1.480
--- i386.c	22 Oct 2002 14:46:15 -0000
*************** int
*** 3750,3757 ****
  standard_sse_constant_p (x)
       rtx x;
  {
!   if (GET_CODE (x) != CONST_DOUBLE)
!     return -1;
    return (x == CONST0_RTX (GET_MODE (x)));
  }
  
--- 3828,3835 ----
  standard_sse_constant_p (x)
       rtx x;
  {
!   if (x == const0_rtx)
!     return 1;
    return (x == CONST0_RTX (GET_MODE (x)));
  }
  
Index: i386.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386.h,v
retrieving revision 1.300
diff -c -3 -p -r1.300 i386.h
*** i386.h	21 Oct 2002 22:09:05 -0000	1.300
--- i386.h	22 Oct 2002 14:46:16 -0000
*************** enum reg_class
*** 1425,1433 ****
     the constraint letter C.  If C is not defined as an extra
     constraint, the value returned should be 0 regardless of VALUE.  */
  
! #define EXTRA_CONSTRAINT(VALUE, C)				\
!   ((C) == 'e' ? x86_64_sign_extended_value (VALUE, 0)		\
!    : (C) == 'Z' ? x86_64_zero_extended_value (VALUE)		\
     : 0)
  
  /* Place additional restrictions on the register class to use when it
--- 1425,1434 ----
     the constraint letter C.  If C is not defined as an extra
     constraint, the value returned should be 0 regardless of VALUE.  */
  
! #define EXTRA_CONSTRAINT(VALUE, D)				\
!   ((D) == 'e' ? x86_64_sign_extended_value (VALUE, 0)		\
!    : (D) == 'Z' ? x86_64_zero_extended_value (VALUE)		\
!    : (D) == 'C' ? standard_sse_constant_p (VALUE)		\
     : 0)
  
  /* Place additional restrictions on the register class to use when it
Index: i386.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386.md,v
retrieving revision 1.394
diff -c -3 -p -r1.394 i386.md
*** i386.md	21 Oct 2002 22:09:05 -0000	1.394
--- i386.md	22 Oct 2002 14:46:22 -0000
***************
*** 18145,18151 ****
  
  (define_insn "movti_internal"
    [(set (match_operand:TI 0 "nonimmediate_operand" "=x,x,m")
! 	(match_operand:TI 1 "general_operand" "O,xm,x"))]
    "TARGET_SSE && !TARGET_64BIT"
    "@
     xorps\t%0, %0
--- 18145,18151 ----
  
  (define_insn "movti_internal"
    [(set (match_operand:TI 0 "nonimmediate_operand" "=x,x,m")
! 	(match_operand:TI 1 "general_operand" "C,xm,x"))]
    "TARGET_SSE && !TARGET_64BIT"
    "@
     xorps\t%0, %0


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