From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20751 invoked by alias); 21 Apr 2011 22:21:41 -0000 Received: (qmail 20743 invoked by uid 22791); 21 Apr 2011 22:21:40 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,NO_DNS_FOR_FROM,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e8.ny.us.ibm.com (HELO e8.ny.us.ibm.com) (32.97.182.138) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 21 Apr 2011 22:21:14 +0000 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e8.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p3LLtdQM025324 for ; Thu, 21 Apr 2011 17:55:39 -0400 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p3LMKduG065246 for ; Thu, 21 Apr 2011 18:20:44 -0400 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p3LMKMIM010375 for ; Thu, 21 Apr 2011 16:20:22 -0600 Received: from hungry-tiger.westford.ibm.com (dyn9033037078.westford.ibm.com [9.33.37.78]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p3LMKL4s010365; Thu, 21 Apr 2011 16:20:21 -0600 Received: by hungry-tiger.westford.ibm.com (Postfix, from userid 500) id DAB9BF7E46; Thu, 21 Apr 2011 18:20:37 -0400 (EDT) Date: Thu, 21 Apr 2011 22:21:00 -0000 From: Michael Meissner To: "Paulo J. Matos" Cc: gcc@gcc.gnu.org Subject: Re: Supporting multiple pointer sizes in GCC Message-ID: <20110421222037.GA18572@hungry-tiger.westford.ibm.com> Mail-Followup-To: Michael Meissner , "Paulo J. Matos" , gcc@gcc.gnu.org References: <371569CBCFB2E745B891DBB88B2DFDDD1A229C5E3A@KCINPUNHJCMS01.kpit.com> <371569CBCFB2E745B891DBB88B2DFDDD1A22BB908B@KCINPUNHJCMS01.kpit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2011-04/txt/msg00314.txt.bz2 On Thu, Mar 31, 2011 at 01:32:24PM +0100, Paulo J. Matos wrote: > On 30/03/11 08:57, Claudiu Zissulescu wrote: > >Hi, > > > >I would try using the named address space for your issue (see > >TARGET_ADDR_SPACE_POINTER_MODE). Please check the SPU target for an > >implementation example. > > > > Hummm, I haven't noticed this hook before. Could this be used to > implement cases where function pointers have a different size than > data pointers (as in harvard archs). It looks like it but can > someone confirm? The SPU uses named address space to deal with local memory that the processor deals with normally, and global memory that the host powerpc can see, and it is moved in/out of the local memory. In -mea64 mode, the external memory is 64-bits, so it has two different sizes of pointer. The backend controls whether one named address is a subset of another, and whether you can convert between the named address spaces. The technical report (N1169) of the ISO C committee that the address space support is based on does not allow for function pointers to be different sizes, just the data pointers. The 2009 GCC summit proceedings has my paper describing adding the named address space support to the compiler. Note I have moved groups within IBM, and no longer work on the SPU compiler, so I haven't touched the named address space support since the early part of 2009. http://gcc.gnu.org/wiki/HomePage?action=AttachFile&do=view&target=2009-GCC-Summit-Proceedings.pdf -- Michael Meissner, IBM 5 Technology Place Drive, M/S 2757, Westford, MA 01886-3141, USA meissner@linux.vnet.ibm.com fax +1 (978) 399-6899