RE: how to write port of GCC?

Naveen Sharma <>
21 Mar 2002 21:57:31 -0500

          From comp.compilers

Related articles
how to write port of GCC? (M.Khaja Mohideen) (2002-03-19)
RE: how to write port of GCC? (Naveen Sharma) (2002-03-21)
| List of all articles for this month |

From: Naveen Sharma <>
Newsgroups: comp.compilers
Date: 21 Mar 2002 21:57:31 -0500
Organization: Compilers Central
References: 02-03-122
Keywords: GCC
Posted-Date: 21 Mar 2002 21:57:31 EST

> My Project Is To Make Some Optimizations To An Existing Port
> Of Gcc For
> Motorola Hc12 . I Have Found Out That I Have To Make Some
> Modifications In
> The Files M68hc11.C , M68hc11.H And M68hc11.Md .
> But The Problem Is The Definitions Given In Gcc Documentation
> About The
> Maschine Descriptions And RTL Definitions Are Not Clear.

Are you referrring the gcc manuals at
They are reasonably OK although you have to refer
actual code number of times to "REALLY"
understand things.

> 1 . I Dont Understand How The Definitions Given In The
> Maschine Description
> Documenation Matches With Those Used In The M68h11.Md Files.
> e.g. define_insn etc

I am not familier with M68 port.The best idea, in my opinion
would be to see how define_insns and other constructs(in .md) address target
issues for m68k.This might be difficult at the
start but should smoothen after a while.In fact I did something
similar for another processor.

Normally for optimization puposes define_splits,define_peepholes,
define_function_units constructs are more useful to study
for an architecture.

> 2. then i dont understand how the compiler when it compiles
> the C program
> uses the files mentioned above if i for instance mentioned
> the target as
> -m68hc12 .

The .md file is used while building the compiler.Basically
.md description is nothing but a method of specifying the
target.The tool genoutput would generate the entire backend.

There are two main points when information in .md is used.
One at RTL generation and other during matching process.
At RTL generation time, there are some generic routines
called which map to target specific insns.

The nameless patterns are normally used for matching purposes for
optimization passes.

You will get lot more ideas in gcc mailing list.

Best Regards,
  Naveen Sharma.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.