From owner-freebsd-amd64@FreeBSD.ORG Thu Dec 23 20:23:06 2004 Return-Path: Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 18DDA16A4CE for ; Thu, 23 Dec 2004 20:23:06 +0000 (GMT) Received: from mail4.speakeasy.net (mail4.speakeasy.net [216.254.0.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7468B43D2D for ; Thu, 23 Dec 2004 20:23:05 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: (qmail 32560 invoked from network); 23 Dec 2004 20:23:05 -0000 Received: from gate.funkthat.com (HELO hydrogen.funkthat.com) ([69.17.45.168]) (envelope-sender ) by mail4.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 23 Dec 2004 20:23:04 -0000 Received: from hydrogen.funkthat.com (pcryty@localhost.funkthat.com [127.0.0.1])iBNKN3GH052669; Thu, 23 Dec 2004 12:23:03 -0800 (PST) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.12.10/8.12.10/Submit) id iBNKN2po052668; Thu, 23 Dec 2004 12:23:02 -0800 (PST) Date: Thu, 23 Dec 2004 12:23:02 -0800 From: John-Mark Gurney To: Sean McNeil Message-ID: <20041223202302.GG19624@funkthat.com> Mail-Followup-To: Sean McNeil , amd64@freebsd.org References: <1103830283.53421.3.camel@server.mcneil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1103830283.53421.3.camel@server.mcneil.com> User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.2-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html cc: amd64@freebsd.org Subject: Re: what is the proper asm spec for xchg X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: John-Mark Gurney List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Dec 2004 20:23:06 -0000 Sean McNeil wrote this message on Thu, Dec 23, 2004 at 11:31 -0800: > I'm looking at why audio/sdl_mixer will not compile and I see that > devel/sdl12 has an include with > > #elif defined(__GNUC__) && defined(__x86_64__) > static __inline__ Uint16 SDL_Swap16(Uint16 x) > { > __asm__("xchgb %b0,%h0" : "=q" (x) : "0" (x)); > return x; > } > > This appears to be incorrect as it is giving errors when compiled. Does > anyone more conversant with asm directives for amd64 have an idea what > this should be? well, from amd64/include/endian.h: #define __byte_swap_word_var(x) \ __extension__ ({ register __uint16_t __X = (x); \ __asm ("xchgb %h0, %b0" : "+Q" (__X)); \ __X; }) -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."