Commit 1f83528e by Thomas Schwinge Committed by Thomas Schwinge

nvptx mkoffload.

	gcc/
	* config/nvptx/mkoffload.c: New file.
	* config/nvptx/t-nvptx: Add build rules for it.
	* config.gcc <nvptx-*> [$enable_as_accelerator = yes]
	(extra_programs): Add mkoffload.
	* config/nvptx/nvptx.c (nvptx_record_offload_symbol): New
	function.
	(TARGET_RECORD_OFFLOAD_SYMBOL): Define macro to use it.

Co-Authored-By: Bernd Schmidt <bernds@codesourcery.com>
Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com>

From-SVN: r220209
parent 26586d77
2015-01-28 Thomas Schwinge <thomas@codesourcery.com>
Bernd Schmidt <bernds@codesourcery.com>
Nathan Sidwell <nathan@codesourcery.com>
* config/nvptx/mkoffload.c: New file.
* config/nvptx/t-nvptx: Add build rules for it.
* config.gcc <nvptx-*> [$enable_as_accelerator = yes]
(extra_programs): Add mkoffload.
* config/nvptx/nvptx.c (nvptx_record_offload_symbol): New
function.
(TARGET_RECORD_OFFLOAD_SYMBOL): Define macro to use it.
2015-01-28 Yuri Rumyantsev <ysrumyan@gmail.com>
PR middle-end/64809
......
......@@ -2233,7 +2233,10 @@ nios2-*-*)
nvptx-*)
tm_file="${tm_file} newlib-stdint.h"
tmake_file="nvptx/t-nvptx"
tm_file="${tm_file} nvptx/offload.h"
if test x$enable_as_accelerator = xyes; then
extra_programs="${extra_programs} mkoffload\$(exeext)"
tm_file="${tm_file} nvptx/offload.h"
fi
;;
pdp11-*-*)
tm_file="${tm_file} newlib-stdint.h"
......
......@@ -2030,6 +2030,16 @@ nvptx_vector_alignment (const_tree type)
return MIN (align, BIGGEST_ALIGNMENT);
}
/* Record a symbol for mkoffload to enter into the mapping table. */
static void
nvptx_record_offload_symbol (tree decl)
{
fprintf (asm_out_file, "//:%s_MAP %s\n",
TREE_CODE (decl) == VAR_DECL ? "VAR" : "FUNC",
IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
}
/* Implement TARGET_ASM_FILE_START. Write the kinds of things ptxas expects
at the start of a file. */
......@@ -2133,6 +2143,9 @@ nvptx_file_end (void)
#undef TARGET_NO_REGISTER_ALLOCATION
#define TARGET_NO_REGISTER_ALLOCATION true
#undef TARGET_RECORD_OFFLOAD_SYMBOL
#define TARGET_RECORD_OFFLOAD_SYMBOL nvptx_record_offload_symbol
#undef TARGET_VECTOR_ALIGNMENT
#define TARGET_VECTOR_ALIGNMENT nvptx_vector_alignment
......
#
CFLAGS-mkoffload.o += $(DRIVER_DEFINES) \
-DGCC_INSTALL_NAME=\"$(GCC_INSTALL_NAME)\"
mkoffload.o: $(srcdir)/config/nvptx/mkoffload.c
$(COMPILE) $<
$(POSTCOMPILE)
mkoffload$(exeext): mkoffload.o collect-utils.o libcommon-target.a $(LIBIBERTY) $(LIBDEPS)
+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
mkoffload.o collect-utils.o libcommon-target.a $(LIBIBERTY) $(LIBS)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment