From owner-freebsd-audit Mon Feb 4 12:19:15 2002 Delivered-To: freebsd-audit@freebsd.org Received: from netau1.alcanet.com.au (ntp.alcanet.com.au [203.62.196.27]) by hub.freebsd.org (Postfix) with ESMTP id BA3A437B422; Mon, 4 Feb 2002 12:19:04 -0800 (PST) Received: from mfg1.cim.alcatel.com.au (mfg1.cim.alcatel.com.au [139.188.23.1]) by netau1.alcanet.com.au (8.9.3 (PHNE_22672)/8.9.3) with ESMTP id HAA07459; Tue, 5 Feb 2002 07:18:57 +1100 (EDT) Received: from gsmx07.alcatel.com.au by cim.alcatel.com.au (PMDF V5.2-32 #37645) with ESMTP id <01KDWNFYN7QO5IK551@cim.alcatel.com.au>; Tue, 5 Feb 2002 07:19:04 +1100 Received: (from jeremyp@localhost) by gsmx07.alcatel.com.au (8.11.6/8.11.6) id g14KIsH85819; Tue, 05 Feb 2002 07:18:54 +1100 Content-return: prohibited Date: Tue, 05 Feb 2002 07:18:54 +1100 From: Peter Jeremy Subject: Re: request for review: i386 64bit atomic patch In-reply-to: ; from mime@traveller.cz on Mon, Feb 04, 2002 at 12:24:44PM +0100 To: Michal Mertl Cc: audit@freebsd.org, jhb@freebsd.org Mail-Followup-To: Michal Mertl , audit@freebsd.org, jhb@freebsd.org Message-id: <20020205071853.H72285@gsmx07.alcatel.com.au> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-disposition: inline User-Agent: Mutt/1.2.5i References: Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 2002-Feb-04 12:24:44 +0100, Michal Mertl wrote: >+ " setz %%al ; " >+ " movzbl %%al,%0 ; " "%%al" could alternatively be written as "%b0" (From i386.md: 'b' => print the QImode name of the register for the indicated operand). >+ "#atomic_cmpset_64" >+ : "=a" (res), /* 0 */ The above change means that the "=a" could safely become "=q", which would allow gcc the freedom to pick something other than %eax. As a straight function, this doesn't help, but it may help for an inline. >+ : "a" ((u_long)exp), >+ "d" ((u_long)((u_long *)&exp)[1]), >+ "b" ((u_long)src), >+ "c" ((u_long)((u_long *)&src)[1]) I'd change these "u_long"s to "u_int32_t" or "u_register_t". This will stop the code breaking on bde's "long has 64 bits" test system. You might like to compare the code for "(u_long)((u_long *)&exp)[1]" with "(u_long)(exp >> 32)". >Thank Peter and John for your advices. What do you think now? Can someone >commit it? I don't see anything obviously wrong. Have you tested it with both gcc 2.95.1 and 3.x at various different optimisations? Constraint incompatibilities cause enough problems that we don't want to add any more. Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message