From patchwork Wed Apr 20 08:46:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 612545 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 3qqb9w3DKpz9t3m for ; Wed, 20 Apr 2016 18:47:48 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=sATHfbdk; 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:in-reply-to:references:date:message-id :mime-version:content-type; q=dns; s=default; b=SnjWqH3mt+x/3Eha iNQBIM3UllVjK9V98eTMtz+C47xQsMux7v29GsIQhNx8wBLxh1drSXCk/9nFJdOh XpnZGgb5IsYgkPSuASO3MDeX8rsZYmD9tBvb6Ifhiymm6HJ3CqGo664aek4B1eu6 CuNv0fyk53bUB6C0kbKrRgnMcqQ= 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:in-reply-to:references:date:message-id :mime-version:content-type; s=default; bh=tZ804v274/pdeEBeCGsaB3 SAix4=; b=sATHfbdk7IY8iUv/0yVqHSjXRXxx4T4weX80pON8cSywEYPLkGYujW kCDUmxYItdtxfKnoCAVzsc9W1Y9XcyxIeewr8qkddLnPqgWfn65wM2UMrzOLG+MF IbVqvUOyRHo3fTbuDppmxbWW/8JdXo7qGktjomzSZXdx4RjJGPXr8= Received: (qmail 104929 invoked by alias); 20 Apr 2016 08:47:37 -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 104868 invoked by uid 89); 20 Apr 2016 08:47:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Processing, l4, l5, Multi X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 20 Apr 2016 08:47:24 +0000 Received: from svr-orw-fem-03.mgc.mentorg.com ([147.34.97.39]) by relay1.mentorg.com with esmtp id 1asnn7-0005Og-34 from Thomas_Schwinge@mentor.com ; Wed, 20 Apr 2016 01:47:21 -0700 Received: from tftp-cs (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.3.224.2; Wed, 20 Apr 2016 01:47:20 -0700 Received: by tftp-cs (Postfix, from userid 49978) id C3BF3C23E9; Wed, 20 Apr 2016 01:47:19 -0700 (PDT) From: Thomas Schwinge To: , Jakub Jelinek CC: Nathan Sidwell Subject: Re: Remove unused openacc call In-Reply-To: <56411718.6080503@acm.org> References: <56411718.6080503@acm.org> User-Agent: Notmuch/0.9-125-g4686d11 (http://notmuchmail.org) Emacs/24.5.1 (i586-pc-linux-gnu) Date: Wed, 20 Apr 2016 10:46:38 +0200 Message-ID: <87k2js3bwx.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Hi! On Mon, 9 Nov 2015 16:58:48 -0500, Nathan Sidwell wrote: > I've committed this to trunk. It nuke the now unused GOACC_GET_NUM_THREADS and > GOACC_GET_THREAD_NUM calls. > * omp-low.c: [...] > (lower_reduction_clauses): Remove BUILT_IN_GOACC_GET_THREAD_NUM call. > * omp-builtins.def (BUILT_IN_GOACC_GET_THREAD_NUM, > BUILT_IN_GOACC_GET_NUM_THREADS): Delete. Given that in GCC 6 we only provide host fallback execution for executables compiled with GCC 5 (and thus using the legacy entry points), we can further clean this up as follows. OK for gcc-6-branch and trunk? commit a3993b5fae8b430e1dca23179aaa23a6c53ea2fb Author: Thomas Schwinge Date: Tue Nov 10 16:59:46 2015 +0100 Clean up libgomp GCC 5 legacy support libgomp/ * config/nvptx/oacc-parallel.c: Empty file. * oacc-parallel.c: Add comments to legacy entry points (GCC 5). --- libgomp/config/nvptx/oacc-parallel.c | 358 ----------------------------------- libgomp/oacc-parallel.c | 6 +- 2 files changed, 5 insertions(+), 359 deletions(-) Grüße Thomas diff --git libgomp/config/nvptx/oacc-parallel.c libgomp/config/nvptx/oacc-parallel.c index 243f3e5..e69de29 100644 --- libgomp/config/nvptx/oacc-parallel.c +++ libgomp/config/nvptx/oacc-parallel.c @@ -1,358 +0,0 @@ -/* OpenACC constructs - - Copyright (C) 2014-2016 Free Software Foundation, Inc. - - Contributed by Mentor Embedded. - - This file is part of the GNU Offloading and Multi Processing Library - (libgomp). - - Libgomp is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3, or (at your option) - any later version. - - Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - Under Section 7 of GPL version 3, you are granted additional - permissions described in the GCC Runtime Library Exception, version - 3.1, as published by the Free Software Foundation. - - You should have received a copy of the GNU General Public License and - a copy of the GCC Runtime Library Exception along with this program; - see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - . */ - -#include "libgomp_g.h" - -__asm__ (".visible .func (.param .u32 %out_retval) GOACC_tid (.param .u32 %in_ar1);\n" - ".visible .func (.param .u32 %out_retval) GOACC_ntid (.param .u32 %in_ar1);\n" - ".visible .func (.param .u32 %out_retval) GOACC_ctaid (.param .u32 %in_ar1);\n" - ".visible .func (.param .u32 %out_retval) GOACC_nctaid (.param .u32 %in_ar1);\n" - "// BEGIN GLOBAL FUNCTION DECL: GOACC_get_num_threads\n" - ".visible .func (.param .u32 %out_retval) GOACC_get_num_threads;\n" - "// BEGIN GLOBAL FUNCTION DECL: GOACC_get_thread_num\n" - ".visible .func (.param .u32 %out_retval) GOACC_get_thread_num;\n" - "// BEGIN GLOBAL FUNCTION DECL: abort\n" - ".extern .func abort;\n" - ".visible .func (.param .u32 %out_retval) GOACC_tid (.param .u32 %in_ar1)\n" - "{\n" - ".reg .u32 %ar1;\n" - ".reg .u32 %retval;\n" - ".reg .u64 %hr10;\n" - ".reg .u32 %r22;\n" - ".reg .u32 %r23;\n" - ".reg .u32 %r24;\n" - ".reg .u32 %r25;\n" - ".reg .u32 %r26;\n" - ".reg .u32 %r27;\n" - ".reg .u32 %r28;\n" - ".reg .u32 %r29;\n" - ".reg .pred %r30;\n" - ".reg .u32 %r31;\n" - ".reg .pred %r32;\n" - ".reg .u32 %r33;\n" - ".reg .pred %r34;\n" - ".local .align 8 .b8 %frame[4];\n" - "ld.param.u32 %ar1,[%in_ar1];\n" - "mov.u32 %r27,%ar1;\n" - "st.local.u32 [%frame],%r27;\n" - "ld.local.u32 %r28,[%frame];\n" - "mov.u32 %r29,1;\n" - "setp.eq.u32 %r30,%r28,%r29;\n" - "@%r30 bra $L4;\n" - "mov.u32 %r31,2;\n" - "setp.eq.u32 %r32,%r28,%r31;\n" - "@%r32 bra $L5;\n" - "mov.u32 %r33,0;\n" - "setp.eq.u32 %r34,%r28,%r33;\n" - "@!%r34 bra $L8;\n" - "mov.u32 %r23,%tid.x;\n" - "mov.u32 %r22,%r23;\n" - "bra $L7;\n" - "$L4:\n" - "mov.u32 %r24,%tid.y;\n" - "mov.u32 %r22,%r24;\n" - "bra $L7;\n" - "$L5:\n" - "mov.u32 %r25,%tid.z;\n" - "mov.u32 %r22,%r25;\n" - "bra $L7;\n" - "$L8:\n" - "{\n" - "{\n" - "call abort;\n" - "}\n" - "}\n" - "$L7:\n" - "mov.u32 %r26,%r22;\n" - "mov.u32 %retval,%r26;\n" - "st.param.u32 [%out_retval],%retval;\n" - "ret;\n" - "}\n" - ".visible .func (.param .u32 %out_retval) GOACC_ntid (.param .u32 %in_ar1)\n" - "{\n" - ".reg .u32 %ar1;\n" - ".reg .u32 %retval;\n" - ".reg .u64 %hr10;\n" - ".reg .u32 %r22;\n" - ".reg .u32 %r23;\n" - ".reg .u32 %r24;\n" - ".reg .u32 %r25;\n" - ".reg .u32 %r26;\n" - ".reg .u32 %r27;\n" - ".reg .u32 %r28;\n" - ".reg .u32 %r29;\n" - ".reg .pred %r30;\n" - ".reg .u32 %r31;\n" - ".reg .pred %r32;\n" - ".reg .u32 %r33;\n" - ".reg .pred %r34;\n" - ".local .align 8 .b8 %frame[4];\n" - "ld.param.u32 %ar1,[%in_ar1];\n" - "mov.u32 %r27,%ar1;\n" - "st.local.u32 [%frame],%r27;\n" - "ld.local.u32 %r28,[%frame];\n" - "mov.u32 %r29,1;\n" - "setp.eq.u32 %r30,%r28,%r29;\n" - "@%r30 bra $L11;\n" - "mov.u32 %r31,2;\n" - "setp.eq.u32 %r32,%r28,%r31;\n" - "@%r32 bra $L12;\n" - "mov.u32 %r33,0;\n" - "setp.eq.u32 %r34,%r28,%r33;\n" - "@!%r34 bra $L15;\n" - "mov.u32 %r23,%ntid.x;\n" - "mov.u32 %r22,%r23;\n" - "bra $L14;\n" - "$L11:\n" - "mov.u32 %r24,%ntid.y;\n" - "mov.u32 %r22,%r24;\n" - "bra $L14;\n" - "$L12:\n" - "mov.u32 %r25,%ntid.z;\n" - "mov.u32 %r22,%r25;\n" - "bra $L14;\n" - "$L15:\n" - "{\n" - "{\n" - "call abort;\n" - "}\n" - "}\n" - "$L14:\n" - "mov.u32 %r26,%r22;\n" - "mov.u32 %retval,%r26;\n" - "st.param.u32 [%out_retval],%retval;\n" - "ret;\n" - "}\n" - ".visible .func (.param .u32 %out_retval) GOACC_ctaid (.param .u32 %in_ar1)\n" - "{\n" - ".reg .u32 %ar1;\n" - ".reg .u32 %retval;\n" - ".reg .u64 %hr10;\n" - ".reg .u32 %r22;\n" - ".reg .u32 %r23;\n" - ".reg .u32 %r24;\n" - ".reg .u32 %r25;\n" - ".reg .u32 %r26;\n" - ".reg .u32 %r27;\n" - ".reg .u32 %r28;\n" - ".reg .u32 %r29;\n" - ".reg .pred %r30;\n" - ".reg .u32 %r31;\n" - ".reg .pred %r32;\n" - ".reg .u32 %r33;\n" - ".reg .pred %r34;\n" - ".local .align 8 .b8 %frame[4];\n" - "ld.param.u32 %ar1,[%in_ar1];\n" - "mov.u32 %r27,%ar1;\n" - "st.local.u32 [%frame],%r27;\n" - "ld.local.u32 %r28,[%frame];\n" - "mov.u32 %r29,1;\n" - "setp.eq.u32 %r30,%r28,%r29;\n" - "@%r30 bra $L18;\n" - "mov.u32 %r31,2;\n" - "setp.eq.u32 %r32,%r28,%r31;\n" - "@%r32 bra $L19;\n" - "mov.u32 %r33,0;\n" - "setp.eq.u32 %r34,%r28,%r33;\n" - "@!%r34 bra $L22;\n" - "mov.u32 %r23,%ctaid.x;\n" - "mov.u32 %r22,%r23;\n" - "bra $L21;\n" - "$L18:\n" - "mov.u32 %r24,%ctaid.y;\n" - "mov.u32 %r22,%r24;\n" - "bra $L21;\n" - "$L19:\n" - "mov.u32 %r25,%ctaid.z;\n" - "mov.u32 %r22,%r25;\n" - "bra $L21;\n" - "$L22:\n" - "{\n" - "{\n" - "call abort;\n" - "}\n" - "}\n" - "$L21:\n" - "mov.u32 %r26,%r22;\n" - "mov.u32 %retval,%r26;\n" - "st.param.u32 [%out_retval],%retval;\n" - "ret;\n" - "}\n" - ".visible .func (.param .u32 %out_retval) GOACC_nctaid (.param .u32 %in_ar1)\n" - "{\n" - ".reg .u32 %ar1;\n" - ".reg .u32 %retval;\n" - ".reg .u64 %hr10;\n" - ".reg .u32 %r22;\n" - ".reg .u32 %r23;\n" - ".reg .u32 %r24;\n" - ".reg .u32 %r25;\n" - ".reg .u32 %r26;\n" - ".reg .u32 %r27;\n" - ".reg .u32 %r28;\n" - ".reg .u32 %r29;\n" - ".reg .pred %r30;\n" - ".reg .u32 %r31;\n" - ".reg .pred %r32;\n" - ".reg .u32 %r33;\n" - ".reg .pred %r34;\n" - ".local .align 8 .b8 %frame[4];\n" - "ld.param.u32 %ar1,[%in_ar1];\n" - "mov.u32 %r27,%ar1;\n" - "st.local.u32 [%frame],%r27;\n" - "ld.local.u32 %r28,[%frame];\n" - "mov.u32 %r29,1;\n" - "setp.eq.u32 %r30,%r28,%r29;\n" - "@%r30 bra $L25;\n" - "mov.u32 %r31,2;\n" - "setp.eq.u32 %r32,%r28,%r31;\n" - "@%r32 bra $L26;\n" - "mov.u32 %r33,0;\n" - "setp.eq.u32 %r34,%r28,%r33;\n" - "@!%r34 bra $L29;\n" - "mov.u32 %r23,%nctaid.x;\n" - "mov.u32 %r22,%r23;\n" - "bra $L28;\n" - "$L25:\n" - "mov.u32 %r24,%nctaid.y;\n" - "mov.u32 %r22,%r24;\n" - "bra $L28;\n" - "$L26:\n" - "mov.u32 %r25,%nctaid.z;\n" - "mov.u32 %r22,%r25;\n" - "bra $L28;\n" - "$L29:\n" - "{\n" - "{\n" - "call abort;\n" - "}\n" - "}\n" - "$L28:\n" - "mov.u32 %r26,%r22;\n" - "mov.u32 %retval,%r26;\n" - "st.param.u32 [%out_retval],%retval;\n" - "ret;\n" - "}\n" - "// BEGIN GLOBAL FUNCTION DEF: GOACC_get_num_threads\n" - ".visible .func (.param .u32 %out_retval) GOACC_get_num_threads\n" - "{\n" - ".reg .u32 %retval;\n" - ".reg .u64 %hr10;\n" - ".reg .u32 %r22;\n" - ".reg .u32 %r23;\n" - ".reg .u32 %r24;\n" - ".reg .u32 %r25;\n" - ".reg .u32 %r26;\n" - ".reg .u32 %r27;\n" - ".reg .u32 %r28;\n" - ".reg .u32 %r29;\n" - "mov.u32 %r26,0;\n" - "{\n" - ".param .u32 %retval_in;\n" - "{\n" - ".param .u32 %out_arg0;\n" - "st.param.u32 [%out_arg0],%r26;\n" - "call (%retval_in),GOACC_ntid,(%out_arg0);\n" - "}\n" - "ld.param.u32 %r27,[%retval_in];\n" - "}\n" - "mov.u32 %r22,%r27;\n" - "mov.u32 %r28,0;\n" - "{\n" - ".param .u32 %retval_in;\n" - "{\n" - ".param .u32 %out_arg0;\n" - "st.param.u32 [%out_arg0],%r28;\n" - "call (%retval_in),GOACC_nctaid,(%out_arg0);\n" - "}\n" - "ld.param.u32 %r29,[%retval_in];\n" - "}\n" - "mov.u32 %r23,%r29;\n" - "mul.lo.u32 %r24,%r22,%r23;\n" - "mov.u32 %r25,%r24;\n" - "mov.u32 %retval,%r25;\n" - "st.param.u32 [%out_retval],%retval;\n" - "ret;\n" - "}\n" - "// BEGIN GLOBAL FUNCTION DEF: GOACC_get_thread_num\n" - ".visible .func (.param .u32 %out_retval) GOACC_get_thread_num\n" - "{\n" - ".reg .u32 %retval;\n" - ".reg .u64 %hr10;\n" - ".reg .u32 %r22;\n" - ".reg .u32 %r23;\n" - ".reg .u32 %r24;\n" - ".reg .u32 %r25;\n" - ".reg .u32 %r26;\n" - ".reg .u32 %r27;\n" - ".reg .u32 %r28;\n" - ".reg .u32 %r29;\n" - ".reg .u32 %r30;\n" - ".reg .u32 %r31;\n" - ".reg .u32 %r32;\n" - ".reg .u32 %r33;\n" - "mov.u32 %r28,0;\n" - "{\n" - ".param .u32 %retval_in;\n" - "{\n" - ".param .u32 %out_arg0;\n" - "st.param.u32 [%out_arg0],%r28;\n" - "call (%retval_in),GOACC_ntid,(%out_arg0);\n" - "}\n" - "ld.param.u32 %r29,[%retval_in];\n" - "}\n" - "mov.u32 %r22,%r29;\n" - "mov.u32 %r30,0;\n" - "{\n" - ".param .u32 %retval_in;\n" - "{\n" - ".param .u32 %out_arg0;\n" - "st.param.u32 [%out_arg0],%r30;\n" - "call (%retval_in),GOACC_ctaid,(%out_arg0);\n" - "}\n" - "ld.param.u32 %r31,[%retval_in];\n" - "}\n" - "mov.u32 %r23,%r31;\n" - "mul.lo.u32 %r24,%r22,%r23;\n" - "mov.u32 %r32,0;\n" - "{\n" - ".param .u32 %retval_in;\n" - "{\n" - ".param .u32 %out_arg0;\n" - "st.param.u32 [%out_arg0],%r32;\n" - "call (%retval_in),GOACC_tid,(%out_arg0);\n" - "}\n" - "ld.param.u32 %r33,[%retval_in];\n" - "}\n" - "mov.u32 %r25,%r33;\n" - "add.u32 %r26,%r24,%r25;\n" - "mov.u32 %r27,%r26;\n" - "mov.u32 %retval,%r27;\n" - "st.param.u32 [%out_retval],%retval;\n" - "ret;\n" - "}\n"); diff --git libgomp/oacc-parallel.c libgomp/oacc-parallel.c index 1fdb01d..9fe5020 100644 --- libgomp/oacc-parallel.c +++ libgomp/oacc-parallel.c @@ -194,7 +194,7 @@ GOACC_parallel_keyed (int device, void (*fn) (void *), acc_dev->openacc.async_set_async_func (acc_async_sync); } -/* Legacy entry point, only provide host execution. */ +/* Legacy entry point (GCC 5). Only provide host fallback execution. */ void GOACC_parallel (int device, void (*fn) (void *), @@ -494,12 +494,16 @@ GOACC_wait (int async, int num_waits, ...) goacc_thread ()->dev->openacc.async_wait_all_async_func (acc_async_noval); } +/* Legacy entry point (GCC 5). */ + int GOACC_get_num_threads (void) { return 1; } +/* Legacy entry point (GCC 5). */ + int GOACC_get_thread_num (void) {