Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!smurf!urlichs From: urlichs@smurf.sub.org (Matthias Urlichs) Newsgroups: comp.sys.mac.programmer Subject: Re: Increment (Was Re: Pascal deficiency)? Message-ID: Date: 18 Dec 90 23:19:13 GMT References: <1990Dec18.001753.3756@Neon.Stanford.EDU> <49832@cornell.UUCP> Organization: University of Karlsruhe, FRG Lines: 24 In comp.sys.mac.programmer, article <49832@cornell.UUCP>, wayner@cello.cs.cornell.edu (Peter Wayner) writes: < < This is good information, but how many cycles does each of these take? < They are both going to memory, incrementing and returning a value. I < suspect that the latest versions of the 68040 will heavily pipeline < this operation, perhaps, but it is not clear that just using one instruction < is faster than using 3. Don't forget the two memory cycles to read these other instructions, which also translate to taking more time to read them from disk and effectively fewer instructions that can be kept in the instruction cache. The MC68000 manual says that ADDQ.L #1,(Ax) will take 20 clock cycles (assuming four cycles per memory access), while MOVE.L (Ax),Dy ADDQ.L #1,Dy MOVE.L Dy,(Ax) takes 8+8+8=24 cycles. (All of these instructions take up 16 bits.) -- Matthias Urlichs -- urlichs@smurf.sub.org -- urlichs@smurf.ira.uka.de /(o\ Humboldtstrasse 7 - 7500 Karlsruhe 1 - FRG -- +49+721+621127(0700-2330) \o)/