multiplies by powers of two

Stephen Weeks MLton@sourcelight.com
Wed, 11 Jul 2001 15:52:59 -0700


> More  importantly,  and  this is probably only doable if overflow checking is
> off, the conversion of multiplies to fancy lea instructions is a big big  win
> on Intel chips.

This reminds me -- I saw in some assembly code that x * 4 was really implemented
with imul instead of a shift (or lea).  I can do the transformation to a shift
as a CPS optimization if that would help.  Let me know if you think that's worth
adding.