Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!sri-spam!ames!oliveb!sun!gorodish!guy From: guy%gorodish@Sun.COM (Guy Harris) Newsgroups: comp.lang.c Subject: Re: standardizing integral type sizes Message-ID: <17001@sun.uucp> Date: Mon, 20-Apr-87 13:14:15 EST Article-I.D.: sun.17001 Posted: Mon Apr 20 13:14:15 1987 Date-Received: Tue, 21-Apr-87 02:42:18 EST References: <101@umich.UUCP> <791@xanth.UUCP> <1987Apr9.155110.28398@sq.uucp> <652@edge.UUCP> Sender: news@sun.uucp Reply-To: guy@sun.UUCP (Guy Harris) Organization: Sun Microsystems, Mountain View Lines: 19 >I bring this up because on the C compilers I've used on the 68000, "int" >has always been a 32-bit quantity. This is almost a necessity, because >of the well-known bad habit of assuming that a pointer will fit in an int. "Almost". I worked on a 68000-based machine that had a C implementation 16-bit "int"s and 32-bit pointers; I didn't find it particularly painful to use, except when I had to fix other people's code to be type-correct (and I knew enough to blame *that* on the other people who wrote that code, not on the C implementation). >But 32-bit ints on the 68000 are nowhere near as efficient as 16-bit ints. >They require twice as many memory accesses, and multiplication and division >have to be performed with subroutines. This latter point can turn a simple >subscripting operation into a performance catastrophe. Nope. Multiplication by a constant can be done in-line, with a sequence of shifts and adds, and the most common type of multiplication in subscripting operations is multiplication by a constant.