Path: utzoo!attcan!uunet!husc6!cmcl2!rutgers!bellcore!texbell!sugar!karl From: karl@sugar.uu.net (Karl Lehenbauer) Newsgroups: comp.sys.amiga.tech Subject: Aztec compiler ineffeciencies Message-ID: <3013@sugar.uu.net> Date: 25 Nov 88 06:21:13 GMT Organization: Sugar Land Unix - Houston, TX Lines: 38 I've been examining the output of Aztec 3.6a and have discovered that it does no optimization on divides, such as turning divides by constants into shifts and adds, even when the divisor is a power of 2! This is probably Not News to a lot of you, but it was a shocker for me. The code: main() { register int x = 17441; x /= 2; } generates (for the divide): move.l #2,d1 move.l d4,d0 jsr .divs# ; <-- a subroutine call! move.l d0,d4 With a shift: main() { register int x = 17441; x >>= 1; } generates (for the shift)... asr.l #1,d4 -- -- "We've been following your progress with considerable interest, not to say -- contempt." -- Zaphod Beeblebrox IV -- uunet!sugar!karl, Unix BBS (713) 438-5018