Re: Help needed: Code generation for CASE/SWITCH statements

Horst von Brand <vonbrand@inf.utfsm.cl>
12 Dec 1997 14:50:24 -0500

          From comp.compilers

Related articles
[7 earlier articles]
Re: Help needed: Code generation for CASE/SWITCH statements conway@mundook.cs.mu.OZ.AU (1997-12-05)
Re: Help needed: Code generation for CASE/SWITCH statements gclind01@spd.louisville.edu (1997-12-07)
Re: Help needed: Code generation for CASE/SWITCH statements wi534@victoria.tc.ca (William A. Barath) (1997-12-07)
Re: Help needed: Code generation for CASE/SWITCH statements sethml@ugcs.caltech.edu (1997-12-07)
Re: Help needed: Code generation for CASE/SWITCH statements henry@zoo.toronto.edu (Henry Spencer) (1997-12-10)
Re: Help needed: Code generation for CASE/SWITCH statements a_s_t_o_r@guardian.no (Alexander Kjeldaas) (1997-12-10)
Re: Help needed: Code generation for CASE/SWITCH statements vonbrand@inf.utfsm.cl (Horst von Brand) (1997-12-12)
Re: Help needed: Code generation for CASE/SWITCH statements wi534@victoria.tc.canada (William A. Barath) (1997-12-12)
Re: Help needed: Code generation for CASE/SWITCH statements henry@zoo.toronto.edu (Henry Spencer) (1997-12-15)
Re: Help needed: Code generation for CASE/SWITCH statements dietz@interaccess.com (Paul Dietz) (1997-12-16)
Re: Help needed: Code generation for CASE/SWITCH statements kanze@gabi-soft.fr (1997-12-16)
Re: Help needed: Code generation for CASE/SWITCH statements hayes@epigram.com (Raymond Hayes) (1997-12-17)
Re: Help needed: Code generation for CASE/SWITCH statements wi534@victoria.tc.canada (William A. Barath) (1997-12-23)
| List of all articles for this month |

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
--


Post a followup to this message

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