Date: Sun, 26 Nov 1995 17:00:38 -0800 (PST) From: Jake Hamby <jehamby@lightside.com> To: Terry Lambert <terry@lambert.org> Cc: terry@lambert.org, grog@lemis.de, hackers@FreeBSD.org Subject: Re: How long is long? Message-ID: <Pine.BSF.3.91.951126165536.436A-100000@localhost> In-Reply-To: <199511262332.QAA17633@phaeton.artisoft.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 26 Nov 1995, Terry Lambert wrote: > There's a flag on Aztec to set it to 32. But it wasn't the default. > > Aztec code ran faster because it took a single bus cycle to fetch an > Aztec int, but two to fetch a Lattice (SAS) int. > > Faster is better. <-- AXIOM > > It boils down to if you think the registers dictate sizeof(int) or the > bus width dictates it. > > Personally I think it should be dictated by min(sizeof(REG),sizeof(BUS)) > so that it is *always* a single cycle fetch. Hardware engineers (who > are the fiends who cause such problems for programmers in the first > place) would probably disagree. > > The 32 bit int became a defacto standard on the Amiga because of the > code base and the pushing from Commodore itself. Hmmm, I think I agree with you here. It's just that I've become so used to the Windoze brainwashing of "Our program is better because it's '32-bit'"! Of course, there they are confusing the fact that the speed increase is not from 32-bit integer size, but from getting rid of DOS brain-damage and segmented memory (and using 32-bit registers instead of 16-bit for "long" manipulation). In general, then, I suppose 16-bit code would be faster than 32-bit code if the bus width was 16 bits... > BTW: I agree with your examples, although I wouldn't have said '"int" > should be 16-bits on an 80386SX', I would have said 'Intel should never > have produces a 386SX, the PC manufactures should have had to update > their 286 board designs instead of adapting them'. > > The natural consequence of this is that "int" is 32 bits and 80386SX > purchasers suffer for their bad taste. Yup. I almost forgot to mention that Motorola also made the "68008" which was a 68000 with an 8-bit data bus, so people could adapt their 8 bit designs to the 68000-series! Explain that bit of brain damage! :-) > Of course, that doesn't mean that I don't believe that FreeBSD shouldn't > be compilable/runnable with 16 bit ints. It should. I suppose.. It's just that too many people make bad assumptions about the size of 'int' in their code. Did you ever notice all the compiler warnings when compiling X11R6 about "casting pointer to integer", "casting integer to pointer", etc? Scary... ------------------------------------------------------------------------------ Jake Hamby | E-Mail: jehamby@lightside.com Student, Cal Poly University, Pomona | System Administrator, JPL ------------------------------------------------------------------------------
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.951126165536.436A-100000>