From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id 0D76D3858C83 for ; Wed, 9 Mar 2022 16:36:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0D76D3858C83 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-IronPort-AV: E=Sophos;i="5.90,167,1643702400"; d="scan'208";a="72917870" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 09 Mar 2022 08:36:26 -0800 IronPort-SDR: StOyXUa33GUinvIwP8RsNl1Z4JGEK1NAK97qFijmBz7olejrX78Si5BczM9sYnFcjizvge7Fh8 Pu3OnYLCdMzh9iOfNGYWrfTnW6D5WcaqBCr4N+qYyMh6qhBlEKU1+KGicQY9Hcr6pG4736jCbz rG2pXqZpTokdjR62QiaNUXxPj9jd7qwYLg6/B+3HrZ1foXXFduKifaSJtGBKrO8zd/SnJ1c7hl I8cv0z9qy/2GQuqiBTs+0hlUEbk9ZqybBntO9q0A2Qp34KeW7883N+vB7+3rpnSeLlmMRtt2NY zn8= Message-ID: <1354cbd1-259d-e946-07a6-ae72e252f4e4@codesourcery.com> Date: Wed, 9 Mar 2022 16:36:12 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [Patch] GCN: Implement __atomic_compare_exchange_{1, 2} in libgcc [PR102215] Content-Language: en-GB To: Tobias Burnus , gcc-patches References: From: Andrew Stubbs In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-14.mgc.mentorg.com (139.181.222.14) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, BODY_8BITS, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_SHORT, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Mar 2022 16:36:28 -0000 On 09/03/2022 16:29, Tobias Burnus wrote: > This shows up with with OpenMP offloading as libgomp since a couple > of months uses __atomic_compare_exchange (see PR for details), > causing link errors when the gcn libgomp.a is linked. > It also shows up with sollve_vv. > > The implementation does a bit copy'n'paste from the current > implementation + calls the existing word/uint32_t-wide version > of the atomic intrinsic. The semantic is described at > https://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html > > In terms of the args, the _4 has: > DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_COMPARE_EXCHANGE_4, >                   "__atomic_compare_exchange_4", >                   BT_FN_BOOL_VPTR_PTR_I4_BOOL_INT_INT, >                   ATTR_NOTHROWCALL_LEAF_LIST) > and the arg names try to match the GCC manual. > > > OK for mainline? > Tested with libgomp + sollve_vv and -march=gfx908. OK. Andrew