[m-dev.] diff: improvement to lookup_switch

Thomas Charles CONWAY conway at cs.mu.oz.au
Wed May 7 07:47:06 AEST 1997


> Hi Tom,
> 
> Could you please review this one?
> 
> compiler/lookup_switch.m:
> 	Optimize the bit-vector test for small semidet lookup switches:
> 	in the situation where all the cases fit into a single word,
> 	we don't need to figure out at runtime which word to use.
> 
> 	Also, some minor improvements to the maintainability of the
> 	code: move the code for figuring out how many bits per word
> 	to use into a separate procedure, and use more informative
> 	variable names in that procedure.
> 


This diff looks fine.

Did you observe any speedup on the compiler due to the optimization?

-- 
Thomas Conway               				      conway at cs.mu.oz.au
AD DEUM ET VINUM	  			      Every sword has two edges.



More information about the developers mailing list