public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Possible change to gen* for splits
@ 2000-03-16  8:33 Richard Kenner
  2000-03-16  9:06 ` Richard Earnshaw
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Richard Kenner @ 2000-03-16  8:33 UTC (permalink / raw)
  To: cpopetz; +Cc: gcc

    Actually, since I can do lookahead, how about:

	"condition"

	"&& reload_completed"

    That seems to better reflect the actual relationship of the two conditions.

I guess that works since it would be meaningless were there not a
previous condition, but it seems sort of "odd" to me, though I can't say
exactly why.  My concern is in picking a syntax where it's obvious the
is some relation between the two conditions to somebody who might not
have carefully poured through all the documentation.

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: Possible change to gen* for splits
@ 2000-03-16 10:35 Richard Kenner
  0 siblings, 0 replies; 12+ messages in thread
From: Richard Kenner @ 2000-03-16 10:35 UTC (permalink / raw)
  To: meissner; +Cc: gcc

    I think having the && implicit would be better:

	"condition"

	"reload_completed"

The reason I don't like that is that it isn't obvious to the casual reader
that the second condition is really the "&&" of the two of them.

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: Possible change to gen* for splits
@ 2000-03-16 10:30 Richard Kenner
  0 siblings, 0 replies; 12+ messages in thread
From: Richard Kenner @ 2000-03-16 10:30 UTC (permalink / raw)
  To: rearnsha; +Cc: gcc

    Maybe it would be better if the "glue" were to appear outside of the 
    double quotes.  Eg (though I haven't thought the implications of this 
    particular syntax through):

	+"&& reload_completed"

No, that can't work due to the way RTL expressions are parsed.

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re:  Possible change to gen* for splits
@ 2000-03-16  5:22 Richard Kenner
       [not found] ` <p04310106b4f6968ba458@[192.168.1.254]>
  0 siblings, 1 reply; 12+ messages in thread
From: Richard Kenner @ 2000-03-16  5:22 UTC (permalink / raw)
  To: cpopetz; +Cc: gcc

    (define_insn_and_split "name"
      ...normal insn...
      [split pattern]
      "split condition"
      "split preparation statements"
    ) 

I like this idea.

    I'd also like it to grok "* condition" for the split condition, which
    means "append condition to whatever condition was in the insn" so that
    the common case of:

I like this idea too, but don't like using '*' since it has other meanings
in the MD file already. How about '|' or '^'?

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Possible change to gen* for splits
@ 2000-03-10  7:24 Clinton Popetz
  2000-03-15 13:35 ` Jeffrey A Law
  0 siblings, 1 reply; 12+ messages in thread
From: Clinton Popetz @ 2000-03-10  7:24 UTC (permalink / raw)
  To: gcc

I'm wondering if it's possible to eliminate some of the redundancy in the md
files w.r.t. splits.  It seems we often have an define_insn that forces a
split, followed by a define_split with the same rtl template.  For instance,
from sparc.md:

(define_insn "*neg_snesi_zero"
  [(set (match_operand:SI 0 "register_operand" "=r")
	(neg:SI (ne:SI (match_operand:SI 1 "register_operand" "r")
		       (const_int 0))))
   (clobber (reg:CC 100))]
  "! TARGET_LIVE_G0"
  "#"
  [(set_attr "length" "2")])

(define_split
  [(set (match_operand:SI 0 "register_operand" "")
	(neg:SI (ne:SI (match_operand:SI 1 "register_operand" "")
		       (const_int 0))))
   (clobber (reg:CC 100))]
  ""
  [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
					   (const_int 0)))
   (set (match_dup 0) (neg:SI (ltu:SI (reg:CC 100) (const_int 0))))]
  "")



This is pretty common, and it's somewhat of a maintenance problem (e.g. if I
add a clobber to the insn, I have to add a clobber to the split.  I'm running
into this trying to add clobbers for the xer register to every insn and split
in rs6000.md that set the carry bit.  Yuck.)  Since the two rtl templates have
to match for the split to work, it seems overkill to type them twice.  By
having gen* grok this:

(define_insn_and_split "name"
  ...normal insn...
  [split pattern]
  "split condition"
  "split preparation statements"
) 

the above two patterns would be:

(define_insn_and_split "*neg_snesi_zero"
  [(set (match_operand:SI 0 "register_operand" "=r")
	(neg:SI (ne:SI (match_operand:SI 1 "register_operand" "r")
		       (const_int 0))))
   (clobber (reg:CC 100))]
    "! TARGET_LIVE_G0"
  "#"
  [(set_attr "length" "2")]
  [(set (reg:CC_NOOV 100) (compare:CC_NOOV (neg:SI (match_dup 1))
					   (const_int 0)))
   (set (match_dup 0) (neg:SI (ltu:SI (reg:CC 100) (const_int 0))))]
  ""
  ""
)

Does this seem reasonable/useful?  I'd also like it to grok "* condition" for
the split condition, which means "append condition to whatever condition was in
the insn" so that the common case of:

(define_insn 
 [pattern]
 "complex_condition"
 ...
)

(define_split 
 [pattern]
 [split]
 "complex_condition && reload_completed"
 ...
)

could be 

(define_insn_and_split
 [pattern]
 "condition"
 ...
 [split]
 "* && reload_completed"
) 

The above change would be worth several hundred lines in rs6000.md, so I'd
be willing to do the work to gen*, as it would save me time in the long run.

				-Clint

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2000-03-16 10:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-16  8:33 Possible change to gen* for splits Richard Kenner
2000-03-16  9:06 ` Richard Earnshaw
2000-03-16 10:11   ` Richard Henderson
2000-03-16 10:42     ` Richard Earnshaw
2000-03-16  9:28 ` Michael Meissner
2000-03-16 10:13 ` Richard Henderson
  -- strict thread matches above, loose matches on Subject: below --
2000-03-16 10:35 Richard Kenner
2000-03-16 10:30 Richard Kenner
2000-03-16  5:22 Richard Kenner
     [not found] ` <p04310106b4f6968ba458@[192.168.1.254]>
2000-03-16  6:09   ` Clinton Popetz
2000-03-10  7:24 Clinton Popetz
2000-03-15 13:35 ` Jeffrey A Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).