1. shifts & rotations
- Posted by jiri babor <jbabor at paradise.net.nz> Dec 31, 2003
- 446 views
Robert, I believe multiplies as well as floored divides by 2 are optimized. Since we do not have fast, native shifts in Euphoria, are multiplies and divides by integral powers of 2 similarly optimized? If not, why not? Thanks. jiri
2. Re: shifts & rotations
- Posted by "Lucius L. Hilley III" <L3Euphoria at bellsouth.net> Dec 31, 2003
- 411 views
I seem to recall that they are. I believe that RC said so himself self when he introduced those optimizations a long time ago. Lucius L. Hilley III - Unkmar ----- Original Message ----- From: "jiri babor" <jbabor at paradise.net.nz> To: <EUforum at topica.com> Subject: shifts & rotations > > > Robert, > > I believe multiplies as well as floored divides by 2 are optimized. Since we > do not have fast, native shifts in Euphoria, are multiplies and divides by > integral powers of 2 similarly optimized? > If not, why not? > > Thanks. jiri > > > > TOPICA - Start your own email discussion group. FREE! > >
3. Re: shifts & rotations
- Posted by Robert Craig <rds at RapidEuphoria.com> Dec 31, 2003
- 424 views
jiri babor wrote: > I believe multiplies as well as floored divides by 2 are optimized. Yes. > Since we > do not have fast, native shifts in Euphoria, are multiplies and divides by > integral powers of 2 similarly optimized? Only 2. Not 4, 8, 16, ... > If not, why not? - there's already complicated code to determine if an integer*integer multiply might exceed 31 bits (and have to be converted to floating-point). I'm reluctant to add more special cases. - C shifts are not completely portable across all machines - In the Pentium 4, shifts use more cycles (4) than they used to (1), so you don't gain a lot by replacing multiplies or divides with shifts. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com