Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

x86 code generation

11 views
Skip to first unread message

Nick Shaffner

unread,
Jun 14, 2000, 3:00:00 AM6/14/00
to
Anyone know where I can get some good information on code
generation stratagies for x86 (thinking Pentium+) specific processors?

It seems that nearly all the compiler texts and papers I've read
seem only to dedicate a few pages to dealing with the x86's major
idosyncracies, and they usually just show you a couple of ways to hack
'x86' support into a general purpose back end.

I am interested x86 specific code generation, including
intermediete representations that are friendly to the architecture,
strategies for managing the floating point stack, dealing with the
lack of registers - but making use of register renaming, etc.

Could anyone offer any guidance as to where I could find such
information?

Much thanks,
Nick
[I've seen thick manuals from Intel full of advice on x86 code
generation. You can probably find PDFs on their developer web
site. -John]


Michael L. Ross

unread,
Jun 20, 2000, 3:00:00 AM6/20/00
to
John is correct - Intel publishes optimization guides for each of its
processors, that show the best code to generate for each
processor. That won't help you with compiler techniques such as
intermediate representation and register management, of
course. However, the optimization guides provide a starting point for
what you're aiming at. You can also get Intel's compilers, which will
give you a pretty good notion of the best code you can generate for
the processors.

Beyond that, you want some way of representing the IA32's addressing
modes in your intermediate representation, and some notion of modeling
which registers are killed implicitly by various instructions.

A good starting point on the register allocation issue is "Global
Register Allocation Based on Graph Fusion", by Thomas Gross et. al.
at Carnegie-Mellon.

The best intermediate representation is always a matter of opinion.
Since many IA32 instructions are two address form, if you only care
about IA32(Intel Architecture, 32 bit), you might try modeling it that
way, to make the translation in to machine code more natural.

Just some thoughts...
Mike

--
| Michael L. Ross
| michael...@intel.com
| EY2-03 5350 N.E. Elam Young Pkwy.
| Hillsboro, Or. 97124 Phone: (503)696-3794
| Disclaimer: Not speaking for Motorola

Juergen Kahrs

unread,
Jun 20, 2000, 3:00:00 AM6/20/00
to
Nick Shaffner wrote:

> I am interested x86 specific code generation, including
> intermediete representations that are friendly to the architecture,
> strategies for managing the floating point stack, dealing with the
> lack of registers - but making use of register renaming, etc.

The code generator of the LCC compiler may be just another general
purpose code generator and therefore not so interesting for you. But
the book has separate chapters for each code generator and the x86 is
one of them:

http://www.cs.princeton.edu/software/lcc/

> [I've seen thick manuals from Intel full of advice on x86 code
> generation. You can probably find PDFs on their developer web
> site. -John]

Yes, you are right, John. These links are just starting point:

http://developer.intel.com/drg/mmx/manuals/
http://www.amd.com/products/cpg/athlon/techdocs/index.html

Currently, it looks like 3DNow! is an interesting instruction set
extension. 3DNow allows for executing 4 single precision floats with
one instruction. It is supported by AMD and Cyrix/VIA.

BTW: The architectures of the new Intel processors (IA64 and
Willamette) are so extremely dependent on well designed/adapted code
generators that (good) compiler writers should face a "bright
future". Furthermore, the Alpha architecture and some IBM POWER
processors go into hardware supported multithreading, which also needs
support by compiler designers.
+---------------------------------------------------------------------+
| Juergen Kahrs, STN Atlas Elektronik GmbH, D-28305 Bremen |
| Simulation Division Sebaldsbruecker Heerstr. 235 +49/421/457-2819 |
+----------- http://home.t-online.de/home/Juergen.Kahrs/ -------------+

Mohd-Hanafiah Abdullah

unread,
Jun 20, 2000, 3:00:00 AM6/20/00
to
Nick Shaffner <ni...@3drealms.com> wrote:
> Anyone know where I can get some good information on code
>generation stratagies for x86 (thinking Pentium+) specific processors?

You would be able to learn a lot about x86 code generation by
analyzing the GNU gcc compiler for the x86. I re-targeted a C
compiler that I wrote to the x86 (80386 to be more specific), and the
gcc compiler was handy. Now you would ask why would I wrote another
compiler for the x86 when gcc was available. Well, just for fun since
I had a compiler that I wrote from scratch over the years and to see
it work on an x86 running Linux was great.

Napi

0 new messages