gcc/libgcc
Alexander Monakov 5012919d0b nvptx backend prerequisites for OpenMP offloading
gcc/
	* config/nvptx/mkoffload.c (main): Check that either OpenACC or OpenMP
	is selected.  Pass -mgomp to offload compiler in OpenMP case.
	* config/nvptx/nvptx-protos.h (nvptx_shuffle_kind): Move enum
	declaration from nvptx.c.
	(nvptx_gen_shuffle): Declare.
	(nvptx_output_set_softstack): Declare.
	* config/nvptx/nvptx.c (nvptx_shuffle_kind): Move to nvptx-protos.h.
	(need_softstack_decl): New variable.
	(need_unisimt_decl): New variable.
	(diagnose_openacc_conflict): New.  Use it...
	(nvptx_option_override): ...here.  Handle TARGET_GOMP.
	(nvptx_encode_section_info): Handle "shared" attribute.
	(write_as_kernel): Restrict to OpenACC target regions.
	(init_softstack_frame): New.
	(nvptx_init_unisimt_predicate): New.
	(write_omp_entry): New.  Use it...
	(nvptx_declare_function_name): ...here to emit OpenMP target region
	entrypoints.  Handle TARGET_SOFT_STACK.  Call
	nvptx_init_unisimt_predicate.
	(nvptx_output_set_softstack): New.
	(nvptx_get_drap_rtx): Return %argp as the DRAP if needed.
	(nvptx_gen_shuffle): Export.
	(nvptx_output_call_insn): Handle COND_EXEC patterns.  Emit instruction
	predicate.
	(nvptx_print_operand): Fix handling of instruction predicates.
	(nvptx_get_unisimt_master): New helper function.
	(nvptx_get_unisimt_predicate): Ditto.
	(nvptx_call_insn_is_syscall_p): Ditto.
	(nvptx_unisimt_handle_set): Ditto.
	(nvptx_reorg_uniform_simt): New.  Transform code for -muniform-simt.
	(nvptx_reorg): Call nvptx_reorg_uniform_simt.
	(nvptx_handle_shared_attribute): New.  Use it...
	(nvptx_attribute_table): ... here (new entry).
	(nvptx_record_offload_symbol): Handle NULL attributes.
	(nvptx_file_end): Handle need_softstack_decl and need_unisimt_decl.
	(nvptx_simt_vf): New.
	(TARGET_SIMT_VF): Define.
	* config/nvptx/nvptx.h (TARGET_CPU_CPP_BUILTINS): Define
	__nvptx_softstack or __nvptx_unisimt__ when -msoft-stack, or resp.
	-muniform-simt option is active.
	(STACK_SIZE_MODE): Define.
	(FIXED_REGISTERS): Adjust.
	(SOFTSTACK_SLOT_REGNUM): New.
	(SOFTSTACK_PREV_REGNUM): New.
	(REGISTER_NAMES): Adjust.
	(struct machine_function): New fields.
	* config/nvptx/nvptx.md (UNSPEC_SET_SOFTSTACK): New.
	(UNSPEC_VOTE_BALLOT): Ditto.
	(UNSPEC_LANEID): Ditto.
	(UNSPECV_NOUNROLL): Ditto.
	(atomic): New attribute.
	(predicable): New attribute.  Generate predicated forms via
	define_cond_exec.
	(br_true): Mark as not predicable.
	(br_false): Ditto.
	(br_true_uni): Ditto.
	(br_false_uni): Ditto.
	(return): Ditto.
	(trap_if_true): Ditto.
	(trap_if_false): Ditto.
	(nvptx_fork): Ditto.
	(nvptx_forked): Ditto.
	(nvptx_joining): Ditto.
	(nvptx_join): Ditto.
	(nvptx_barsync): Ditto.
	(epilogue): Emit stack restore if TARGET_SOFT_STACK.
	(allocate_stack): Implement for TARGET_SOFT_STACK.  Remove unused code.
	(allocate_stack_<mode>): Remove unused pattern.
	(set_softstack_insn): New pattern.
	(restore_stack_block): Handle for TARGET_SOFT_STACK.
	(nvptx_vote_ballot): New pattern.
	(omp_simt_lane): Ditto.
	(omp_simt_last_lane): Ditto.
	(omp_simt_ordered): Ditto.
	(omp_simt_vote_any): Ditto.
	(omp_simt_xchg_bfly): Ditto.
	(omp_simt_xchg_idx): Ditto.
	(nvptx_nounroll): Ditto.
	(atomic_compare_and_swap<mode>_1): Mark with atomic attribute.
	(atomic_exchange<mode>): Ditto.
	(atomic_fetch_add<mode>): Ditto.
	(atomic_fetch_addsf): Ditto.
	(atomic_fetch_<logic><mode>): Ditto.
	* config/nvptx/nvptx.opt: (msoft-stack): New option.
	(muniform-simt): Ditto.
	(mgomp): Ditto.
	* config/nvptx/t-nvptx (MULTILIB_OPTIONS): New.
	* doc/extend.texi (Nvidia PTX Variable Attributes): New section.
	* doc/invoke.texi (msoft-stack): Document.
	(muniform-simt): Document
	(mgomp): Document.
	* doc/tm.texi: Regenerate.
	* doc/tm.texi.in: (TARGET_SIMT_VF): New hook.
	* target.def: Define it.
	* target-insns.def (omp_simt_lane): New.
	(omp_simt_last_lane): New.
	(omp_simt_ordered): New.
	(omp_simt_vote_any): New.
	(omp_simt_xchg_bfly): New.
	(omp_simt_xchg_idx): New.

libgcc/
	* config/nvptx/crt0.c (__main): Setup __nvptx_stacks and __nvptx_uni.
	* config/nvptx/mgomp.c: New file.
	* config/nvptx/t-nvptx: Add mgomp.c

gcc/testsuite/
	* lib/target-supports.exp (check_effective_target_alloca): Use a
	compile test.
	* gcc.target/nvptx/softstack.c: New test.
	* gcc.target/nvptx/decl-shared.c: New test.
	* gcc.target/nvptx/decl-shared-init.c: New test.

From-SVN: r242503
2016-11-16 20:17:00 +03:00
..
config nvptx backend prerequisites for OpenMP offloading 2016-11-16 20:17:00 +03:00
soft-fp Update soft-fp from glibc (PR libgcc/77265). 2016-08-16 22:30:56 +01:00
ChangeLog nvptx backend prerequisites for OpenMP offloading 2016-11-16 20:17:00 +03:00
config.host [i386][musl] Add cpuinfo to static libgcc only on *-musl* 2016-11-11 17:31:07 +00:00
config.in Support PIE on Solaris 2015-09-24 09:00:22 +00:00
configure configure.ac: Do not create links, only substitute the filenames. 2016-09-21 12:53:20 +00:00
configure.ac configure.ac: Do not create links, only substitute the filenames. 2016-09-21 12:53:20 +00:00
crtstuff.c defaults.h (JCR_SECTION_NAME, [...]): Remove. 2016-10-04 09:49:44 +02:00
dfp-bit.c Update copyright years. 2016-01-04 15:30:50 +01:00
dfp-bit.h Update copyright years. 2016-01-04 15:30:50 +01:00
divmod.c Update copyright years. 2016-01-04 15:30:50 +01:00
empty.mk
emutls.c Update copyright years. 2016-01-04 15:30:50 +01:00
enable-execute-stack-empty.c
enable-execute-stack-mprotect.c Update copyright years. 2016-01-04 15:30:50 +01:00
find-symver.awk Update copyright years. 2016-01-04 15:30:50 +01:00
fixed-bit.c Update copyright years. 2016-01-04 15:30:50 +01:00
fixed-bit.h Update copyright years. 2016-01-04 15:30:50 +01:00
fixed-obj.mk
floatunsidf.c
floatunsisf.c
floatunsitf.c
floatunsixf.c
fp-bit.c Update copyright years. 2016-01-04 15:30:50 +01:00
fp-bit.h Update copyright years. 2016-01-04 15:30:50 +01:00
gbl-ctors.h Update copyright years. 2016-01-04 15:30:50 +01:00
gen-fixed.sh
generic-morestack-thread.c Update copyright years. 2016-01-04 15:30:50 +01:00
generic-morestack.c S/390: Add -fsplit-stack support 2016-02-15 10:20:18 +00:00
generic-morestack.h Update copyright years. 2016-01-04 15:30:50 +01:00
gstdint.h
gthr-posix.h Update copyright years. 2016-01-04 15:30:50 +01:00
gthr-single.h Update copyright years. 2016-01-04 15:30:50 +01:00
gthr.h Update copyright years. 2016-01-04 15:30:50 +01:00
libgcc2.c re PR libgcc/78067 (libgcc2 calls count_leading_zero with 0) 2016-11-03 12:52:19 +00:00
libgcc2.h Makefile.in (LIB2_DIVMOD_FUNCS): Add _divmoddi4. 2016-11-02 23:23:13 +01:00
libgcc-std.ver.in Makefile.in (LIB2_DIVMOD_FUNCS): Add _divmoddi4. 2016-11-02 23:23:13 +01:00
libgcov-driver-system.c re PR bootstrap/71400 (profiledbootstrap failed) 2016-06-06 15:24:24 +00:00
libgcov-driver.c gcov: dump in a static dtor instead of in an atexit handler 2016-09-27 11:07:11 +00:00
libgcov-interface.c Update copyright years. 2016-01-04 15:30:50 +01:00
libgcov-merge.c Remove __gcov_merge_delta (PR bootstrap/77749) 2016-09-27 10:04:39 +00:00
libgcov-profiler.c Make direct emission of time profiler counter 2016-11-03 15:24:22 +00:00
libgcov-util.c Remove __gcov_merge_delta (PR bootstrap/77749) 2016-09-27 10:04:39 +00:00
libgcov.h gcov: dump in a static dtor instead of in an atexit handler 2016-09-27 11:07:11 +00:00
Makefile.in Makefile.in (LIB2_DIVMOD_FUNCS): Add _divmoddi4. 2016-11-02 23:23:13 +01:00
memcmp.c
memcpy.c
memmove.c
memset.c
mkheader.sh Update copyright years. 2016-01-04 15:30:50 +01:00
mkmap-flat.awk Update copyright years. 2016-01-04 15:30:50 +01:00
mkmap-symver.awk Update copyright years. 2016-01-04 15:30:50 +01:00
offloadstuff.c re PR driver/68463 (Offloading fails when some objects are compiled with LTO and some without) 2016-02-25 12:23:52 +00:00
shared-object.mk Add the nvptx port. 2014-11-10 16:12:42 +00:00
siditi-object.mk
static-object.mk Add the nvptx port. 2014-11-10 16:12:42 +00:00
sync.c Update copyright years. 2016-01-04 15:30:50 +01:00
udivmod.c Update copyright years. 2016-01-04 15:30:50 +01:00
udivmodsi4.c Update copyright years. 2016-01-04 15:30:50 +01:00
unwind-arm-common.inc Update copyright years. 2016-01-04 15:30:50 +01:00
unwind-c.c PR libgcc/78064: Add missing include directive to unwind-c.c 2016-10-24 20:25:09 +02:00
unwind-compat.c Update copyright years. 2016-01-04 15:30:50 +01:00
unwind-compat.h Update copyright years. 2016-01-04 15:30:50 +01:00
unwind-dw2-fde-compat.c Update copyright years. 2016-01-04 15:30:50 +01:00
unwind-dw2-fde-dip.c re PR libgcc/68468 (frv/bfin FDPIC toolchain build error) 2016-11-16 08:01:56 +01:00
unwind-dw2-fde.c re PR libgcc/71744 (Concurrently throwing exceptions is not scalable) 2016-09-16 21:17:47 +02:00
unwind-dw2-fde.h Update copyright years. 2016-01-04 15:30:50 +01:00
unwind-dw2.c Update copyright years. 2016-01-04 15:30:50 +01:00
unwind-dw2.h Update copyright years. 2016-01-04 15:30:50 +01:00
unwind-generic.h Update copyright years. 2016-01-04 15:30:50 +01:00
unwind-pe.h Update copyright years. 2016-01-04 15:30:50 +01:00
unwind-seh.c Update copyright years. 2016-01-04 15:30:50 +01:00
unwind-sjlj.c Update copyright years. 2016-01-04 15:30:50 +01:00
unwind.inc Update copyright years. 2016-01-04 15:30:50 +01:00
vtv_end_preinit.c Update copyright years. 2016-01-04 15:30:50 +01:00
vtv_end.c Update copyright years. 2016-01-04 15:30:50 +01:00
vtv_start_preinit.c Update copyright years. 2016-01-04 15:30:50 +01:00
vtv_start.c Update copyright years. 2016-01-04 15:30:50 +01:00