[ale] Bleeding edge linux?
Michael Kachline
kachline at bass.compgen.com
Fri Mar 29 12:22:15 EST 2002
> would not be able to take this task on alone. and
> seeing how it would only be a compiler, all programs
> made for linux should work. good idea or bad idea?
Stephen,
If you are interested in a compiler which converts C code to
optimized assembly, take a look at using "gcc -S". Since you seem to be
interested in code optimizations, you may also want to write a small
(simple) C program and then look at the various outputs of "gcc -S" using
the various gcc compiler optimizations (-O0, -O2, -O4, -mcpu=pentiumpro,
etc.). "gcc -S foo.c" will generate an optimized, assembly language file;
the reading of which is often humbling and sometimes even educational.
The deeper you dig into this kind of stuff, the more you'll find
that gcc does some pretty magical stuff; especially in attempting to avoid
pipeline bubbles, re-ordering instructions, optimizing register usage, and
so forth. Even though the front end language being compiled is C, what
happens "under the hood" is very different, involving complex graph
theories and usually a pseudo assembly language. x86 assembly language is
merely the text form of what gcc eventually outputs.
Since you are interested in optimizing code, take a gander over at
Intel's web site. They usually have PDFs on-line which describe their
various hardware architectures and compiler techniques which can be used
to harness some of the chipset optimizations. Read and attempt to
understand. If you can get your hands on a "Programmers Reference Guide"
for the CPU of your interest, read the first chapter or so where the
overall architecture is described.
- Mike
--------------------------------------------------------------------
Michael Kachline
Systems Programmer
Phone - Desk: 404-705-2848
Phone - Mobile: 678-231-9367
Phone - Home: 706-367-0874
Fax: 404-705-2805
Web: http://www.intec-telecom-systems.com
Email: Michael.Kachline at intec-telecom-systems.com
Intec Telecom Systems
Building G, 4th Floor
5775 Peachtree-Dunwoody Road
Atlanta, GA 30342
--------------------------------------------------------------------
---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be
sent to listmaster at ale dot org.
More information about the Ale
mailing list