This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] New intermediate languages
- To: Diego Novillo <dnovillo at redhat dot com>
- Subject: Re: [RFC] New intermediate languages
- From: Michael Meissner <meissner at cygnus dot com>
- Date: Thu, 1 Feb 2001 10:52:44 -0500
- Cc: gcc at gcc dot gnu dot org
- References: <20010201015501.A18928@tornado.cygnus.com>
On Thu, Feb 01, 2001 at 01:55:01AM -0500, Diego Novillo wrote:
> These are some of the general properties of MRTL.
>
> - Reduced target dependencies. The RTL patterns generated at this
> stage are fixed and have well-known semantics. Some
> architectural features will likely creep in, like word size,
> number of physical registers and whatnot.
>
> - No information loss in the tree->MRTL transition. After the
> MRTL form is transformed it will not be possible to go back
> to the tree information.
Obviously we do have to keep the part of the tree interface that the debug
support uses in MRTL and RTL.
> - Control flow representation is similar to RTL. No structured
> control-flow, everything is represented with jumps and
> compare/branch.
>
> - Arrays are lowered to pointer arithmetic and structures
> flattened. No libcalls are generated for floating point and/or
> integer arithmetic.
>
> These patterns would be generated directly from stmt.c/expr.c.
> The plan is to write two passes tree->MRTL and MRTL->RTL which
> should not change existing behaviour. Once this is done, I would
> start building a CFG and an SSA form for MRTL (this can be mostly
> ripped off the current implementation). At that point we can
> start porting scalar transformations to the new form.
>
>
> Data types
> ----------
>
> Use the same modes defined in RTL.
>
>
> Control Statements
> ------------------
>
> (insn)
> (mcall (addr) (arg1) (arg2) ... (argN))
> This is a new pattern for function calls. Alternatively we
> could define an abstract stack machine and expand calls using
> the existing code. I'd rather see a more compact
> representation, though.
This probably should be:
(mcall (addr) [(arg1) (arg2) (arg3) ...])
in order to handle the variable number of arguments.
> (jump_insn (set (pc) (expr)))
> Standard jump. expr can be either a label_ref or an
> if_then_else for unconditional and conditional jumps.
>
> (return)
> (return X)
> Standard return with and without a value.
The second needs a new RTL, since other than vectors all RTL have a fixed
number of arguments.
> (code_label)
> (barrier)
> (note NOTE_*)
>
>
> Expressions
> -----------
>
> Constants:
> (const_int i)
> (const_double:m addr i0 i1)
> (const_string str)
We really should come up with a replacement for const_double that can be used
for all constants.
--
Michael Meissner, Red Hat, Inc. (GCC group)
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work: meissner@redhat.com phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org fax: +1 978-692-4482