From owner-freebsd-arch@FreeBSD.ORG Fri Aug 2 10:06:12 2013 Return-Path: Delivered-To: freebsd-arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5C112834; Fri, 2 Aug 2013 10:06:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 1C30E2EEC; Fri, 2 Aug 2013 10:06:11 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 52C5E3C172B; Fri, 2 Aug 2013 20:05:26 +1000 (EST) Date: Fri, 2 Aug 2013 20:05:18 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Tijl Coosemans Subject: Re: [PATCH] Atomic swap and test-and-set In-Reply-To: <20130802105200.29672730@kalimero.tijl.coosemans.org> Message-ID: <20130802195156.Q1047@besplex.bde.org> References: <51F81A74.4030009@FreeBSD.org> <20130731173247.GK4972@kib.kiev.ua> <20130801055421.R2570@besplex.bde.org> <20130802105200.29672730@kalimero.tijl.coosemans.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=DstvpgP+ c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=1OkM0EXDtuEA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=TAuQMiTarRgA:10 a=ltDKUUI1AAAA:8 a=mDV3o1hIAAAA:8 a=Chh8ltowLiiSAWs7W10A:9 a=CjuIK1q_8ugA:10 a=JbAvG2SwbSEA:10 a=npukW5hYu58A:10 a=kT6dOc83ZcwA:10 Cc: Konstantin Belousov , Jung-uk Kim , dumbbell@FreeBSD.org, freebsd-arch@FreeBSD.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Aug 2013 10:06:12 -0000 On Fri, 2 Aug 2013, Tijl Coosemans wrote: > On Thu, 1 Aug 2013 06:42:21 +1000 (EST) Bruce Evans wrote: >> On Wed, 31 Jul 2013, Konstantin Belousov wrote: >>> I think that constraints for all added inlines contradict the explicit >>> requirement in the gcc documentation, which states that rmw operands >>> should be specified using the 'same location' output operand for the >>> input operand (hopefully this can be parsed). It just happens so that >>> for "m" compiler cannot do anything else then passing the address. >>> >>> The problem is not specific to the new functions, it seems to be present >>> in other functions as well, e.g. cmpset. This probably can be postponed. >> >> The problem is the opposite. The other functions used to use the '+' >> constraint to indicate input-output operands, but gcc broke this so it >> was changed in 2005. gcc.info still says fuzzily that the '+' constraint >> "should" only be used for operands that can be allocated in a register: > > That text has changed for gcc 4.8.0: > http://gcc.gnu.org/ml/gcc-patches/2012-10/msg02130.html > > It refers to a patch from 2004: > http://gcc.gnu.org/ml/gcc-patches/2004-05/msg00438.html > > That patch appears to be in all gcc 4.x releases. Actually, only a fixed version of it seems to be there. The version of gcc-4.2.1 in FreeBSD doesn't have a Changelog entry matching msg00438.html, but it has a patch that does more. The followup to msg00438.html pointed out a problem in the original patch (that it generates a matching input constraint too blindly and thus breaks the case of multiple alternatives). This seems to be fixed in the version in FreeBSD, but the followup stops at that point. So the pointer to the patch seems to be off by 1. msg02130.html gives the fuzzier pointer "back in 2004". These are still better in log messages than vcs-specific revision numbers. Bruce