From: | Horst von Brand <vonbrand@inf.utfsm.cl> |
Newsgroups: | comp.compilers,comp.lang.c.moderated |
Date: | 12 Dec 1997 14:50:24 -0500 |
Organization: | Universidad Tecnica Federico Santa Maria |
References: | <clcm-19971204-0012@plethora.net> 97-12-038 97-12-042 |
Keywords: | code, optimize, bibliography |
jakob@iar_.se (Jakob) writes:
> >I have a number of different tactics for implementing a switch (among
> >them a simple jump table and a series of conditional branches), and
> >would like the compiler to make a semi-intelligent decision as to
> >which to use for a particular switch.
[Sorry, I didn't see the original post]
In lcc they use conditional branches (laid out as a binary search tree) to
find which one of a set of compact jump tables to use. The code (and some
papers about the implementation) can be found at
<ftp://ftp.cs.princeton.edu/pub/packages/lcc/>, the book elaborates.
@Book{fraser_hanson95::_retar_c_compil,
author = {Christopher Fraser and
David Hanson},
title = {A Retargetable {C} Compiler:
Design and Implementation},
publisher = {Benjamin/Cummings Publishing Co},
year = 1995
}
--
Dr. Horst H. von Brand mailto:vonbrand@inf.utfsm.cl
Departamento de Informatica Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria +56 32 654239
Casilla 110-V, Valparaiso, Chile Fax: +56 32 797513
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.