From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934063AbdBVWns (ORCPT ); Wed, 22 Feb 2017 17:43:48 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:35078 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932433AbdBVWnk (ORCPT ); Wed, 22 Feb 2017 17:43:40 -0500 Date: Thu, 23 Feb 2017 07:43:37 +0900 From: Stafford Horne To: Richard Henderson Cc: Peter Zijlstra , Jonas Bonn , openrisc@lists.librecores.org, linux-kernel@vger.kernel.org, linux@roeck-us.net Subject: Re: [OpenRISC] [PATCH v3 08/25] openrisc: add cmpxchg and xchg implementations Message-ID: <20170222224337.GE2449@lianli.shorne-pla.net> References: <58010da3ed6e62743cc99674349f91022b41e92a.1487702890.git.shorne@gmail.com> <20170222111940.GR6500@twins.programming.kicks-ass.net> <20170222142007.GB2449@lianli.shorne-pla.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 23, 2017 at 04:30:35AM +1100, Richard Henderson wrote: > On 02/23/2017 01:20 AM, Stafford Horne wrote: > > On Wed, Feb 22, 2017 at 12:19:40PM +0100, Peter Zijlstra wrote: > > > On Wed, Feb 22, 2017 at 04:11:37AM +0900, Stafford Horne wrote: > > > > + __asm__ __volatile__( > > > > + "1: l.lwa %0, 0(%1) \n" > > > > + " l.sfeq %0, %2 \n" > > > > + " l.bnf 1f \n" > > > > + " l.nop \n" > > > > + " l.swa 0(%1), %3 \n" > > > > + " l.bnf 1b \n" > > > > + "1: l.nop \n" > > > > + : "=&r"(old) > > > > + : "r"(ptr), "r"(old), "r"(new) > > > > + : "cc", "memory"); > > > > > > I just noticed this, but having both labels have the same name is > > > somewhat confusing. > > > > Right, better to use '2' for the second one. > > Better still to put the second label after the delay-slot nop. > You don't need to execute that on the way out. Right, thats a good point, lots of cases like this. I will go through them. > r~ > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stafford Horne Date: Thu, 23 Feb 2017 07:43:37 +0900 Subject: [OpenRISC] [PATCH v3 08/25] openrisc: add cmpxchg and xchg implementations In-Reply-To: References: <58010da3ed6e62743cc99674349f91022b41e92a.1487702890.git.shorne@gmail.com> <20170222111940.GR6500@twins.programming.kicks-ass.net> <20170222142007.GB2449@lianli.shorne-pla.net> Message-ID: <20170222224337.GE2449@lianli.shorne-pla.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: openrisc@lists.librecores.org On Thu, Feb 23, 2017 at 04:30:35AM +1100, Richard Henderson wrote: > On 02/23/2017 01:20 AM, Stafford Horne wrote: > > On Wed, Feb 22, 2017 at 12:19:40PM +0100, Peter Zijlstra wrote: > > > On Wed, Feb 22, 2017 at 04:11:37AM +0900, Stafford Horne wrote: > > > > + __asm__ __volatile__( > > > > + "1: l.lwa %0, 0(%1) \n" > > > > + " l.sfeq %0, %2 \n" > > > > + " l.bnf 1f \n" > > > > + " l.nop \n" > > > > + " l.swa 0(%1), %3 \n" > > > > + " l.bnf 1b \n" > > > > + "1: l.nop \n" > > > > + : "=&r"(old) > > > > + : "r"(ptr), "r"(old), "r"(new) > > > > + : "cc", "memory"); > > > > > > I just noticed this, but having both labels have the same name is > > > somewhat confusing. > > > > Right, better to use '2' for the second one. > > Better still to put the second label after the delay-slot nop. > You don't need to execute that on the way out. Right, thats a good point, lots of cases like this. I will go through them. > r~ >