From owner-freebsd-sparc Tue Dec 16 15:27:33 1997 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.7/8.8.7) id PAA10588 for sparc-outgoing; Tue, 16 Dec 1997 15:27:33 -0800 (PST) (envelope-from owner-freebsd-sparc@FreeBSD.ORG) Received: from dorifer.heim3.tu-clausthal.de (dorifer.heim3.tu-clausthal.de [139.174.243.252]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id PAA10564 for ; Tue, 16 Dec 1997 15:27:10 -0800 (PST) (envelope-from olli@dorifer.heim3.tu-clausthal.de) Received: (from olli@localhost) by dorifer.heim3.tu-clausthal.de (8.8.5/8.8.5) id AAA13925 for freebsd-sparc@FreeBSD.ORG; Wed, 17 Dec 1997 00:26:34 +0100 (MET) Date: Wed, 17 Dec 1997 00:26:34 +0100 (MET) From: Oliver Fromme Message-Id: <199712162326.AAA13925@dorifer.heim3.tu-clausthal.de> To: freebsd-sparc@FreeBSD.ORG Subject: Data types (was: Re: FAQ FreeBSD-Sparc [frequent posting]) Newsgroups: list.freebsd-sparc Organization: Administration Heim 3 Reply-To: freebsd-sparc@FreeBSD.ORG MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Newsreader: TIN [version 1.2 RZTUC(3) PL2] Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org In list.freebsd-sparc perhaps@yes.no wrote: > > Assumptions about the size of int will need fixed. > > OK, what assumptions are correct on UltraSPARC? (Here comes a set of > possible assumptions; could you try to say which are wrong, and I'll > try to fix the places where some of them occur?) > [...] On DEC Alpha (at least with DEC's cc), the following is true: - sizeof(short) == 2 - sizeof(int) == 4 - sizeof(long) == 8 - sizeof(void*) == 8 Which is a good choice, IMHO. I don't think it is a problem to have sizeof(int) != sizeof(void*), at least I haven't had any problems with that on Alphas. Software which assumes that ints and pointers are of equal size is broken anyway. On the other hand, I don't know how efficient it is to access 32 bit units on the UltraSparc, compared to 64 bit units. If 32 bit accesses involve a penalty (especially if they are not 64-bit-aligned), it might be worth to use sizeof(int) = sizeof(long) = 8. Is there a special version of gcc for UltraSparc? If so, we will have to use its idea of the data type sizes, I'm afraid, so there's no choice. Just my 2 cents... Regards Oliver -- Oliver Fromme, Leibnizstr. 18-61, 38678 Clausthal, Germany (Info: finger userinfo:olli@dorifer.heim3.tu-clausthal.de)