From patchwork Mon Sep 25 18:24:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 1839229 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RvWVq4ZQNz1yqR for ; Tue, 26 Sep 2023 04:24:35 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C6750385E012 for ; Mon, 25 Sep 2023 18:24:32 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id EC223385828E for ; Mon, 25 Sep 2023 18:24:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EC223385828E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-CSE-ConnectionGUID: EM8Y6MH4SWOhUPPdTDO7sg== X-CSE-MsgGUID: bftWdfDxQz67QMxJgyyrLg== X-IronPort-AV: E=Sophos;i="6.03,175,1694764800"; d="diff'?scan'208";a="17800136" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 25 Sep 2023 10:24:19 -0800 IronPort-SDR: BOa7QhEsddP2e4VBplAUo/iTPcGcf4w/nVbEa6rIPvVFSn/YMxLOu5q+wGQ/egTSZjhNSZLbbO h1u3CvlJbeHzBBBH7Gxr654KcvfNF1ar/HpKW0MV/dS7LMwa+6WcGR50ioJMdWiYc0qotBU5Xe 9yRSzzVKYv8VrMp3F4CjMPy8m/EObrheH24K5mMRzgYjMQb/MnCpZAuNZ8nuuGJFxzNUEM5wIB WO8WblVCODlXurbSISKPG/rE9y/a0J2kxfz9Jlyy0rOxeZQZQnNqAUd4yYrJyc/gRw/KPsTs57 v3k= Message-ID: Date: Mon, 25 Sep 2023 20:24:14 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: gcc-patches , Jakub Jelinek From: Tobias Burnus Subject: [patch] invoke.texi: Update -fopenmp and -fopenmp-simd for omp::decl and loop semantic X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-15.mgc.mentorg.com (139.181.222.15) To svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org I stumbled over this during the ARM64 talk at the cauldron as they consider using -fopenmp-simd by default. → https://gcc.gnu.org/wiki/cauldron2023 (I put my talk/BoF slides up; others aren't, yet) I did stumble over 'omp loop' with SIMD. It turns out that -fopenmp-simd just turns 'loop' into 'simd', ignoring whatever value the user has specified for the bind value. Additionally, [[omp::decl(...)]] was missing. Any comment to that patch before I commit it? Tobias PS: the [[omp::...]] needs a 'C++' → 'C/C++' change once omp:: support with C23's attributes is in. ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 invoke.texi: Update -fopenmp and -fopenmp-simd for omp::decl and loop semantic gcc/ChangeLog: PR middle-end/111547 * doc/invoke.texi (-fopenmp): Mention C++11 [[omp::decl(...)]] syntax. (-fopenmp-simd): Likewise. Clarify 'loop' directive semantic. gcc/doc/invoke.texi | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 146b40414b0..89c539f06c2 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -2766,8 +2766,9 @@ can be omitted, to use a target-specific default value. @cindex OpenMP parallel @item -fopenmp Enable handling of OpenMP directives @code{#pragma omp} in C/C++, -@code{[[omp::directive(...)]]} and @code{[[omp::sequence(...)]]} in C++ and -@code{!$omp} in Fortran. When @option{-fopenmp} is specified, the +@code{[[omp::directive(...)]]}, @code{[[omp::sequence(...)]]} and +@code{[[omp::decl(...)]]} in C++ and @code{!$omp} in Fortran. +When @option{-fopenmp} is specified, the compiler generates parallel code according to the OpenMP Application Program Interface v4.5 @w{@uref{https://www.openmp.org}}. This option implies @option{-pthread}, and thus is only supported on targets that @@ -2779,11 +2780,14 @@ have support for @option{-pthread}. @option{-fopenmp} implies @cindex SIMD @item -fopenmp-simd Enable handling of OpenMP's @code{simd}, @code{declare simd}, -@code{declare reduction}, @code{assume}, @code{ordered}, @code{scan}, -@code{loop} directives and combined or composite directives with +@code{declare reduction}, @code{assume}, @code{ordered}, @code{scan} +and @code{loop} directive, and of combined or composite directives with @code{simd} as constituent with @code{#pragma omp} in C/C++, -@code{[[omp::directive(...)]]} and @code{[[omp::sequence(...)]]} in C++ -and @code{!$omp} in Fortran. Other OpenMP directives are ignored. +@code{[[omp::directive(...)]]}, @code{[[omp::sequence(...)]]} and +@code{[[omp::decl(...)]]} in C++ and @code{!$omp} in Fortran. +Other OpenMP directives are ignored. Unless @option{-fopenmp} is +additionally specified, the @code{loop} region binds to the current +task region, independent of the specified @code{bind} clause. @opindex fopenmp-target-simd-clone @cindex OpenMP target SIMD clone