|
From: | Laurent Amon |
Subject: | Re: [Qemu-devel] [Patch] Swapping functions for Mac OS X |
Date: | Mon, 26 Jul 2004 23:00:43 +0200 |
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, address@hidden wrote:
Benjamin,I think that the NXSwap functions are defined as inlined asm in the header.Pierre Quoting Benjamin Herrenschmidt <address@hidden>: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 MacOS 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 canuse inline assembly ? Actually, if the swap is done on data loaded/storedfrom/to memory, then you can use the ppc endian swapped load/store instructions Ben. _______________________________________________ Qemu-devel mailing list address@hidden http://lists.nongnu.org/mailman/listinfo/qemu-devel_______________________________________________ Qemu-devel mailing list address@hidden http://lists.nongnu.org/mailman/listinfo/qemu-devel
[Prev in Thread] | Current Thread | [Next in Thread] |