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]

i386 fp comaprisons fix version 2


Hi
After my CC mode changes, the fp comparison fix has simplified.
The problem in current code is that if_then_else does have always VOIDmode
operand, while patterns attempt to use it's mode to determine whether fcmp
or ficom instructions are useable.

This show as crash in -ffast-math compilation of byte benchmarks.

Honza

Mon Sep 18 16:14:31 MET DST 2000  Jan Hubicka  <jh@suse.cz>
	* i386.md (fp_jcc_3, fp_jcc_4, jp_fcc_5): if_then_else operand
	is VOIDmode.
	(fp_jcc_4): Refuse unordered comparisons.

Index: egcs/gcc/config/i386/i386.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386.md,v
retrieving revision 1.182
diff -c -3 -p -r1.182 i386.md
*** i386.md	2000/09/18 09:50:19	1.182
--- i386.md	2000/09/18 14:13:22
***************
*** 8539,8545 ****
  
  (define_insn "*fp_jcc_3"
    [(set (pc)
! 	(if_then_else (match_operator:CCFP 0 "comparison_operator"
  			[(match_operand 1 "register_operand" "f")
  			 (match_operand 2 "nonimmediate_operand" "fm")])
  	  (label_ref (match_operand 3 "" ""))
--- 8539,8545 ----
  
  (define_insn "*fp_jcc_3"
    [(set (pc)
! 	(if_then_else (match_operator 0 "comparison_operator"
  			[(match_operand 1 "register_operand" "f")
  			 (match_operand 2 "nonimmediate_operand" "fm")])
  	  (label_ref (match_operand 3 "" ""))
***************
*** 8555,8561 ****
  
  (define_insn "*fp_jcc_4"
    [(set (pc)
! 	(if_then_else (match_operator:CCFP 0 "comparison_operator"
  			[(match_operand 1 "register_operand" "f")
  			 (match_operand 2 "nonimmediate_operand" "fm")])
  	  (pc)
--- 8555,8561 ----
  
  (define_insn "*fp_jcc_4"
    [(set (pc)
! 	(if_then_else (match_operator 0 "comparison_operator"
  			[(match_operand 1 "register_operand" "f")
  			 (match_operand 2 "nonimmediate_operand" "fm")])
  	  (pc)
***************
*** 8566,8572 ****
    "TARGET_80387
     && (GET_MODE (operands[1]) == SFmode || GET_MODE (operands[1]) == DFmode)
     && GET_MODE (operands[1]) == GET_MODE (operands[2])
!    && !ix86_use_fcomi_compare (GET_CODE (operands[0]))"
    "#")
  
  (define_insn "*fp_jcc_5"
--- 8566,8574 ----
    "TARGET_80387
     && (GET_MODE (operands[1]) == SFmode || GET_MODE (operands[1]) == DFmode)
     && GET_MODE (operands[1]) == GET_MODE (operands[2])
!    && !ix86_use_fcomi_compare (GET_CODE (operands[0]))
!    && SELECT_CC_MODE (GET_CODE (operands[0]),
! 		      operands[1], operands[2]) == CCFPmode"
    "#")
  
  (define_insn "*fp_jcc_5"

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