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]

Re: i386.md splits 1


> On Thu, Oct 01, 1998 at 01:47:29PM +0200, Jan Hubicka wrote:
> > 	(movdi): split the trivial (non-overlapping) case
> > 	(zero_extendsidi2): split it, support extending from other
> > 	register and to memory to avoid unnecesary moves of extended value
> > 	Use # in pattern and handle completely by splits.
> 
> IMO, movdi and zero_extendsidi3 should both be deleted.  Neither
> defines any machine-specific instructions; both can be handled
> better by the middle-end.

I sent why I am not doing this... I've tried it.
> 
> 
> > ! ;; When parameter is in register it is better to copy from it to avoid
> > ! ;; dependencies
> > ! (define_split 
> > !   [(set (match_operand:DI 0 "nonimmediate_operand" "or")
> > ! 	(sign_extend:DI (match_operand:SI 1 "register_operand" "")))]
> > !   "(reload_completed | reload_in_progress)
> > !    && (!REG_P (operands[0]) || REGNO (operands[0]) != 0
> > !    || (!optimize_size && ix86_cpu == PROCESSOR_PENTIUM))"
> > !   [(set (match_dup 4) (match_dup 1))
> > !    (set (match_dup 3) (match_dup 1))
> > !    (set (match_dup 4)
> > !         (ashiftrt:SI (match_dup 4) (const_int 31)))
> > !   ]
> > !   "split_di (&operands[0], 1, &operands[3], &operands[4]);")
> 
> No splits should refer to reload_in_progress.

OK, I will remove this.
> 
> 
> > ! ;; When parameter is in memory, copy it to destination and then again
> > ! (define_split 
> > !   [(set (match_operand:DI 0 "nonimmediate_operand" "r")
> > ! 	(sign_extend:DI (match_operand:SI 1 "general_operand" "mr")))]
> > !   "(reload_completed | reload_in_progress) 
> > !    && (!REG_P (operands[0]) || REGNO (operands[0]) != 0  
> > !    || (!optimize_size && ix86_cpu==PROCESSOR_PENTIUM))"
> > !   [(set (match_dup 3) (match_dup 1))
> > !    (set (match_dup 4) (match_dup 3))
> > !    (set (match_dup 4)
> > !         (ashiftrt:SI (match_dup 4) (const_int 31)))
> > !   ]
> > !   "split_di (&operands[0], 1, &operands[3], &operands[4]);")
> 
> Splits to not examine register constraints, only the predicates.
> Thus "nonimmediate_operand" "r" is wrong, as is the "or" constraint

It was last minute change. I will return it. In my original version there
was register_operand, when I was separating it, I've changed it to register
I will remove "or" and "r"/"mr" too.
> in the previous pattern.
> 
> It would be nice to combine these two patterns.  If you use another
> intermediate operand (match_dup 5), you can decide in the code where
> the initializer for (match_dup 4) should come from.
Thats really cool idea. I will come with modified patch soon!
> 
> 
> > + (define_insn "ashrsi3_31"
> > +   [(set (match_operand:SI 0 "nonimmediate_operand" "=rm,d")
> > + 	(ashiftrt:SI (match_operand:SI 1 "nonimmediate_operand" "0,a")
> > + 		     (const_int 31)))]
> > +   "ix86_cpu != PROCESSOR_PENTIUM || optimize_size"
> > +   "@
> > +     sar%L0 $31,%0
> > +     cltd")
> 
> Do you really want to limit this pattern to the pentium?
Yes. At pentium ctld takes two cycles, as mov/sar combination does.
But mov/sar combination is pairable, so it usually results in faster (and longer) code.

Thank you very much.

Honza
> 
> 
> r~

-- 
                       OK. Lets make a signature file.
+-------------------------------------------------------------------------+
|        Jan Hubicka (Jan Hubi\v{c}ka in TeX) hubicka@freesoft.cz         |
|         Czech free software foundation: http://www.freesoft.cz          |
|AA project - the new way for computer graphics - http://www.ta.jcu.cz/aa |
|  homepage: http://www.paru.cas.cz/~hubicka/, games koules, Xonix, fast  |
|  fractal zoomer XaoS, index of Czech GNU/Linux/UN*X documentation etc.  | 
+-------------------------------------------------------------------------+


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