This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to implement branches?
- From: Geoff Keating <geoffk at geoffk dot org>
- To: "Fred Cook" <fcook377 at hotmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 14 May 2003 14:23:14 -0700
- Subject: Re: How to implement branches?
- References: <Sea1-F4616IH9mQJklx00011d24@hotmail.com>
"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>