This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add named address support to GCC 4.5
- From: Chris Lattner <clattner at apple dot com>
- To: Michael Meissner <meissner at linux dot vnet dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 17 Apr 2009 09:58:24 -0700
- Subject: Re: [PATCH] Add named address support to GCC 4.5
- References: <20090413152142.GA6655@hungry-tiger.westford.ibm.com>
On Apr 13, 2009, at 8:21 AM, Michael Meissner wrote:
This patch is a combination patch of all of the work done on the
branch
named-addr-spaces-branch to add the ability for backends to named
address space
which are documented in section 5 of the ISO/IEC technical report
#18037:
Programming Languages - C - Extensions to support embedded processors
This patch allows the backend to add new qualifier keywords that can
put
objects into different address spaces. The notion of address space
is carried
throughout the compiler, so that the backend can decide to generate
different
code based on the address space used. Pointers to different named
address
spaces can be different sizes than normal pointers, and the backend
can specify
when pointers to two different named address spaces are compatible
or not.
In the spu backend, there is a single named address space (__ea)
which points
into the host processor's memory space, instead of the onboard
memory space,
and a caching mechanism is used to move items in the larger host
address space
to the local address space.
Out of curiosity, what is the motivation for making these actual
keywords? Clang has support for address spaces as well, and clients
that use them just install a predefine that expands to an attribute.
For example, cellspu could install:
#define __ea __attribute__((address_space(1)))
Which enables, stuff like:
int __ea *P;
etc. Since __ea is in a protected namespace, there should be no
problem making it a macro.
-Chris