Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!husc6!seismo!mcvax!dik From: dik@mcvax.UUCP Newsgroups: comp.arch Subject: Re: Optimization vs. the programmer Message-ID: <344@zuring.mcvax.cwi.nl> Date: Sat, 11-Apr-87 19:35:34 EST Article-I.D.: zuring.344 Posted: Sat Apr 11 19:35:34 1987 Date-Received: Tue, 14-Apr-87 00:00:40 EST References: <479@danews.ATT.COM> <3300003@uiucdcsm> Reply-To: dik@zuring.UUCP (Dik T. Winter) Organization: CWI, Amsterdam Lines: 15 In article <3300003@uiucdcsm> grunwald@uiucdcsm.cs.uiuc.edu writes: > > Strength reduction is replacement of operations such as "i = j * 8" by > "i = j << 3", or "i = j % 8" by "i = j & 0x3" (if j is unsigned). > > As for source-to-source translation: not for me. And that is right, otherwise you might see i * 14 transformed to (i << 4) - (i << 1), which is slower on some machines. (The Pascal compiler on one of the systems I use did this, this 'optimization' has been turned off.) -- dik t. winter, cwi, amsterdam, nederland INTERNET : dik@cwi.nl BITNET/EARN: dik@mcvax