This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: How to implement branches?


"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>


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