From owner-freebsd-hackers Thu Nov 29 5:33:35 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from straylight.ringlet.net (sentinel.office1.bg [217.75.134.126]) by hub.freebsd.org (Postfix) with SMTP id 8262837B43A for ; Thu, 29 Nov 2001 05:33:25 -0800 (PST) Received: (qmail 940 invoked by uid 1000); 29 Nov 2001 13:32:39 -0000 Date: Thu, 29 Nov 2001 15:32:39 +0200 From: Peter Pentchev To: John Baldwin Cc: David Xu , freebsd-hackers@FreeBSD.ORG Subject: Re: add some constraints in cpufunc.h Message-ID: <20011129153238.A782@straylight.oblivion.bg> Mail-Followup-To: John Baldwin , David Xu , freebsd-hackers@FreeBSD.ORG References: <00e701c17264$a4617130$ef01a8c0@davidwnt> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from jhb@FreeBSD.org on Wed, Nov 21, 2001 at 11:38:35AM -0800 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Nov 21, 2001 at 11:38:35AM -0800, John Baldwin wrote: > > On 21-Nov-01 David Xu wrote: > > 4.4-stable, file sys/i386/include/cpufunc.h, > > > > --- cpufunc.h.orig Wed Nov 21 13:35:36 2001 > > +++ cpufunc.h Wed Nov 21 15:00:12 2001 > > @@ -72,7 +72,7 @@ > > { > > u_int result; > > > > - __asm __volatile("bsfl %0,%0" : "=r" (result) : "0" (mask)); > > + __asm __volatile("bsfl %0,%0" : "=r" (result) : "0" (mask) : "cc"); > > return (result); > > } > > > > @@ -81,7 +81,7 @@ > > { > > u_int result; > > > > - __asm __volatile("bsrl %0,%0" : "=r" (result) : "0" (mask)); > > + __asm __volatile("bsrl %0,%0" : "=r" (result) : "0" (mask) : "cc"); > > return (result); > > } > > > > @@ -305,7 +305,7 @@ > > u_int result; > > > > __asm __volatile("xorl %0,%0; xchgl %1,%0" > > - : "=&r" (result) : "m" (*addr)); > > + : "=&r" (result) : "m" (*addr) : "cc"); > > return (result); > > } > > > > Have you had actual bugs as a result of "cc" not being in the constraints? > > If so, there's a _lot_ more places that need this. All the atomic ops, for > example. How about PR gnu/32365? I know next to nothing about assembler opcodes, if "cc" would fix the PR, then the PR is a demonstration of an actual bug. G'luck, Peter -- I am the thought you are now thinking. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message