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.


> ! ;; 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.


> ! ;; 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
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.


> + (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?


r~


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