Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!uunet!dino!uxc.cso.uiuc.edu!uxc.cso.uiuc.edu!gistdev!flint From: flint@gistdev.UUCP Newsgroups: comp.lang.c Subject: Re: Short code to determine compiler's Message-ID: <7800016@gistdev> Date: 22 Jul 89 23:03:04 GMT References: <396@uop.uop.EDU> Lines: 19 Nf-ID: #R:uop.uop.EDU:396:gistdev:7800016:000:1109 Nf-From: gistdev.UUCP!flint Jul 21 17:32:00 1989 I think you're gonna come back to "you have to look at the assembler output." For one thing, you really can't know that the compiler hasn't decided (possibly stupidly) to reserve a register for something else, such as a stack pointer, which would make your count too low. Some other things nobody has taken into account here is that there are some architectures with multiple levels of register performance: such as machines that have X registers, and then a second (or more) bank(s) of X alternate registers, with a fast instruction to exchange the contents of the registers with the contents of the alternate registers. A timing loop is likely to see 4 levels of speed: when using only the first bank of registers, when you have to switch to the other bank and use a register, when you have to switch to the other bank, use a register, and then switch back, and when you have to use memory. Flint Pellett, Global Information Systems Technology, Inc. 1800 Woodfield Drive, Savoy, IL 61874 (217) 352-1165 INTERNET: flint%gistdev@uxc.cso.uiuc.edu UUCP: {uunet,pur-ee,convex}!uiucuxc!gistdev!flint