From owner-svn-src-head@FreeBSD.ORG Sun Jan 9 14:45:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 093F8106566C; Sun, 9 Jan 2011 14:45:17 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay009.isp.belgacom.be (mailrelay009.isp.belgacom.be [195.238.6.176]) by mx1.freebsd.org (Postfix) with ESMTP id EDDF28FC08; Sun, 9 Jan 2011 14:45:15 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEABZXKU1bsZXL/2dsb2JhbACkRnS7B4VMBA Received: from 203.149-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.149.203]) by relay.skynet.be with ESMTP; 09 Jan 2011 15:45:14 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.4/8.14.4) with ESMTP id p09EjDdO003310; Sun, 9 Jan 2011 15:45:13 +0100 (CET) (envelope-from tijl@freebsd.org) From: Tijl Coosemans To: Juli Mallett Date: Sun, 9 Jan 2011 15:45:04 +0100 User-Agent: KMail/1.13.5 (FreeBSD/9.0-CURRENT; KDE/4.5.2; i386; ; ) References: <201101081243.p08Ch5vR092295@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart5487643.9KjrX2DFoP"; protocol="application/pgp-signature"; micalg=pgp-sha256 Content-Transfer-Encoding: 7bit Message-Id: <201101091545.11754.tijl@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217147 - in head/sys: amd64/include arm/include i386/include ia64/include mips/include powerpc/include sparc64/include sun4v/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jan 2011 14:45:17 -0000 --nextPart5487643.9KjrX2DFoP Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Saturday 08 January 2011 21:30:49 Juli Mallett wrote: > On Sat, Jan 8, 2011 at 04:43, Tijl Coosemans wrote: >> Author: tijl >> Date: Sat Jan 8 12:43:05 2011 >> New Revision: 217147 >> URL: http://svn.freebsd.org/changeset/base/217147 >> >> Log: >> On mixed 32/64 bit architectures (mips, powerpc) use __LP64__ rather th= an >> architecture macros (__mips_n64, __powerpc64__) when 64 bit types (and >> corresponding macros) are different from 32 bit. [1] >=20 > I don't know why you didn't talk with MIPS people at all about these > changes. That they were reviewed by Bruce is very reassuring in > aesthetic terms, but that's hardly sufficient. >=20 > This and other changes have made it harder to support common MIPS > configurations and compilation options on FreeBSD. I'm glad you're at > least aware of n32 (as indicated in another message) and its > implications, but the use of ABI-specific names was deliberate. Have > you thought about -n32 with -mlong64? It isn't the same kind of dirty > hack as Bruce talks about when he talks about 64-bit longs on x86. >=20 > I understand that __LP64__ and the idea that there are two reasonable > ABIs most (one 32-bit and one 64-bit) is appealing, but it's not true. > In the case of PowerPC, it does look like they weren't ABI-specific > macros, but MIPS's were. If nothing else, you make MIPS headers more > inconsistent with themselves, where most of them are > ABI-conditionalized and now some are instead LP64-centric. >=20 > It seems like your end goal is probably consolidating these headers, > which I would like, too, but please attempt to allow for more > variation than just "longs are 32-bit and pointers are 32-bit, > otherwise longs are 64-bit and pointers are 64-bit." We're trying to > do the right thing with MIPS in terms of supporting multiple valid > ABIs on a single port, something which is a lot harder when people > restructure these critical headers without even asking us whether > there are any evident problems; even if 'make universe', for instance, > were enough, it leaves out some ABIs, and it certainly leaves out > future plans wrt ABIs. My main goal is to compile 32 bit code on amd64. To do that i386 and amd64 headers need to be merged as much as possible and I'm looking at mips and powerpc headers as examples. As I'm going through each of the machine headers however and as people review my patches several issues have come up. These are mostly generic in nature and spread over all architectures, not just mips. There are more problems in the mips and powerpc headers however because of the complexity of supporting both 32 bit and 64 bit ABIs. If you consider the mips headers too delicate to be changed without approval from mips@ I'll make sure to send patches there before committing from now on. As for 64 bit longs on 32 bit ABIs I would advise against spending your time on that. It's something that sounds nice in theory, but it's just not practical. You don't gain anything from it because there's another 64 bit type already (long long) and there's too much code out there that relies on long and pointer types having the same size or that assumes long is different between 32 bit and 64 bit ABIs, also in our own tree. So yes, in practice there's only ILP32 and LP64 and nothing in between. About the use of __LP64__. It's essentially cosmetic and can easily be changed back. However, if you can agree with me on mlong64 I would like to keep it (for type definitions). What the patches (committed + upcoming) show is that _inttypes.h, _limits.h and _stdint.h (_types.h needs more work) are exactly the same for mips, powerpc and x86 indicating that they aren't architecture specific. Changing __LP64__ back to __mips_n64 would introduce a difference that isn't any. Moreover, those headers would also work on pure ILP32 (arm) and LP64 (ia64, sparc64) architectures, so personally I would like to move them to sys/, because as the patches show, duplicated code starts to diverge, bugs creep in and are subsequently copy-pasted. Whenever I suggested this to someone however I never really got a positive response so the headers will stay under machine/ for now. I would still like to get a clear yes or no on this though. If you would still like to support mlong64, I think it should be possible to do this for all 32 bit architectures because the size of long isn't architecture dependent. But like I said, in my opinion it requires a lot of effort to get right for no gain at all. --nextPart5487643.9KjrX2DFoP Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iF4EABEIAAYFAk0pyfcACgkQfoCS2CCgtisQCgD+JpivGdKHMVojasPXYx1EGp9C GUlYrc5W/4hPc1/F1UwA+gKN+8xgtQLPd4A+sqg41rNpGD7NeyuNUSYRA7zXij5w =c5kQ -----END PGP SIGNATURE----- --nextPart5487643.9KjrX2DFoP--