From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id D63FB3857826 for ; Fri, 9 Oct 2020 23:29:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D63FB3857826 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=segher@kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 099NSPtC017533; Fri, 9 Oct 2020 18:28:25 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 099NSOu4017532; Fri, 9 Oct 2020 18:28:24 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Fri, 9 Oct 2020 18:28:24 -0500 From: Segher Boessenkool To: David Brown Cc: gcc-help@gcc.gnu.org Subject: Re: Atomic accesses on ARM microcontrollers Message-ID: <20201009232824.GM2672@gate.crashing.org> References: <945d5e74-b449-3746-6560-996d0437db76@hesbynett.no> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <945d5e74-b449-3746-6560-996d0437db76@hesbynett.no> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, TXREP, T_SPF_HELO_PERMERROR, T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Oct 2020 23:29:26 -0000 Hi! On Fri, Oct 09, 2020 at 08:28:05PM +0200, David Brown wrote: > For 8-bit, 16-bit and 32-bit types, atomic accesses are just simple > loads and stores. These are generated fine. > > But for 64-bit and above, there are library calls to a compiler-provided > library. > Is there any way I can replace this library with my own code here, while > still using the language atomics? Add something in libgcc/config/arm/ ? You might need to add something specific to some configuration (in some t-* file), or maybe add another command line flag. It sounds like you have to add more constraints on what atomic can be used for than what is specified currently. Segher