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.4-BIB] Fix x87 combiner patterns


Hi,
I found that we are not accepting operations like (plus (float_extend a)
(float_extend b).

Honza

Sun Nov 10 21:28:49 CET 2002  Jan Hubicka  <jh@suse.cz>
	* i386.md (fop_df_6): New pattern.
	(fop_xf_4, fop_xf_5): Handle both SF and DFmode extensions.
	(fop_xf_6): Rewrite
	(fop_xf_7): Delete.
	(fop_tf_4, fop_tf_5): Handle both SF and DFmode extensions.
	(fop_tf_6): Rewrite
	(fop_tf_7): Delete.
*** ../../i386.md.old	Sun Nov 10 21:01:12 2002
--- i386.md	Sun Nov 10 21:07:24 2002
***************
*** 14685,14690 ****
--- 14685,14708 ----
                (const_string "fop")))
     (set_attr "mode" "SF")])
  
+ (define_insn "*fop_df_6"
+   [(set (match_operand:DF 0 "register_operand" "=f,f")
+ 	(match_operator:DF 3 "binary_fp_operator"
+ 	  [(float_extend:DF
+ 	    (match_operand:SF 1 "register_operand" "0,f"))
+ 	   (float_extend:DF
+ 	    (match_operand:SF 2 "nonimmediate_operand" "fm,0"))]))]
+   "TARGET_80387 && !(TARGET_SSE2 && TARGET_SSE_MATH)"
+   "* return output_387_binary_op (insn, operands);"
+   [(set (attr "type") 
+         (cond [(match_operand:DF 3 "mult_operator" "") 
+                  (const_string "fmul")
+                (match_operand:DF 3 "div_operator" "") 
+                  (const_string "fdiv")
+               ]
+               (const_string "fop")))
+    (set_attr "mode" "SF")])
+ 
  (define_insn "*fop_xf_1"
    [(set (match_operand:XF 0 "register_operand" "=f,f")
  	(match_operator:XF 3 "binary_fp_operator"
***************
*** 14794,14800 ****
  (define_insn "*fop_xf_4"
    [(set (match_operand:XF 0 "register_operand" "=f,f")
  	(match_operator:XF 3 "binary_fp_operator"
! 	   [(float_extend:XF (match_operand:SF 1 "nonimmediate_operand" "fm,0"))
  	    (match_operand:XF 2 "register_operand" "0,f")]))]
    "!TARGET_64BIT && TARGET_80387"
    "* return output_387_binary_op (insn, operands);"
--- 14812,14818 ----
  (define_insn "*fop_xf_4"
    [(set (match_operand:XF 0 "register_operand" "=f,f")
  	(match_operator:XF 3 "binary_fp_operator"
! 	   [(float_extend:XF (match_operand 1 "nonimmediate_operand" "fm,0"))
  	    (match_operand:XF 2 "register_operand" "0,f")]))]
    "!TARGET_64BIT && TARGET_80387"
    "* return output_387_binary_op (insn, operands);"
***************
*** 14810,14816 ****
  (define_insn "*fop_tf_4"
    [(set (match_operand:TF 0 "register_operand" "=f,f")
  	(match_operator:TF 3 "binary_fp_operator"
! 	   [(float_extend:TF (match_operand:SF 1 "nonimmediate_operand" "fm,0"))
  	    (match_operand:TF 2 "register_operand" "0,f")]))]
    "TARGET_80387"
    "* return output_387_binary_op (insn, operands);"
--- 14828,14834 ----
  (define_insn "*fop_tf_4"
    [(set (match_operand:TF 0 "register_operand" "=f,f")
  	(match_operator:TF 3 "binary_fp_operator"
! 	   [(float_extend:TF (match_operand 1 "nonimmediate_operand" "fm,0"))
  	    (match_operand:TF 2 "register_operand" "0,f")]))]
    "TARGET_80387"
    "* return output_387_binary_op (insn, operands);"
***************
*** 14828,14834 ****
  	(match_operator:XF 3 "binary_fp_operator"
  	  [(match_operand:XF 1 "register_operand" "0,f")
  	   (float_extend:XF
! 	    (match_operand:SF 2 "nonimmediate_operand" "fm,0"))]))]
    "!TARGET_64BIT && TARGET_80387"
    "* return output_387_binary_op (insn, operands);"
    [(set (attr "type") 
--- 14846,14852 ----
  	(match_operator:XF 3 "binary_fp_operator"
  	  [(match_operand:XF 1 "register_operand" "0,f")
  	   (float_extend:XF
! 	    (match_operand 2 "nonimmediate_operand" "fm,0"))]))]
    "!TARGET_64BIT && TARGET_80387"
    "* return output_387_binary_op (insn, operands);"
    [(set (attr "type") 
***************
*** 14845,14851 ****
  	(match_operator:TF 3 "binary_fp_operator"
  	  [(match_operand:TF 1 "register_operand" "0,f")
  	   (float_extend:TF
! 	    (match_operand:SF 2 "nonimmediate_operand" "fm,0"))]))]
    "TARGET_80387"
    "* return output_387_binary_op (insn, operands);"
    [(set (attr "type") 
--- 14863,14869 ----
  	(match_operator:TF 3 "binary_fp_operator"
  	  [(match_operand:TF 1 "register_operand" "0,f")
  	   (float_extend:TF
! 	    (match_operand 2 "nonimmediate_operand" "fm,0"))]))]
    "TARGET_80387"
    "* return output_387_binary_op (insn, operands);"
    [(set (attr "type") 
***************
*** 14860,14900 ****
  (define_insn "*fop_xf_6"
    [(set (match_operand:XF 0 "register_operand" "=f,f")
  	(match_operator:XF 3 "binary_fp_operator"
! 	   [(float_extend:XF (match_operand:DF 1 "nonimmediate_operand" "fm,0"))
! 	    (match_operand:XF 2 "register_operand" "0,f")]))]
!   "!TARGET_64BIT && TARGET_80387"
!   "* return output_387_binary_op (insn, operands);"
!   [(set (attr "type") 
!         (cond [(match_operand:XF 3 "mult_operator" "") 
!                  (const_string "fmul")
!                (match_operand:XF 3 "div_operator" "") 
!                  (const_string "fdiv")
!               ]
!               (const_string "fop")))
!    (set_attr "mode" "DF")])
! 
! (define_insn "*fop_tf_6"
!   [(set (match_operand:TF 0 "register_operand" "=f,f")
! 	(match_operator:TF 3 "binary_fp_operator"
! 	   [(float_extend:TF (match_operand:DF 1 "nonimmediate_operand" "fm,0"))
! 	    (match_operand:TF 2 "register_operand" "0,f")]))]
!   "TARGET_80387"
!   "* return output_387_binary_op (insn, operands);"
!   [(set (attr "type") 
!         (cond [(match_operand:TF 3 "mult_operator" "") 
!                  (const_string "fmul")
!                (match_operand:TF 3 "div_operator" "") 
!                  (const_string "fdiv")
!               ]
!               (const_string "fop")))
!    (set_attr "mode" "DF")])
! 
! (define_insn "*fop_xf_7"
!   [(set (match_operand:XF 0 "register_operand" "=f,f")
! 	(match_operator:XF 3 "binary_fp_operator"
! 	  [(match_operand:XF 1 "register_operand" "0,f")
  	   (float_extend:XF
! 	    (match_operand:DF 2 "nonimmediate_operand" "fm,0"))]))]
    "!TARGET_64BIT && TARGET_80387"
    "* return output_387_binary_op (insn, operands);"
    [(set (attr "type") 
--- 14878,14887 ----
  (define_insn "*fop_xf_6"
    [(set (match_operand:XF 0 "register_operand" "=f,f")
  	(match_operator:XF 3 "binary_fp_operator"
! 	  [(float_extend:XF
! 	    (match_operand 1 "register_operand" "0,f"))
  	   (float_extend:XF
! 	    (match_operand 2 "nonimmediate_operand" "fm,0"))]))]
    "!TARGET_64BIT && TARGET_80387"
    "* return output_387_binary_op (insn, operands);"
    [(set (attr "type") 
***************
*** 14904,14917 ****
                   (const_string "fdiv")
                ]
                (const_string "fop")))
!    (set_attr "mode" "DF")])
  
! (define_insn "*fop_tf_7"
    [(set (match_operand:TF 0 "register_operand" "=f,f")
  	(match_operator:TF 3 "binary_fp_operator"
! 	  [(match_operand:TF 1 "register_operand" "0,f")
  	   (float_extend:TF
! 	    (match_operand:DF 2 "nonimmediate_operand" "fm,0"))]))]
    "TARGET_80387"
    "* return output_387_binary_op (insn, operands);"
    [(set (attr "type") 
--- 14891,14905 ----
                   (const_string "fdiv")
                ]
                (const_string "fop")))
!    (set_attr "mode" "SF")])
  
! (define_insn "*fop_tf_6"
    [(set (match_operand:TF 0 "register_operand" "=f,f")
  	(match_operator:TF 3 "binary_fp_operator"
! 	  [(float_extend:TF
! 	    (match_operand 1 "register_operand" "0,f"))
  	   (float_extend:TF
! 	    (match_operand 2 "nonimmediate_operand" "fm,0"))]))]
    "TARGET_80387"
    "* return output_387_binary_op (insn, operands);"
    [(set (attr "type") 
***************
*** 14921,14927 ****
                   (const_string "fdiv")
                ]
                (const_string "fop")))
!    (set_attr "mode" "DF")])
  
  (define_split
    [(set (match_operand 0 "register_operand" "")
--- 14909,14915 ----
                   (const_string "fdiv")
                ]
                (const_string "fop")))
!    (set_attr "mode" "SF")])
  
  (define_split
    [(set (match_operand 0 "register_operand" "")


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