From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BpCe6-0001Jb-1J for qemu-devel@nongnu.org; Mon, 26 Jul 2004 17:04:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BpCe5-0001JP-BS for qemu-devel@nongnu.org; Mon, 26 Jul 2004 17:04:29 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BpCe5-0001J8-6z for qemu-devel@nongnu.org; Mon, 26 Jul 2004 17:04:29 -0400 Received: from [213.228.0.169] (helo=postfix3-2.free.fr) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BpCal-0008UM-Fx for qemu-devel@nongnu.org; Mon, 26 Jul 2004 17:01:03 -0400 Received: from [192.168.1.30] (rkeller-2-81-57-247-13.fbx.proxad.net [81.57.247.13]) by postfix3-2.free.fr (Postfix) with ESMTP id E9198CAE9 for ; Mon, 26 Jul 2004 23:00:46 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v618) In-Reply-To: <1090864096.410543e04e12c@imp5-q.free.fr> References: <4AE591A8-D7F8-11D8-BD35-000A2796D230@free.fr> <1090679632.3753.0.camel@gaston> <1090864096.410543e04e12c@imp5-q.free.fr> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Laurent Amon Subject: Re: [Qemu-devel] [Patch] Swapping functions for Mac OS X Date: Mon, 26 Jul 2004 23:00:43 +0200 Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Since I just looked, I can confirm it. cpp includes this when including bswap.h : static __inline uint16_t OSReadSwapInt16( __volatile void * base, uintptr_t offset ) { uint16_t result; __asm__ __volatile("lhbrx %0, %1, %2" : "=r" (result) : "b%" (base), "r" (offset) : "memory"); return result; } And all wrappers are static inline so everything *should* get ASM inline. However, I ran a few benchmarks and it makes no difference. So either gcc 3.3 is intelligent enough to do it anyway, or the code does not rely much on them, or they do not perform on my PPC7410. This bears more investigation. Lga. On 26 juil. 04, at 19:48, stegefin@free.fr wrote: > Benjamin, > > I think that the NXSwap functions are defined as inlined asm in the > header. > > Pierre > > Quoting Benjamin Herrenschmidt : > >> >> On Sat, 2004-07-17 at 09:50, Pierre d'Herbemont wrote: >>> Hi Fabrice, >>> >>> I think it should be quite useful to use the swapping functions on >>> Mac >>> OS X. However I don't see a huge performance gain with this patch. >> >> Ugh ? How cna it be useful to call into library functions why you can >> use inline assembly ? Actually, if the swap is done on data >> loaded/stored >> from/to memory, then you can use the ppc endian swapped load/store >> instructions >> >> Ben. >> >> >> >> _______________________________________________ >> Qemu-devel mailing list >> Qemu-devel@nongnu.org >> http://lists.nongnu.org/mailman/listinfo/qemu-devel >> > > > > > _______________________________________________ > Qemu-devel mailing list > Qemu-devel@nongnu.org > http://lists.nongnu.org/mailman/listinfo/qemu-devel > >