smith@NRL-AIC.ARPA (06/15/84)
From: Russ Smith <smith@NRL-AIC.ARPA> I've written reams of C code (on a z80 machine) where I would have loved to get away from the fact that the ints on my C compiler (C/80) are 16 bits rather than 8 bits. Because K&R says most everything is converted to int in expressions a good portion of the compiled code execution (actually dealing with chars) is comprised of calls to conversion routines. In my case, much of the code deals with very small absolute values for numbers hence my "memory-saving" use of chars. Methinks the 6809 must be really lousy at 16 bit arithemetic. It would certainly be the case that 8 bit arithemetic for most of a benchmark program would tend to greatly enhance the performance (relative to other compilers).... Russ <Smith@nrl-aic>
mark@umcp-cs.UUCP (06/19/84)
The Vandata C cross-compiler we use for our z-80 work has compile time options one sets to get the following behaviors: 1. normal, promote arithmetic on chars to 16 bits before performing. 2. faster, don't promote arithmetic on chars to 16, leave it at 8-bits except for subroutine arguements. 3. fastest but dangerous, don't even promote chars in arguments. This allows you to write code using chars where you know the values fit in 8 bits, and the compiler will generate fast 8-bit op-codes if you ask it to. -- Spoken: Mark Weiser ARPA: mark@maryland CSNet: mark@umcp-cs UUCP: {seismo,allegra}!umcp-cs!mark