reload problem in current CVS

Jan Hubicka hubicka@atrey.karlin.mff.cuni.cz
Tue Nov 30 06:33:00 GMT 1999


> 
> Jan, is there any particular reason that the patterns which use FLOAT_INT_REGS
> (like the one above) couldn't be written like this, i.e. splitting the
> alternatives:
> 
> (define_insn "*negsf2_if"
>   [(set (match_operand:SF 0 "nonimmediate_operand" "=f,rm")
>         (neg:SF (match_operand:SF 1 "nonimmediate_operand" "0,0")))
>    (clobber (reg:CC 17))]
> 
> That should avoid this particular problem.
I've done this. Only I've added the #f and #r to keep costs working right.
The testcase seems to work nicelly now.

OK to install?

Tue Nov 30 15:20:52 MET 1999  Jan Hubicka  <hubicka@freesoft.cz>
	* i386.md (neg?f2_if): Split "r" and "f" to separate alternatives.
	(abs?f2_if): Likewise.
Index: egcs/gcc/config/i386/i386.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386.md,v
retrieving revision 1.110
diff -c -3 -p -r1.110 i386.md
*** i386.md	1999/11/25 12:53:44	1.110
--- i386.md	1999/11/30 14:26:53
***************
*** 4968,4976 ****
    "TARGET_80387"
    "ix86_expand_unary_operator (NEG, SFmode, operands); DONE;")
  
  (define_insn "*negsf2_if"
!   [(set (match_operand:SF 0 "nonimmediate_operand" "=frm")
! 	(neg:SF (match_operand:SF 1 "nonimmediate_operand" "0")))
     (clobber (reg:CC 17))]
    "TARGET_80387 && ix86_unary_operator_ok (NEG, SFmode, operands)"
    "#")
--- 4838,4849 ----
    "TARGET_80387"
    "ix86_expand_unary_operator (NEG, SFmode, operands); DONE;")
  
+ ;; Keep 'f' and 'r' in separate alternatives to avoid reload problems
+ ;; because of secondary memory needed to reload from class FLOAT_INT_REGS
+ ;; to itself.
  (define_insn "*negsf2_if"
!   [(set (match_operand:SF 0 "nonimmediate_operand" "=f#r,rm#f")
! 	(neg:SF (match_operand:SF 1 "nonimmediate_operand" "0,0")))
     (clobber (reg:CC 17))]
    "TARGET_80387 && ix86_unary_operator_ok (NEG, SFmode, operands)"
    "#")
***************
*** 5020,5028 ****
    "TARGET_80387"
    "ix86_expand_unary_operator (NEG, DFmode, operands); DONE;")
  
  (define_insn "*negdf2_if"
!   [(set (match_operand:DF 0 "nonimmediate_operand" "=frm")
! 	(neg:DF (match_operand:DF 1 "nonimmediate_operand" "0")))
     (clobber (reg:CC 17))]
    "TARGET_80387 && ix86_unary_operator_ok (NEG, DFmode, operands)"
    "#")
--- 4893,4904 ----
    "TARGET_80387"
    "ix86_expand_unary_operator (NEG, DFmode, operands); DONE;")
  
+ ;; Keep 'f' and 'r' in separate alternatives to avoid reload problems
+ ;; because of secondary memory needed to reload from class FLOAT_INT_REGS
+ ;; to itself.
  (define_insn "*negdf2_if"
!   [(set (match_operand:DF 0 "nonimmediate_operand" "=f#r,rm#f")
! 	(neg:DF (match_operand:DF 1 "nonimmediate_operand" "0,0")))
     (clobber (reg:CC 17))]
    "TARGET_80387 && ix86_unary_operator_ok (NEG, DFmode, operands)"
    "#")
***************
*** 5053,5061 ****
    "TARGET_80387"
    "ix86_expand_unary_operator (NEG, XFmode, operands); DONE;")
  
  (define_insn "*negxf2_if"
!   [(set (match_operand:XF 0 "nonimmediate_operand" "=frm")
! 	(neg:XF (match_operand:XF 1 "nonimmediate_operand" "0")))
     (clobber (reg:CC 17))]
    "TARGET_80387 && ix86_unary_operator_ok (NEG, XFmode, operands)"
    "#")
--- 4929,4940 ----
    "TARGET_80387"
    "ix86_expand_unary_operator (NEG, XFmode, operands); DONE;")
  
+ ;; Keep 'f' and 'r' in separate alternatives to avoid reload problems
+ ;; because of secondary memory needed to reload from class FLOAT_INT_REGS
+ ;; to itself.
  (define_insn "*negxf2_if"
!   [(set (match_operand:XF 0 "nonimmediate_operand" "=f#r,rm#f")
! 	(neg:XF (match_operand:XF 1 "nonimmediate_operand" "0,0")))
     (clobber (reg:CC 17))]
    "TARGET_80387 && ix86_unary_operator_ok (NEG, XFmode, operands)"
    "#")
***************
*** 5142,5150 ****
    "TARGET_80387"
    "ix86_expand_unary_operator (ABS, SFmode, operands); DONE;")
  
  (define_insn "*abssf2_if"
!   [(set (match_operand:SF 0 "nonimmediate_operand" "=frm")
! 	(abs:SF (match_operand:SF 1 "nonimmediate_operand" "0")))
     (clobber (reg:CC 17))]
    "TARGET_80387 && ix86_unary_operator_ok (ABS, SFmode, operands)"
    "#")
--- 5021,5032 ----
    "TARGET_80387"
    "ix86_expand_unary_operator (ABS, SFmode, operands); DONE;")
  
+ ;; Keep 'f' and 'r' in separate alternatives to avoid reload problems
+ ;; because of secondary memory needed to reload from class FLOAT_INT_REGS
+ ;; to itself.
  (define_insn "*abssf2_if"
!   [(set (match_operand:SF 0 "nonimmediate_operand" "=f#r,rm#f")
! 	(abs:SF (match_operand:SF 1 "nonimmediate_operand" "0,0")))
     (clobber (reg:CC 17))]
    "TARGET_80387 && ix86_unary_operator_ok (ABS, SFmode, operands)"
    "#")
***************
*** 5194,5202 ****
    "TARGET_80387"
    "ix86_expand_unary_operator (ABS, DFmode, operands); DONE;")
  
  (define_insn "*absdf2_if"
!   [(set (match_operand:DF 0 "nonimmediate_operand" "=frm")
! 	(abs:DF (match_operand:DF 1 "nonimmediate_operand" "0")))
     (clobber (reg:CC 17))]
    "TARGET_80387 && ix86_unary_operator_ok (ABS, DFmode, operands)"
    "#")
--- 5076,5087 ----
    "TARGET_80387"
    "ix86_expand_unary_operator (ABS, DFmode, operands); DONE;")
  
+ ;; Keep 'f' and 'r' in separate alternatives to avoid reload problems
+ ;; because of secondary memory needed to reload from class FLOAT_INT_REGS
+ ;; to itself.
  (define_insn "*absdf2_if"
!   [(set (match_operand:DF 0 "nonimmediate_operand" "=f#r,rm#f")
! 	(abs:DF (match_operand:DF 1 "nonimmediate_operand" "0,0")))
     (clobber (reg:CC 17))]
    "TARGET_80387 && ix86_unary_operator_ok (ABS, DFmode, operands)"
    "#")
***************
*** 5227,5235 ****
    "TARGET_80387"
    "ix86_expand_unary_operator (ABS, XFmode, operands); DONE;")
  
  (define_insn "*absxf2_if"
!   [(set (match_operand:XF 0 "nonimmediate_operand" "=frm")
! 	(abs:XF (match_operand:XF 1 "nonimmediate_operand" "0")))
     (clobber (reg:CC 17))]
    "TARGET_80387 && ix86_unary_operator_ok (ABS, XFmode, operands)"
    "#")
--- 5112,5123 ----
    "TARGET_80387"
    "ix86_expand_unary_operator (ABS, XFmode, operands); DONE;")
  
+ ;; Keep 'f' and 'r' in separate alternatives to avoid reload problems
+ ;; because of secondary memory needed to reload from class FLOAT_INT_REGS
+ ;; to itself.
  (define_insn "*absxf2_if"
!   [(set (match_operand:XF 0 "nonimmediate_operand" "=f#r,rm#f")
! 	(abs:XF (match_operand:XF 1 "nonimmediate_operand" "0,0")))
     (clobber (reg:CC 17))]
    "TARGET_80387 && ix86_unary_operator_ok (ABS, XFmode, operands)"
    "#")


More information about the Gcc-patches mailing list