Short code to determine compiler's

flint at gistdev.UUCP flint at gistdev.UUCP
Sun Jul 23 09:03:04 AEST 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 at uxc.cso.uiuc.edu
UUCP:     {uunet,pur-ee,convex}!uiucuxc!gistdev!flint



More information about the Comp.lang.c mailing list