summaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorAlexander Monakov <amonakov@ispras.ru>2015-12-01 00:26:18 +0300
committerAlexander Monakov <amonakov@ispras.ru>2015-12-09 19:31:38 +0300
commit61d1318e5c651450a8217a79b6361acd026a187a (patch)
treef93be2c5bec4c16dd744edc32bcb0b8a1ce9c8af /gcc/config
parentf3b131836d906a35d914fac2b97d0ff75545a3ce (diff)
downloadgcc-61d1318e5c651450a8217a79b6361acd026a187a.tar.gz
nvptx backend: add -mgomp option and multilib
Since OpenMP offloading requires both soft-stacks and "uniform SIMT", both non-traditional codegen variants, I'm building a multilib variant with those enabled. This patch adds option -mgomp which enables -msoft-stack plus -muniform-simt, and builds a multilib with it. * config/nvptx/nvptx.c (nvptx_option_override): Handle TARGET_GOMP. * config/nvptx/nvptx.opt (mgomp): New option. * config/nvptx/t-nvptx (MULTILIB_OPTIONS): New. * doc/invoke.texi (mgomp): Document.
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/nvptx/nvptx.c3
-rw-r--r--gcc/config/nvptx/nvptx.opt4
-rw-r--r--gcc/config/nvptx/t-nvptx2
3 files changed, 9 insertions, 0 deletions
diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index 5abe962b4a6..c1afba3c370 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -185,6 +185,9 @@ nvptx_option_override (void)
worker_red_sym = gen_rtx_SYMBOL_REF (Pmode, worker_red_name);
SET_SYMBOL_DATA_AREA (worker_red_sym, DATA_AREA_SHARED);
worker_red_align = GET_MODE_ALIGNMENT (SImode) / BITS_PER_UNIT;
+
+ if (TARGET_GOMP)
+ target_flags |= MASK_SOFT_STACK | MASK_UNIFORM_SIMT;
}
/* Return a ptx type for MODE. If PROMOTE, then use .u32 for QImode to
diff --git a/gcc/config/nvptx/nvptx.opt b/gcc/config/nvptx/nvptx.opt
index f8508d80910..af599ae37f4 100644
--- a/gcc/config/nvptx/nvptx.opt
+++ b/gcc/config/nvptx/nvptx.opt
@@ -40,3 +40,7 @@ Use custom stacks instead of local memory for automatic storage.
muniform-simt
Target Report Mask(UNIFORM_SIMT)
Generate code that executes all threads in a warp as if one was active.
+
+mgomp
+Target Report Mask(GOMP)
+Generate code for OpenMP offloading: enables -msoft-stack and -muniform-simt.
diff --git a/gcc/config/nvptx/t-nvptx b/gcc/config/nvptx/t-nvptx
index e2580c956e0..6c1010ddd66 100644
--- a/gcc/config/nvptx/t-nvptx
+++ b/gcc/config/nvptx/t-nvptx
@@ -8,3 +8,5 @@ ALL_HOST_OBJS += mkoffload.o
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)
+
+MULTILIB_OPTIONS = mgomp