From patchwork Thu Jun 9 16:53:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Monakov X-Patchwork-Id: 633024 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rQWdK6kJRz9sBl for ; Fri, 10 Jun 2016 02:55:17 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=yFz8NIEh; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=soq8MKPHCHhk206rJivaF0Kla/MauosxuU2ekJ5PcBqXduSeLNntp XmAvVEKauzsHINe1l8MjZJmNBiQQKwUGE09vUQLguY0egHr22eVHH8dZR6tI6Su5 ym0KK5GNerVyCHbyATLn/VRlVd43oOrNZV7mu+mjr3ujykmJNol6yE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; s= default; bh=V1HIt/CFyxpMLOeWZyH1q6rb/uE=; b=yFz8NIEhmx4/w1Ax4DID hBS6etTmBl8s0KRstfpMFp3XBTmMHGkseGL373nxuGUA7Fap3MAj7rv9OkaIDkQp sY9ZsxVsi2bfXpxJcXviLv7CGFn4BOi2SkaBn+Uskql7zRM1wzNSgHwS3fYluv+q tHoM2TAYWccAOV2p76brn3A= Received: (qmail 47694 invoked by alias); 9 Jun 2016 16:54:30 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 46959 invoked by uid 89); 9 Jun 2016 16:54:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy= X-HELO: smtp.ispras.ru Received: from smtp.ispras.ru (HELO smtp.ispras.ru) (83.149.199.79) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 09 Jun 2016 16:54:16 +0000 Received: from condor.intra.ispras.ru (unknown [83.149.199.91]) by smtp.ispras.ru (Postfix) with ESMTP id 59760203B8; Thu, 9 Jun 2016 19:54:01 +0300 (MSK) Received: by condor.intra.ispras.ru (Postfix, from userid 23246) id EBBB1122632C; Thu, 9 Jun 2016 19:54:00 +0300 (MSK) From: Alexander Monakov To: gcc-patches@gcc.gnu.org Cc: Nathan Sidwell , Sandra Loosemore Subject: [PATCH 4/8] nvptx -mgomp Date: Thu, 9 Jun 2016 19:53:56 +0300 Message-Id: <1465491240-21514-5-git-send-email-amonakov@ispras.ru> In-Reply-To: <1465491240-21514-1-git-send-email-amonakov@ispras.ru> References: <1465491240-21514-1-git-send-email-amonakov@ispras.ru> X-IsSubscribed: yes This patch adds option -mgomp which enables -msoft-stack plus -muniform-simt, and builds a multilib with it. This codegen convention is used for OpenMP offloading. * 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. --- gcc/config/nvptx/nvptx.c | 3 +++ gcc/config/nvptx/nvptx.opt | 4 ++++ gcc/config/nvptx/t-nvptx | 2 ++ gcc/doc/invoke.texi | 5 +++++ 4 files changed, 14 insertions(+) diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index f91573a..294002e 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -192,6 +192,9 @@ nvptx_option_override (void) worker_red_sym = gen_rtx_SYMBOL_REF (Pmode, "__worker_red"); 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 0d46e1d..cb6194d 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 can keep local state uniform across all lanes. + +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 e2580c9..6c1010d 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 diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 534025d..bae7f2d 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -19631,6 +19631,11 @@ generation variant is used for OpenMP offloading, but the option is exposed on its own for the purpose of testing the compiler; to generate code suitable for linking into programs using OpenMP offloading, use option @option{-mgomp}. +@item -mgomp +@opindex mgomp +Generate code for use in OpenMP offloading: enables @option{-msoft-stack} and +@option{-muniform-simt} options, and selects corresponding multilib variant. + @end table @node PDP-11 Options