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]

[3.1] Re: RFH PR 5877 (sse comparisons)


> Hi,
> this patch should solve the problem.  The sse comparison act in swapped
> way compared to i387 comparisons so the splitter is swapping them, but
> since pattern has constraints in non-swapped way, the resulting code is
> invalid.
> 
> I've also noticed that SSE_FLOAT_MODE_P is returning 0 when TARGET_SSE_MATH
> is disabled.  THis is not correct - we still want to use SSE for operations
> that can be safely done in it w/o losing the extra precisity glibc (and
> perhaps some other) folks depends on.
> 
> Bootstrapped/regtested i386, but I can not give it proper testing with
> SSE code right now :(
> OK for branch?
> 
> Honza
> 
> Thu Mar 14 12:42:38 CET 2002  Jan Hubicka  <jh@suse.cz>
> 	* i386.h (SSE_FLOAT_MODE_P): Kill bogus TARGET_SSE_MATH check.
> 	* i386.c (sse_mov?fcc*): Swap operands for cases they will be swapped
> 	later.

Unfortunately the second part of the patch is wrong.  I've got my mind crazy
about quadruple swapping and counted tripple swapping.  The first part
is already enought to fix the testcase.

Adding swaps makes gcc to crash on comparisons containing memory.  I am
attaching patch to revert the second change. I've bootstrapped and verified
that it still compiles the testcase and additionally builds spec2000fp with
-mfpmath=sse.

Mark: I would like to see this patch in the branch.  It can be clasified as
regression as gcc fails to build spec with -march=pentium4, even when the
-march=pentium4 was missing in 3.0

There is no risc it will break SSE-less code generation.

Bootstrapped/regtested i386 mainline/branch.

Mon Apr 29 14:48:33 CEST 2002  Jan Hubicka  <jh@suse.cz>

	* i386.c (sse_mov?fcc*): Revert patch of Mar 14th.

Index: i386.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386.md,v
retrieving revision 1.347
diff -c -3 -p -r1.347 i386.md
*** i386.md	27 Apr 2002 00:26:36 -0000	1.347
--- i386.md	29 Apr 2002 12:47:48 -0000
***************
*** 16543,16550 ****
  (define_insn "sse_movsfcc"
    [(set (match_operand:SF 0 "register_operand" "=&x#rf,x#rf,?f#xr,?f#xr,?f#xr,?f#xr,?r#xf,?r#xf,?r#xf,?r#xf")
  	(if_then_else:SF (match_operator 1 "sse_comparison_operator"
! 			[(match_operand:SF 4 "nonimmediate_operand" "0#fx,x#fx,f#x,f#x,x#f,x#f,f#x,f#x,x#f,x#f")
! 			 (match_operand:SF 5 "nonimmediate_operand" "xm#f,xm#f,f#x,f#x,xm#f,xm#f,f#x,f#x,xm#f,xm#f")])
  		      (match_operand:SF 2 "nonimmediate_operand" "x#fr,0#fr,f#fx,0#fx,f#fx,0#fx,rm#rx,0#rx,rm#rx,0#rx")
  		      (match_operand:SF 3 "nonimmediate_operand" "x#fr,x#fr,0#fx,f#fx,0#fx,f#fx,0#fx,rm#rx,0#rx,rm#rx")))
     (clobber (match_scratch:SF 6 "=2,&4,X,X,X,X,X,X,X,X"))
--- 16543,16550 ----
  (define_insn "sse_movsfcc"
    [(set (match_operand:SF 0 "register_operand" "=&x#rf,x#rf,?f#xr,?f#xr,?f#xr,?f#xr,?r#xf,?r#xf,?r#xf,?r#xf")
  	(if_then_else:SF (match_operator 1 "sse_comparison_operator"
! 			[(match_operand:SF 4 "nonimmediate_operand" "0#fx,x#fx,f#x,f#x,xm#f,xm#f,f#x,f#x,xm#f,xm#f")
! 			 (match_operand:SF 5 "nonimmediate_operand" "xm#f,xm#f,f#x,f#x,x#f,x#f,f#x,f#x,x#f,x#f")])
  		      (match_operand:SF 2 "nonimmediate_operand" "x#fr,0#fr,f#fx,0#fx,f#fx,0#fx,rm#rx,0#rx,rm#rx,0#rx")
  		      (match_operand:SF 3 "nonimmediate_operand" "x#fr,x#fr,0#fx,f#fx,0#fx,f#fx,0#fx,rm#rx,0#rx,rm#rx")))
     (clobber (match_scratch:SF 6 "=2,&4,X,X,X,X,X,X,X,X"))
***************
*** 16557,16564 ****
  
  (define_insn "sse_movsfcc_eq"
    [(set (match_operand:SF 0 "register_operand" "=&x#rf,x#rf,?f#xr,?f#xr,?r#xf,?r#xf")
! 	(if_then_else:SF (eq (match_operand:SF 3 "nonimmediate_operand" "%0#fx,x#fx,f#x,x#f,f#x,x#f")
! 			     (match_operand:SF 4 "nonimmediate_operand" "xm#f,xm#f,f#x,xm#f,f#x,xm#f"))
  		      (match_operand:SF 1 "nonimmediate_operand" "x#fr,0#fr,0#fx,0#fx,0#rx,0#rx")
  		      (match_operand:SF 2 "nonimmediate_operand" "x#fr,x#fr,f#fx,f#fx,rm#rx,rm#rx")))
     (clobber (match_scratch:SF 5 "=1,&3,X,X,X,X"))
--- 16557,16564 ----
  
  (define_insn "sse_movsfcc_eq"
    [(set (match_operand:SF 0 "register_operand" "=&x#rf,x#rf,?f#xr,?f#xr,?r#xf,?r#xf")
! 	(if_then_else:SF (eq (match_operand:SF 3 "nonimmediate_operand" "%0#fx,x#fx,f#x,xm#f,f#x,xm#f")
! 			     (match_operand:SF 4 "nonimmediate_operand" "xm#f,xm#f,f#x,x#f,f#x,x#f"))
  		      (match_operand:SF 1 "nonimmediate_operand" "x#fr,0#fr,0#fx,0#fx,0#rx,0#rx")
  		      (match_operand:SF 2 "nonimmediate_operand" "x#fr,x#fr,f#fx,f#fx,rm#rx,rm#rx")))
     (clobber (match_scratch:SF 5 "=1,&3,X,X,X,X"))
***************
*** 16570,16577 ****
  (define_insn "sse_movdfcc"
    [(set (match_operand:DF 0 "register_operand" "=&x#rf,x#rf,?f#xr,?f#xr,?f#xr,?f#xr,?r#xf,?r#xf,?r#xf,?r#xf")
  	(if_then_else:DF (match_operator 1 "sse_comparison_operator"
! 			[(match_operand:DF 4 "nonimmediate_operand" "0#fx,x#fx,f#x,f#x,x#f,x#f,f#x,f#x,x#f,x#f")
! 			 (match_operand:DF 5 "nonimmediate_operand" "xm#f,xm#f,f#x,f#x,xm#f,xm#f,f#x,f#x,xm#f,xm#f")])
  		      (match_operand:DF 2 "nonimmediate_operand" "x#fr,0#fr,f#fx,0#fx,f#fx,0#fx,rm#rx,0#rx,rm#rx,0#rx")
  		      (match_operand:DF 3 "nonimmediate_operand" "x#fr,x#fr,0#fx,f#fx,0#fx,f#fx,0#fx,rm#rx,0#rx,rm#rx")))
     (clobber (match_scratch:DF 6 "=2,&4,X,X,X,X,X,X,X,X"))
--- 16570,16577 ----
  (define_insn "sse_movdfcc"
    [(set (match_operand:DF 0 "register_operand" "=&x#rf,x#rf,?f#xr,?f#xr,?f#xr,?f#xr,?r#xf,?r#xf,?r#xf,?r#xf")
  	(if_then_else:DF (match_operator 1 "sse_comparison_operator"
! 			[(match_operand:DF 4 "nonimmediate_operand" "0#fx,x#fx,f#x,f#x,xm#f,xm#f,f#x,f#x,xm#f,xm#f")
! 			 (match_operand:DF 5 "nonimmediate_operand" "xm#f,xm#f,f#x,f#x,x#f,x#f,f#x,f#x,x#f,x#f")])
  		      (match_operand:DF 2 "nonimmediate_operand" "x#fr,0#fr,f#fx,0#fx,f#fx,0#fx,rm#rx,0#rx,rm#rx,0#rx")
  		      (match_operand:DF 3 "nonimmediate_operand" "x#fr,x#fr,0#fx,f#fx,0#fx,f#fx,0#fx,rm#rx,0#rx,rm#rx")))
     (clobber (match_scratch:DF 6 "=2,&4,X,X,X,X,X,X,X,X"))
***************
*** 16584,16591 ****
  
  (define_insn "sse_movdfcc_eq"
    [(set (match_operand:DF 0 "register_operand" "=&x#rf,x#rf,?f#xr,?f#xr,?r#xf,?r#xf")
! 	(if_then_else:DF (eq (match_operand:DF 3 "nonimmediate_operand" "%0#fx,x#fx,f#x,x#f,f#x,x#f")
! 			     (match_operand:DF 4 "nonimmediate_operand" "xm#f,xm#f,f#x,xm#f,f#x,xm#f"))
  		      (match_operand:DF 1 "nonimmediate_operand" "x#fr,0#fr,0#fx,0#fx,0#rx,0#rx")
  		      (match_operand:DF 2 "nonimmediate_operand" "x#fr,x#fr,f#fx,f#fx,rm#rx,rm#rx")))
     (clobber (match_scratch:DF 5 "=1,&3,X,X,X,X"))
--- 16584,16591 ----
  
  (define_insn "sse_movdfcc_eq"
    [(set (match_operand:DF 0 "register_operand" "=&x#rf,x#rf,?f#xr,?f#xr,?r#xf,?r#xf")
! 	(if_then_else:DF (eq (match_operand:DF 3 "nonimmediate_operand" "%0#fx,x#fx,f#x,xm#f,f#x,xm#f")
! 			     (match_operand:DF 4 "nonimmediate_operand" "xm#f,xm#f,f#x,x#f,f#x,x#f"))
  		      (match_operand:DF 1 "nonimmediate_operand" "x#fr,0#fr,0#fx,0#fx,0#rx,0#rx")
  		      (match_operand:DF 2 "nonimmediate_operand" "x#fr,x#fr,f#fx,f#fx,rm#rx,rm#rx")))
     (clobber (match_scratch:DF 5 "=1,&3,X,X,X,X"))
***************
*** 16599,16605 ****
    [(set (match_operand 0 "register_operand" "")
  	(if_then_else (match_operator 1 "comparison_operator"
  			[(match_operand 4 "nonimmediate_operand" "")
! 			 (match_operand 5 "nonimmediate_operand" "")])
  		      (match_operand 2 "nonimmediate_operand" "")
  		      (match_operand 3 "nonimmediate_operand" "")))
     (clobber (match_operand 6 "" ""))
--- 16599,16605 ----
    [(set (match_operand 0 "register_operand" "")
  	(if_then_else (match_operator 1 "comparison_operator"
  			[(match_operand 4 "nonimmediate_operand" "")
! 			 (match_operand 5 "register_operand" "")])
  		      (match_operand 2 "nonimmediate_operand" "")
  		      (match_operand 3 "nonimmediate_operand" "")))
     (clobber (match_operand 6 "" ""))


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