From owner-freebsd-alpha@FreeBSD.ORG Thu Aug 7 13:37:35 2003 Return-Path: Delivered-To: freebsd-alpha@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4A8F437B401 for ; Thu, 7 Aug 2003 13:37:35 -0700 (PDT) Received: from mail.speakeasy.net (mail13.speakeasy.net [216.254.0.213]) by mx1.FreeBSD.org (Postfix) with ESMTP id 04B7443FBF for ; Thu, 7 Aug 2003 13:37:34 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 25674 invoked from network); 7 Aug 2003 20:37:33 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 7 Aug 2003 20:37:33 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.9/8.12.9) with ESMTP id h77KbV9s032475; Thu, 7 Aug 2003 16:37:31 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Thu, 07 Aug 2003 16:37:52 -0400 (EDT) From: John Baldwin To: deischen@freebsd.org cc: "Portante, Peter" cc: alpha@freebsd.org cc: Marcel Moolenaar Subject: Re: Atomic swap X-BeenThere: freebsd-alpha@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the Alpha List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2003 20:37:35 -0000 On 07-Aug-2003 Daniel Eischen wrote: > On Thu, 7 Aug 2003, Marcel Moolenaar wrote: > >> On Thu, Aug 07, 2003 at 03:31:55PM -0400, Daniel Eischen wrote: >> > > > > " stq t0,%3\n" >> > > ^^^^^^^^^^^^^^^^^^^^ >> > > >> > > Whoops, typo: %3 should be %2. >> > >> > Yup, I caught that but didn't want to complain when something >> > is handed to me on a silver platter ;-) >> >> As long as you saw it :-) > > BTW, this is the only way I got it to compile. The compiler > (or assembler) didn't seem to like having t0 and t1 hardcoded. > > Grr, I just remembered. t0, t1, etc are our names for > them. They should probably be $1 and $2. Yes, t0 and t1 are #define's, so they don't work in inline asm. Also, you should clobber them if you use them directly, i.e. __asm(" ldq $1, %1\n" (suggested by Peter I think) "1: ldq_l $1, %1\n" " mov %2, $2\n" " stq_c $2, %1\n" " beq $2, 1b\n" " stq $1, %0\n" : "+m" (*res) : "m" (*dst), "r" (val) : "memory", "$1", "$2"); -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/