public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: How to implement branches?
@ 2003-05-14 16:17 Bonzini
  0 siblings, 0 replies; 6+ messages in thread
From: Bonzini @ 2003-05-14 16:17 UTC (permalink / raw)
  To: gcc; +Cc: fcook377, schwab

> > My target architecture implements conditional branches like this:
> > 
> >         equal r10, r11, r12             /* r12 = (r10 == r11) */
> >         branch_if_true r12, label
>
> I think the PowerPC architecture is similar.
> 
> Andreas.

Doesn't the Alpha and MIPS architectures do this as well?

Paolo

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

* Re: How to implement branches?
  2003-05-14 13:13 Fred Cook
  2003-05-14 13:59 ` Andreas Schwab
  2003-05-14 16:23 ` Falk Hueffner
@ 2003-05-14 21:23 ` Geoff Keating
  2 siblings, 0 replies; 6+ messages in thread
From: Geoff Keating @ 2003-05-14 21:23 UTC (permalink / raw)
  To: Fred Cook; +Cc: gcc

"Fred Cook" <fcook377@hotmail.com> writes:

> Hi,
> 
> My target architecture implements conditional branches like this:
> 
>         equal r10, r11, r12             /* r12 = (r10 == r11) */
>         branch_if_true r12, label
> 
> Now I am looking for hits to implement this my gcc port. Also
> references to ports where branches are clearly implemented and
> branches are similar to the branches of my architecture are
> welcome.

MIPS is similar to this.

You'd represent this in RTL as

(set (reg:SI r12) (eq:SI (reg:SI r10) (reg:SI r11)))
(set (pc) (if_then_else (eq (reg:SI 12) (const_int 1)) (label) (pc)))

-- 
- Geoffrey Keating <geoffk@geoffk.org>

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

* Re: How to implement branches?
  2003-05-14 13:13 Fred Cook
  2003-05-14 13:59 ` Andreas Schwab
@ 2003-05-14 16:23 ` Falk Hueffner
  2003-05-14 21:23 ` Geoff Keating
  2 siblings, 0 replies; 6+ messages in thread
From: Falk Hueffner @ 2003-05-14 16:23 UTC (permalink / raw)
  To: Fred Cook; +Cc: gcc

"Fred Cook" <fcook377@hotmail.com> writes:

> My target architecture implements conditional branches like this:
> 
>         equal r10, r11, r12             /* r12 = (r10 == r11) */
>         branch_if_true r12, label
> 
> Now I am looking for hits to implement this my gcc port. Also
> references to ports where branches are clearly implemented and
> branches are similar to the branches of my architecture are welcome.

This is pretty much how things work on Alpha.

-- 
	Falk

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

* Re: How to implement branches?
  2003-05-14 13:59 ` Andreas Schwab
@ 2003-05-14 14:10   ` Andrew Pinski
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Pinski @ 2003-05-14 14:10 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Andrew Pinski, Fred Cook, gcc

It is close but rs6000 (PowerPC) has a compare instruction, not an 
`equal to' instruction.
I think the way to have (set (reg 12) (eq (reg 10) (reg 11)) be `equal 
r10, r11, r12' and then have
(set (pc) (if_then_else (eq (reg 12) (const_int 1)) (label_reg (label)) 
(pc))) be `branch_if_true r12, label'
and  (set (pc) (if_then_else (eq (reg 12) (const_int 0)) (label_reg 
(label)) (pc))) be `branch_if_false r12, label'


Thanks,
Andrew Pinski

On Wednesday, May 14, 2003, at 09:59 US/Eastern, Andreas Schwab wrote:

> "Fred Cook" <fcook377@hotmail.com> writes:
>
> |> Hi,
> |>
> |> My target architecture implements conditional branches like this:
> |>
> |>         equal r10, r11, r12             /* r12 = (r10 == r11) */
> |>         branch_if_true r12, label
> |>
> |> Now I am looking for hits to implement this my gcc port. Also
> |> references to ports where branches are clearly implemented and
> |> branches are similar to the branches of my architecture are
> |> welcome.
>
> I think the PowerPC architecture is similar.
>
> Andreas.
>
> -- 
> Andreas Schwab, SuSE Labs, schwab@suse.de
> SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
> Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."
>
>

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

* Re: How to implement branches?
  2003-05-14 13:13 Fred Cook
@ 2003-05-14 13:59 ` Andreas Schwab
  2003-05-14 14:10   ` Andrew Pinski
  2003-05-14 16:23 ` Falk Hueffner
  2003-05-14 21:23 ` Geoff Keating
  2 siblings, 1 reply; 6+ messages in thread
From: Andreas Schwab @ 2003-05-14 13:59 UTC (permalink / raw)
  To: Fred Cook; +Cc: gcc

"Fred Cook" <fcook377@hotmail.com> writes:

|> Hi,
|> 
|> My target architecture implements conditional branches like this:
|> 
|>         equal r10, r11, r12             /* r12 = (r10 == r11) */
|>         branch_if_true r12, label
|> 
|> Now I am looking for hits to implement this my gcc port. Also
|> references to ports where branches are clearly implemented and
|> branches are similar to the branches of my architecture are
|> welcome.

I think the PowerPC architecture is similar.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* How to implement branches?
@ 2003-05-14 13:13 Fred Cook
  2003-05-14 13:59 ` Andreas Schwab
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Fred Cook @ 2003-05-14 13:13 UTC (permalink / raw)
  To: gcc

Hi,

My target architecture implements conditional branches like this:

        equal r10, r11, r12             /* r12 = (r10 == r11) */
        branch_if_true r12, label

Now I am looking for hits to implement this my gcc port. Also
references to ports where branches are clearly implemented and
branches are similar to the branches of my architecture are
welcome.

Thanks,

Fred.

_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.  
http://join.msn.com/?page=features/virus

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

end of thread, other threads:[~2003-05-14 21:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-14 16:17 How to implement branches? Bonzini
  -- strict thread matches above, loose matches on Subject: below --
2003-05-14 13:13 Fred Cook
2003-05-14 13:59 ` Andreas Schwab
2003-05-14 14:10   ` Andrew Pinski
2003-05-14 16:23 ` Falk Hueffner
2003-05-14 21:23 ` Geoff Keating

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).