On 10/28/14 08:56, Bernd Schmidt wrote:
I have patches that expose all the address spaces to the middle-end
through a lower-as pass that runs early. The preliminary patches for
that ran into some resistance and into general brokenness of our address
space support, so I decided to rip all that out for the moment to get
the basic port into the next version.
This new version also implements a way of providing realloc that was
suggested in another thread. Calls to malloc and free are redirected to
libgcc variants. I'm not a big fan of wasting extra space on every
allocation (which is why I didn't originally consider this approach
viable), but it seems we'll have to do it that way. There's a change to
the libgcc build system: on ptx we need comments in the assembly to
survive, so we can't use -xassembler-with-cpp. I've not found any files
named "*.asm", so I've changed that suffix to mean plain assembler.
Bernd
010-target.diff
* configure.ac: Allow configuring lto for nvptx.
* configure: Regenerate.
gcc/
* config/nvptx/nvptx.c: New file.
* config/nvptx/nvptx.h: New file.
* config/nvptx/nvptx-protos.h: New file.
* config/nvptx/nvptx.md: New file.
* config/nvptx/t-nvptx: New file.
* config/nvptx/nvptx.opt: New file.
* common/config/nvptx/nvptx-common.c: New file.
* config.gcc: Handle nvptx-*-*.
libgcc/
* config.host: Handle nvptx-*-*.
* shared-object.mk (as-flags-$o): Define.
($(base)$(objext), $(base)_s$(objext)): Use it instead of
-xassembler-with-cpp.
* static-object.mk: Identical changes.
* config/nvptx/t-nvptx: New file.
* config/nvptx/crt0.s: New file.
* config/nvptx/free.asm: New file.
* config/nvptx/malloc.asm: New file.
* config/nvptx/realloc.c: New file.
A "nit" -- Richard S. recently removed the need to include the "enum"
for "enum machine_mode". I believe he had a script to handle the
mundane parts of that change. Please make sure to update the nvptx port
to conform to that new convention, obviously feel free to use the script
if you want.
You may need to update with James Greenhalgh's changes to
MOVE_BY_PIECES_P and friends.
With those two issues addressed as needed, this is OK for the trunk.
FWIW, I'm amazed at how many similarities there are between what needs
to be done for the PTX tools and what needed to be done to interface
with the native HPPA tools way-back-when. Simply amazing.
I notice that you've got some OpenMP bits (write_as_kernel). Are y'all
doing any testing with OpenMP or is that an artifact of layering OpenACC
on top of the OpenMP infrastructure?
Also, I've asked the steering committee to appoint you as the maintainer
for the nvptx port as well.
jeff