Switch statement code generation

Joshua Cranmer <Pidgeot18@verizon.invalid>
Tue, 03 Nov 2009 08:01:56 -0500

          From comp.compilers

Related articles
Switch statement code generation Pidgeot18@verizon.invalid (Joshua Cranmer) (2009-11-03)
Re: Switch statement code generation gah@ugcs.caltech.edu (glen herrmannsfeldt) (2009-11-04)
Re: Switch statement code generation kkylheku@gmail.com (Kaz Kylheku) (2009-11-04)
Re: Switch statement code generation cr88192@hotmail.com (BGB / cr88192) (2009-11-04)
Re: Switch statement code generation ian@airs.com (Ian Lance Taylor) (2009-11-03)
Re: Switch statement code generation gah@ugcs.caltech.edu (glen herrmannsfeldt) (2009-11-04)
Re: Switch statement code generation anton@mips.complang.tuwien.ac.at (2009-11-04)
[13 later articles]
| List of all articles for this month |

From: Joshua Cranmer <Pidgeot18@verizon.invalid>
Newsgroups: comp.compilers
Date: Tue, 03 Nov 2009 08:01:56 -0500
Organization: Georgia Institute of Technology
Keywords: code, question
Posted-Date: 03 Nov 2009 23:50:56 EST

I'm trying to put together a list of various methods to do code generate
for switch statements.


This is what I have so far:
* Successive if/else branches
* Jump tables
* branch tables with linear and binary scans
* Clustering tables (e.g., if you have cases 0-100 and 300-400).


Are there any other methods worth mentioning?


--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
[I think I've seen hashing into branch tables. -John]



Post a followup to this message

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